63c278442e6bca6bd8e13a07ef8ecff2bf8c5a5c
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-05-04  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r216172.
4         https://bugs.webkit.org/show_bug.cgi?id=171654
5
6         FTBFS for iOS due to missing WebPageProxy::stopMediaCapture()
7         implementation. (Requested by ddkilzer on #webkit).
8
9         Reverted changeset:
10
11         "[MediaStream] Allow host application to enable/disable media
12         capture"
13         https://bugs.webkit.org/show_bug.cgi?id=171292
14         http://trac.webkit.org/changeset/216172
15
16 2017-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
17
18         [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
19         https://bugs.webkit.org/show_bug.cgi?id=171336
20
21         Reviewed by Michael Catanzaro.
22
23         We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update,
24         but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call
25         CompositingRunLoop::updateCompleted().
26
27         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
28         (WebKit::ThreadedCompositor::forceRepaint):
29         (WebKit::ThreadedCompositor::sceneUpdateFinished):
30         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
31
32 2017-05-04  David Kilzer  <ddkilzer@apple.com>
33
34         check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st'
35         <https://bugs.webkit.org/show_bug.cgi?id=171510>
36
37         Reviewed by Daniel Bates.
38
39         The problem was that 'import parser' was ambiguous since there
40         is a built-in parser module that comes with Python.  Changing
41         'import parser' to 'from webkit import parser' fixed the error
42         in check-webkit-style (and pylint) by forcing it to load the
43         local 'parser' module, but then running messages_unittest.py
44         directly would fail because .../Source/WebKit2/Scripts was not
45         in the module search path by default.  This is fixed by using
46         sys.path.append() to add .../Source/WebKit2/Scripts to the
47         module search path based on the path to messages_unittest.py.
48
49         As an added bonus, this patch also fixes all webkit-style issues
50         in Source/WebKit2/Scripts/webkit/*.py files.
51
52         * Scripts/webkit/messages.py:
53         - Separate local module imports from built-in modules for
54           consistency.
55         - Fix whitespace issues for check-webkit-style, and remove stray
56           semi-colon.
57         * Scripts/webkit/messages_unittest.py:
58         - Update sys.path to find the 'webkit' module based on the path
59           to messages_unittest.py.  This makes 'from webkit import ...'
60           statements work when running messages_unittest.py directly.
61         - Change 'messages' and 'parser' modules to use
62           'from webkit import ...' format for consistency.
63         - Fix whitespace issues for check-webkit-style.
64         * Scripts/webkit/model.py:
65         - Fix whitespace issue for check-webkit-style.
66         * Scripts/webkit/parser.py:
67         - Fix whitespace issue for check-webkit-style.
68
69 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
70
71         [MediaStream] Allow host application to enable/disable media capture
72         https://bugs.webkit.org/show_bug.cgi?id=171292
73         <rdar://problem/31821492>
74
75         Reviewed by Jer Noble.
76
77         * UIProcess/API/C/WKPage.cpp:
78         (WKPageSetMediaCaptureEnabled): New.
79         (WKPageGetMediaCaptureEnabled): New.
80         * UIProcess/API/C/WKPagePrivate.h:
81
82         * UIProcess/API/Cocoa/WKWebView.mm:
83         (-[WKWebView _setMediaCaptureEnabled:]): New.
84         (-[WKWebView _mediaCaptureEnabled]): New.
85         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
86
87         * UIProcess/Cocoa/UIDelegate.mm:
88         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
89         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
90         and iOS.
91
92         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
93         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
94         Initialize the rejection timer.
95         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
96         Call invalidatePendingRequests.
97         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
98         pending requests.
99         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
100         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
101         schedule the timer if there are any others pending.
102         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
103         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
104         prompt the user if capture is disabled.
105         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
106         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
107         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
108
109         * UIProcess/UserMediaProcessManager.cpp:
110         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
111         page on iOS.
112         (WebKit::UserMediaProcessManager::setCaptureEnabled):
113         * UIProcess/UserMediaProcessManager.h:
114
115         * UIProcess/WebPageProxy.cpp:
116         (WebKit::WebPageProxy::setMediaCaptureEnabled):
117
118         * UIProcess/WebPageProxy.h:
119         (WebKit::WebPageProxy::mediaCaptureEnabled):
120
121         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
122         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
123         requests.
124         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
125         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
126         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
127
128         * WebProcess/WebPage/WebPage.cpp:
129         (WebKit::WebPage::stopMediaCapture):
130         * WebProcess/WebPage/WebPage.h:
131         * WebProcess/WebPage/WebPage.messages.in:
132
133 2017-05-03  John Wilander  <wilander@apple.com>
134
135         Resource Load Statistics: Remove all statistics for modifiedSince website data removals
136         https://bugs.webkit.org/show_bug.cgi?id=171584
137         <rdar://problem/24702576>
138
139         Reviewed by Brent Fulgham.
140
141         These are all test infrastructure changes.
142
143         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
144         (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours):
145         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
146         * UIProcess/WebResourceLoadStatisticsManager.cpp:
147         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours):
148         * UIProcess/WebResourceLoadStatisticsManager.h:
149
150 2017-05-03  Timothy Horton  <timothy_horton@apple.com>
151
152         Maintain interaction information imageURL as a URL, not a string
153         https://bugs.webkit.org/show_bug.cgi?id=171639
154
155         Reviewed by Sam Weinig.
156
157         * Shared/ios/InteractionInformationAtPosition.h:
158         * UIProcess/ios/WKContentViewInteraction.mm:
159         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
160         (-[WKContentView _previewItemController:commitPreview:]):
161         * WebProcess/WebPage/ios/WebPageIOS.mm:
162         (WebKit::WebPage::getPositionInformation):
163
164 2017-05-03  Commit Queue  <commit-queue@webkit.org>
165
166         Unreviewed, rolling out r216160 and r216161.
167         https://bugs.webkit.org/show_bug.cgi?id=171640
168
169         These changes broke the iOS build. (Requested by mlewis13 on
170         #webkit).
171
172         Reverted changesets:
173
174         "[MediaStream] Allow host application to enable/disable media
175         capture"
176         https://bugs.webkit.org/show_bug.cgi?id=171292
177         http://trac.webkit.org/changeset/216160
178
179         "[MediaStream] Allow host application to enable/disable media
180         capture"
181         https://bugs.webkit.org/show_bug.cgi?id=171292
182         http://trac.webkit.org/changeset/216161
183
184 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
185
186         [MediaStream] Allow host application to enable/disable media capture
187         https://bugs.webkit.org/show_bug.cgi?id=171292
188         <rdar://problem/31821492>
189
190         Unreviewed build fix.
191
192         * UIProcess/WebPageProxy.cpp:
193         (WebKit::WebPageProxy::clearUserMediaState):
194         * UIProcess/WebPageProxy.h:
195
196 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
197
198         [MediaStream] Allow host application to enable/disable media capture
199         https://bugs.webkit.org/show_bug.cgi?id=171292
200         <rdar://problem/31821492>
201
202         Reviewed by Jer Noble.
203
204         * UIProcess/API/C/WKPage.cpp:
205         (WKPageSetMediaCaptureEnabled): New.
206         (WKPageGetMediaCaptureEnabled): New.
207         (WKPageClearUserMediaState): Deleted, unused.
208         * UIProcess/API/C/WKPagePrivate.h:
209
210         * UIProcess/API/Cocoa/WKWebView.mm:
211         (-[WKWebView _setMediaCaptureEnabled:]): New.
212         (-[WKWebView _mediaCaptureEnabled]): New.
213         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
214
215         * UIProcess/Cocoa/UIDelegate.mm:
216         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
217         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
218         and iOS.
219
220         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
221         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
222         Initialize the rejection timer.
223         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
224         Call invalidatePendingRequests.
225         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
226         pending requests.
227         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
228         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
229         schedule the timer if there are any others pending.
230         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
231         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
232         prompt the user if capture is disabled.
233         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
234         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
235         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
236
237         * UIProcess/UserMediaProcessManager.cpp:
238         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
239         page on iOS.
240         (WebKit::UserMediaProcessManager::setCaptureEnabled):
241         * UIProcess/UserMediaProcessManager.h:
242
243         * UIProcess/WebPageProxy.cpp:
244         (WebKit::WebPageProxy::setMediaCaptureEnabled):
245         (WebKit::WebPageProxy::clearUserMediaState): Deleted.
246
247         * UIProcess/WebPageProxy.h:
248         (WebKit::WebPageProxy::mediaCaptureEnabled):
249
250         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
251         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
252         requests.
253         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
254         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
255         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
256
257         * WebProcess/WebPage/WebPage.cpp:
258         (WebKit::WebPage::stopMediaCapture):
259         * WebProcess/WebPage/WebPage.h:
260         * WebProcess/WebPage/WebPage.messages.in:
261
262 2017-05-03  Tim Horton  <timothy_horton@apple.com>
263
264         Maintain interaction information URL as a URL, not a string
265         https://bugs.webkit.org/show_bug.cgi?id=171623
266
267         Reviewed by Simon Fraser.
268
269         * Shared/ios/InteractionInformationAtPosition.h:
270         * UIProcess/ios/WKContentViewInteraction.mm:
271         (-[WKContentView _showAttachmentSheet]):
272         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
273         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
274         * UIProcess/ios/WKPDFView.mm:
275         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
276         (-[WKPDFView actionSheetAssistant:performAction:]):
277         * WebProcess/WebPage/ios/WebPageIOS.mm:
278         (WebKit::WebPage::getPositionInformation):
279
280 2017-05-03  Simon Fraser  <simon.fraser@apple.com>
281
282         Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
283         https://bugs.webkit.org/show_bug.cgi?id=171619
284         
285         Also fixes webkit.org/b/170153 and webkit.org/b/170195
286
287         Reviewed by Tim Horton.
288
289         In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
290         the handler would always run, since we couldn't reliably test the phase of the current
291         transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
292         checking the transaction phase on newer iOS versions. If we're too late for the current transaction
293         we still need to dispatch_async() to get into the next one.
294
295         * UIProcess/API/Cocoa/WKWebView.mm:
296         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
297         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
298
299 2017-05-03  Chris Dumez  <cdumez@apple.com>
300
301         REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated
302         https://bugs.webkit.org/show_bug.cgi?id=171616
303
304         Reviewed by Brady Eidson.
305
306         Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to
307         WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called
308         after r216129. WebPageProxy::processDidCrash() already takes care of calling
309         resetStateAfterProcessExited().
310
311         * UIProcess/WebPageProxy.cpp:
312         (WebKit::WebPageProxy::terminateProcess):
313
314 2017-05-03  Brady Eidson  <beidson@apple.com>
315
316         Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge.
317         https://bugs.webkit.org/show_bug.cgi?id=171607
318
319         Reviewed by Andy Estes.
320         
321         To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now.
322
323         * UIProcess/PageLoadState.cpp:
324         (WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead.
325
326 2017-05-03  Chris Dumez  <cdumez@apple.com>
327
328         [WK2] Extend processDidCrash delegate to let the client know the reason for the crash
329         https://bugs.webkit.org/show_bug.cgi?id=171565
330         <rdar://problem/31204417>
331
332         Reviewed by Sam Weinig.
333
334         Extend processDidCrash delegate to let the client know the reason for the crash. This
335         is needed by some clients to distinguish actual crashes from terminations due to
336         resource limits.
337
338         * Shared/ProcessCrashReason.h: Added.
339         * UIProcess/API/APINavigationClient.h:
340         (API::NavigationClient::processDidCrash):
341         * UIProcess/API/C/WKAPICast.h:
342         (WebKit::toAPI):
343         * UIProcess/API/C/WKPage.cpp:
344         (WKPageSetPageNavigationClient):
345         * UIProcess/API/C/WKPageNavigationClient.h:
346         * UIProcess/API/C/WKProcessCrashReason.h: Added.
347         * UIProcess/Cocoa/NavigationState.h:
348         * UIProcess/Cocoa/NavigationState.mm:
349         (WebKit::NavigationState::NavigationClient::processDidCrash):
350         * UIProcess/WebPageProxy.cpp:
351         (WebKit::WebPageProxy::processDidCrash):
352         * UIProcess/WebPageProxy.h:
353         * UIProcess/WebProcessProxy.cpp:
354         (WebKit::WebProcessProxy::didClose):
355         (WebKit::WebProcessProxy::requestTermination):
356         (WebKit::diagnosticLoggingKeyForTerminationReason):
357         (WebKit::toProcessCrashReason):
358         (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits):
359         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
360         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
361         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
362         * UIProcess/WebProcessProxy.h:
363         * WebKit2.xcodeproj/project.pbxproj:
364
365 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
366
367         [GTK] Add GTK+ implementation of WebAutomationSession
368         https://bugs.webkit.org/show_bug.cgi?id=171431
369
370         Reviewed by Michael Catanzaro.
371
372         Add platform dependent methods for GTK+ to synthesize events.
373
374         * PlatformGTK.cmake:
375         * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation.
376         * UIProcess/Automation/WebAutomationSession.cpp:
377         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
378         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
379         (WebKit::WebAutomationSession::performMouseInteraction):
380         (WebKit::WebAutomationSession::performKeyboardInteractions):
381         * UIProcess/Automation/WebAutomationSession.h:
382         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added.
383         (WebKit::modifiersToEventState):
384         (WebKit::mouseButtonToGdkButton):
385         (WebKit::doMouseEvent):
386         (WebKit::doMotionEvent):
387         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
388         (WebKit::doKeyStrokeEvent):
389         (WebKit::keyCodeForVirtualKey):
390         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
391         (WebKit::WebAutomationSession::platformSimulateKeySequence):
392         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
393
394 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
395
396         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.
397
398         * gtk/NEWS: Add release notes for 2.17.1.
399
400 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
401
402         [Soup] Add request headers to network load metrics
403         https://bugs.webkit.org/show_bug.cgi?id=171545
404
405         Reviewed by Sergio Villar Senin.
406
407         This will make the headers to appear in the web inspector.
408
409         Fixes: http/tests/inspector/network/resource-request-headers.html
410
411         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
412         (WebKit::NetworkDataTaskSoup::didGetHeaders):
413
414 2017-05-02  Simon Fraser  <simon.fraser@apple.com>
415
416         Dynamically added position:fixed element is in the wrong place
417         https://bugs.webkit.org/show_bug.cgi?id=170280
418         rdar://problem/31374008
419
420         Reviewed by Tim Horton.
421
422         Layers for position:fixed elements have their positions reconciled after scrolls
423         via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
424         which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.
425
426         This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
427         position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
428         but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
429         but there was no signal to the UI process to restore the layer's pre-scrolled position.
430
431         Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
432         geometry updates in the web process always send new positions to the UI process.
433
434         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
435         (WebKit::PlatformCALayerRemote::setPosition):
436
437 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
438
439         [GTK] Drop coordinated surfaces from the compositing thread as soon as possible
440         https://bugs.webkit.org/show_bug.cgi?id=171544
441
442         Reviewed by Žan Doberšek.
443
444         Released coordinated surface from the main thread didn't be freed until
445         next commit message because the deletion of coordinated surfaces is
446         considered as a part of scene state.  We need to release corresponding
447         surfaces whenever the compositing coordinator drops update atlases to
448         reduce memory usages.
449
450         No new tests, only an optimization.
451
452         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
453         Remove atlasesToRemove from the GraphicsState. it is not a commit
454         state anymore.
455         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
456         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases):
457         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases):
458         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
459         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
460         (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of
461         released update atlases to the compositing thread right after cleaning
462         up deactivated update atlases.
463         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
464         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
465         (WebKit::CompositingCoordinator::clearPendingStateChanges):
466         (WebKit::CompositingCoordinator::removeUpdateAtlas):
467         (WebKit::CompositingCoordinator::releaseAtlases):
468         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
469         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
470         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
471         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
472         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
473
474 2017-05-02  Timothy Horton  <timothy_horton@apple.com>
475
476         Inform clients when viewport-fit state changes, so they can recompute insets
477         https://bugs.webkit.org/show_bug.cgi?id=171573
478         <rdar://problem/31947614>
479
480         Reviewed by Simon Fraser.
481
482         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
483         * UIProcess/API/Cocoa/WKWebView.mm:
484         (-[WKWebView _didChangeAvoidsUnsafeArea]):
485         * UIProcess/API/Cocoa/WKWebViewInternal.h:
486         * UIProcess/ios/PageClientImplIOS.mm:
487         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
488         For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
489         themselves, we need to let them know when the current state of
490         viewport-fit changes so that they can recompute the insets.
491
492 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
493
494         [GTK] Recycle textures while handling tiles
495         https://bugs.webkit.org/show_bug.cgi?id=171541
496
497         Reviewed by Žan Doberšek.
498
499         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
500         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
501         Whenever we create new tiles or delete tiles, CoordGfx creates and
502         deletes textures accordingly.  We should avoid this kind of heavy
503         operations whenever possible.  This patch modifies to use the texture
504         pool to reduce texture allocations.  Also this patch reduces number of
505         resetting textures, which is also expensive operation.
506         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
507         (WebKit::WebCoordinatedSurface::copyToTexture):
508         Modified to pass BitmapTexture as a reference.
509         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
510         (WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto.
511
512 2017-05-02  David Kilzer  <ddkilzer@apple.com>
513
514         Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm
515         <https://webkit.org/b/171520>
516
517         Reviewed by Chris Dumez.
518
519         * WebProcess/cocoa/WebProcessCocoa.mm:
520         (WebKit::WebProcess::registerWithStateDumper): Switch from
521         strcpy() to strlcpy(), removing comment in the process.
522
523 2017-05-02  Andrew Gold  <agold@apple.com>
524
525         MediaDevices is not enabled for MobileSafari
526         https://bugs.webkit.org/show_bug.cgi?id=171433
527         <rdar://problem/31923178>
528
529         Reviewed by Youenn Fablet.
530
531         Added the Cocoa API for toggling this feature and removed API for toggling
532         MediaStreamEnabled since it will always be on.
533
534         * UIProcess/API/Cocoa/WKPreferences.mm:
535         (-[WKPreferences _mediaDevicesEnabled]):
536         (-[WKPreferences _setMediaDevicesEnabled:]):
537         (-[WKPreferences _mediaStreamEnabled]): Deleted.
538         (-[WKPreferences _setMediaStreamEnabled:]): Deleted.
539         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
540
541 2017-05-02  Andy Estes  <aestes@apple.com>
542
543         REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated
544         https://bugs.webkit.org/show_bug.cgi?id=171539
545         <rdar://problem/31614982>
546
547         Reviewed by Tim Horton.
548
549         Prior to r213036, the layer tree transaction at last touch start was tracked by
550         WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for
551         its most recent transaction ID after ensuring that the WebPageProxy was valid.
552
553         r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to
554         check if _page was valid before asking for its drawing area proxy's last transaction ID; the
555         drawing area proxy is set to null on WebPageProxy invalidation.
556
557         * UIProcess/ios/WKContentViewInteraction.mm:
558         (-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid.
559
560 2017-05-02  Carlos Garcia Campos  <cgarcia@igalia.com>
561
562         Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms
563         https://bugs.webkit.org/show_bug.cgi?id=171107
564
565         Reviewed by Brian Burg.
566
567         The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to
568         WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods
569         in other platforms.
570
571         * UIProcess/Automation/Automation.json:
572         * UIProcess/Automation/WebAutomationSession.cpp:
573         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
574         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
575         * UIProcess/Automation/WebAutomationSession.h:
576         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
577         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
578         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
579
580 2017-05-01  Chris Dumez  <cdumez@apple.com>
581
582         Use RELEASE_LOG_ERROR() to do process termination logging
583         https://bugs.webkit.org/show_bug.cgi?id=171521
584
585         Reviewed by Andreas Kling.
586
587         Use RELEASE_LOG_ERROR() to do process termination logging instead of RELEASE_LOG().
588         This makes the issue more visible in Console.
589
590         * UIProcess/WebProcessProxy.cpp:
591         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
592         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
593         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
594
595 2017-05-01  Brady Eidson  <beidson@apple.com>
596
597         Only try to get sandbox extension handle for IndexedDB directory if it is set.
598         rdar://problem/31925828 and https://bugs.webkit.org/show_bug.cgi?id=171522
599
600         Reviewed by Andy Estes.
601
602         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
603         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
604
605 2017-05-01  Timothy Horton  <timothy_horton@apple.com>
606
607         Expose viewport-fit instead of clip-to-safe-area
608         https://bugs.webkit.org/show_bug.cgi?id=171503
609         <rdar://problem/31918249>
610
611         Reviewed by Simon Fraser.
612
613         * Shared/VisibleContentRectUpdateInfo.cpp:
614         (WebKit::VisibleContentRectUpdateInfo::encode):
615         (WebKit::VisibleContentRectUpdateInfo::decode):
616         (WebKit::operator<<):
617         * Shared/VisibleContentRectUpdateInfo.h:
618         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
619         (WebKit::VisibleContentRectUpdateInfo::unobscuredSafeAreaInsets):
620         (WebKit::operator==):
621         Plumb the safe area insets down from the UI process to the Web Content
622         process inside the visible content rect update, alongside the obscured
623         insets.
624
625         * Shared/mac/RemoteLayerTreeTransaction.h:
626         (WebKit::RemoteLayerTreeTransaction::avoidsUnsafeArea):
627         (WebKit::RemoteLayerTreeTransaction::setAvoidsUnsafeArea):
628         * Shared/mac/RemoteLayerTreeTransaction.mm:
629         (WebKit::RemoteLayerTreeTransaction::encode):
630         (WebKit::RemoteLayerTreeTransaction::decode):
631         (WebKit::RemoteLayerTreeTransaction::description):
632         * UIProcess/PageClient.h:
633         * UIProcess/ios/PageClientImplIOS.h:
634         * UIProcess/ios/PageClientImplIOS.mm:
635         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
636         (WebKit::PageClientImpl::didChangeClipToSafeArea): Deleted.
637         * UIProcess/ios/WebPageProxyIOS.mm:
638         (WebKit::WebPageProxy::didCommitLayerTree):
639         * UIProcess/mac/PageClientImpl.h:
640         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
641         (WebKit::WebChromeClient::didChangeClipToSafeArea): Deleted.
642         * WebProcess/WebCoreSupport/WebChromeClient.h:
643         * WebProcess/WebPage/WebPage.cpp:
644         (WebKit::WebPage::willCommitLayerTree):
645         * WebProcess/WebPage/ios/WebPageIOS.mm:
646         (WebKit::WebPage::viewportConfigurationChanged):
647         (WebKit::WebPage::updateVisibleContentRects):
648         * UIProcess/WebPageProxy.cpp:
649         (WebKit::WebPageProxy::resetState):
650         (WebKit::WebPageProxy::setAvoidsUnsafeArea):
651         (WebKit::WebPageProxy::setClipToSafeArea): Deleted.
652         * UIProcess/WebPageProxy.h:
653         (WebKit::WebPageProxy::avoidsUnsafeArea):
654         (WebKit::WebPageProxy::clipToSafeArea): Deleted.
655         * UIProcess/WebPageProxy.messages.in:
656         Plumb the effective value of viewport-fit (whether or not to avoid
657         the safe area for layout purposes) from the Web Content process
658         to the UI process inside the layer tree transaction.
659         Also, remove clip-to-safe-area plumbing.
660
661         * UIProcess/API/Cocoa/WKWebView.mm:
662         (-[WKWebView _initializeWithConfiguration:]):
663         (-[WKWebView _computedContentInset]):
664         (-[WKWebView _computedUnobscuredSafeAreaInset]):
665         (-[WKWebView _updateVisibleContentRects]):
666         (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]):
667         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
668         (-[WKWebView _unobscuredSafeAreaInsets]):
669         (-[WKWebView _setUnobscuredSafeAreaInsets:]):
670         (-[WKWebView _contentMayDrawInObscuredInsets]): Deleted.
671         * UIProcess/API/Cocoa/WKWebViewInternal.h:
672         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
673         Make use of the effective value of viewport-fit to decide whether to
674         take the safe area into account when computing the obscured insets,
675         and expose this to clients (in the case that they need to know
676         because they push their own obscured insets down). Also expose a 
677         safe area inset setter for that case as well.
678
679         * UIProcess/ios/WKContentView.h:
680         * UIProcess/ios/WKContentView.mm:
681         (-[WKContentView updateFixedClippingView:]):
682         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
683         Remove a piece of the clip-to-safe-area implementation, and plumb
684         safe area insets into the visible content rect update info.
685
686         * UIProcess/ios/WKScrollView.h:
687         * UIProcess/ios/WKScrollView.mm:
688         (-[WKScrollView initWithFrame:]):
689         (-[WKScrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden]):
690         (-[WKScrollView _setContentInsetAdjustmentBehavior:]):
691         (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
692         Keep track of whether the client has ever touched the content inset adjustment
693         behavior; if they have, we won't manage it ourselves.
694
695 2017-05-01  Brady Eidson  <beidson@apple.com>
696
697         Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.
698         <rdar://problem/31824838> and https://bugs.webkit.org/show_bug.cgi?id=171508
699
700         Reviewed by Andy Estes.
701
702         This patch:
703         - Renames WKURLSchemeHandlerTask to WKURLSchemeTask
704         - Renames the method "startTask" to "startURLSchemeTask"
705         - Renames the method "stopTask" to "stopURLSchemeTask"
706
707         To those effects it's basically a global replace.
708
709         * Shared/API/APIObject.h:
710         * Shared/Cocoa/APIObject.mm:
711         (API::Object::newObject):
712         * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp.
713         (API::URLSchemeTask::create):
714         (API::URLSchemeTask::URLSchemeTask):
715         * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h.
716         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
717         * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h.
718         * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm.
719         (raiseExceptionIfNecessary):
720         (-[WKURLSchemeTaskImpl request]):
721         (-[WKURLSchemeTaskImpl didReceiveResponse:]):
722         (-[WKURLSchemeTaskImpl didReceiveData:]):
723         (-[WKURLSchemeTaskImpl didFinish]):
724         (-[WKURLSchemeTaskImpl didFailWithError:]):
725         (-[WKURLSchemeTaskImpl _apiObject]):
726         * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h.
727         (WebKit::wrapper):
728         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
729         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
730         (WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
731         (WebKit::WebURLSchemeHandlerCocoa::platformStopTask):
732         * UIProcess/WebPageProxy.cpp:
733         (WebKit::WebPageProxy::startURLSchemeTask):
734         (WebKit::WebPageProxy::stopURLSchemeTask):
735         (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted.
736         (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted.
737         * UIProcess/WebPageProxy.h:
738         * UIProcess/WebPageProxy.messages.in:
739         * UIProcess/WebURLSchemeHandler.cpp:
740         (WebKit::WebURLSchemeHandler::startTask):
741         * UIProcess/WebURLSchemeHandler.h:
742         * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp.
743         (WebKit::WebURLSchemeTask::create):
744         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
745         (WebKit::WebURLSchemeTask::didReceiveResponse):
746         (WebKit::WebURLSchemeTask::didReceiveData):
747         (WebKit::WebURLSchemeTask::didComplete):
748         (WebKit::WebURLSchemeTask::pageDestroyed):
749         (WebKit::WebURLSchemeTask::stop):
750         * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h.
751         (WebKit::WebURLSchemeTask::identifier):
752         (WebKit::WebURLSchemeTask::request):
753         * WebKit2.xcodeproj/project.pbxproj:
754         * WebProcess/Network/WebLoaderStrategy.cpp:
755         (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy):
756         (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy):
757         (WebKit::WebLoaderStrategy::remove):
758         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted.
759         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted.
760         * WebProcess/Network/WebLoaderStrategy.h:
761         * WebProcess/WebPage/WebPage.cpp:
762         (WebKit::WebPage::urlSchemeTaskDidReceiveResponse):
763         (WebKit::WebPage::urlSchemeTaskDidReceiveData):
764         (WebKit::WebPage::urlSchemeTaskDidComplete):
765         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted.
766         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted.
767         (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted.
768         * WebProcess/WebPage/WebPage.h:
769         * WebProcess/WebPage/WebPage.messages.in:
770         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
771         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
772         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
773         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
774         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
775         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp.
776         (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
777         (WebKit::WebURLSchemeTaskProxy::startLoading):
778         (WebKit::WebURLSchemeTaskProxy::stopLoading):
779         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
780         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
781         (WebKit::WebURLSchemeTaskProxy::didComplete):
782         (WebKit::WebURLSchemeTaskProxy::hasLoader):
783         * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h.
784         (WebKit::WebURLSchemeTaskProxy::request):
785         (WebKit::WebURLSchemeTaskProxy::identifier):
786
787 2017-05-01  Chris Dumez  <cdumez@apple.com>
788
789         Tweak how long we allow a process to go over its background CPU limit
790         https://bugs.webkit.org/show_bug.cgi?id=170460
791         <rdar://problem/31433141>
792
793         Reviewed by Geoffrey Garen.
794
795         Tweak how long we allow a process to go over its background CPU limit. We now use 8 minutes
796         intervals (instead of previously 15). This is less conservative and aligned with our memory
797         kills.
798
799         * WebProcess/cocoa/WebProcessCocoa.mm:
800
801 2017-05-01  Beth Dakin  <bdakin@apple.com>
802
803         On-screen panel for candidate bar is in the wrong place when the caret is at the 
804         start of a paragraph
805         https://bugs.webkit.org/show_bug.cgi?id=171453
806         -and corresponding-
807         rdar://problem/29779764
808
809         Reviewed by Tim Horton.
810
811         This bug only happens when the caret is at the beginning of the paragraph, and it 
812         is because Range::absoluteTextQuads() returns no quads in this case. I think it 
813         might be correct that absoluteTextQuads() returns no quads in this case, so this 
814         patch fixes the bug at the call site by using absoluteCaretBounds() in this case.
815
816         SPI for testing.
817         * UIProcess/API/Cocoa/WKWebView.mm:
818         (-[WKWebView _candidateRect]):
819         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
820
821         Bug fix.
822         * WebProcess/WebPage/mac/WebPageMac.mm:
823         (WebKit::WebPage::platformEditorState):
824
825 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
826
827         [GTK] Add automation session API
828         https://bugs.webkit.org/show_bug.cgi?id=171428
829
830         Reviewed by Carlos Alberto Lopez Perez.
831
832         Add new API to allow WebKitGTK+ to be controlled by automation. By default it's disabled, applications have to
833         explicitly call webkit_web_context_set_automation_allowed() to enabled it. When a new automation session is
834         requested, the signal WebKitWebContext::automation-started is emitted with a newly created
835         WebKitAutomationSession, similar to how WebKitWebContext::download-started works. The user should connect to it
836         have access to the WebKitAutomationSession and connect it its signals. When a new web view is requested to be
837         created in a WebKitAutomationSession, the signal WebKitAutomationSession::create-web-view is emitted. The user
838         should connect to it and return a WebKitWebView. The web views used for automation are special ones and need to
839         be created with the new WebKitWebView:is-controlled-by-automation construct property enabled, otherwise we will
840         refuse to create the requested browsing context.
841
842         * PlatformGTK.cmake:
843         * UIProcess/API/gtk/WebKitAutomationSession.cpp: Added.
844         (webkitAutomationSessionSetProperty):
845         (webkitAutomationSessionConstructed):
846         (webkit_automation_session_class_init):
847         (webkitAutomationSessionCreate):
848         (webkitAutomationSessionGetSession):
849         (webkit_automation_session_get_id):
850         * UIProcess/API/gtk/WebKitAutomationSession.h: Added.
851         * UIProcess/API/gtk/WebKitAutomationSessionPrivate.h: Added.
852         * UIProcess/API/gtk/WebKitWebContext.cpp:
853         (webkitWebContextConstructed):
854         (webkit_web_context_class_init):
855         (webkit_web_context_is_automation_allowed):
856         (webkit_web_context_set_automation_allowed):
857         (webkitWebContextCreatePageForWebView):
858         * UIProcess/API/gtk/WebKitWebContext.h:
859         * UIProcess/API/gtk/WebKitWebView.cpp:
860         (webkitWebViewConstructed):
861         (webkitWebViewSetProperty):
862         (webkitWebViewGetProperty):
863         (webkit_web_view_class_init):
864         (webkit_web_view_is_controlled_by_automation):
865         * UIProcess/API/gtk/WebKitWebView.h:
866         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
867         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
868         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
869         * UIProcess/API/gtk/webkit2.h:
870
871 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
872
873         Unreviewed. Fix GTK+ debug build after r216002.
874
875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
876         (WebKit::wrapClientRectList):
877
878 2017-04-30  Chris Dumez  <cdumez@apple.com>
879
880         Drop support for legacy ClientRect / ClientRectList
881         https://bugs.webkit.org/show_bug.cgi?id=171418
882
883         Reviewed by Sam Weinig.
884
885         GTK build fix.
886
887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
888         (WebKit::kit):
889         (WebKit::core):
890         (WebKit::wrapClientRect):
891         (webkit_dom_client_rect_constructed):
892         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
893         (ClientRectList::create):
894         (ClientRectList::items):
895         (ClientRectList::ClientRectList):
896         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h:
897         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h:
898         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
899         (webkit_dom_element_get_bounding_client_rect):
900         (webkit_dom_element_get_client_rects):
901
902 2017-04-30  Brady Eidson  <beidson@apple.com>
903
904         More fixing after r215991
905         https://bugs.webkit.org/show_bug.cgi?id=171483
906
907         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
908         (WebKit::NetworkProcess::syncAllCookies):
909
910 2017-04-30  Brady Eidson  <beidson@apple.com>
911
912         Fix r215991
913         https://bugs.webkit.org/show_bug.cgi?id=171483
914
915         Unreviewed.
916
917         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
918         (WebKit::NetworkProcess::syncAllCookies):
919
920 2017-04-30  Dan Bernstein  <mitz@apple.com>
921
922         [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance()
923         https://bugs.webkit.org/show_bug.cgi?id=171485
924
925         Reviewed by Geoffrey Garen.
926
927         * Platform/mac/MenuUtilities.mm:
928         (WebKit::menuItemForTelephoneNumber):
929         (WebKit::menuForTelephoneNumber):
930
931 2017-04-30  Brady Eidson  <beidson@apple.com>
932
933         Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI.
934         <rdar://problem/31906397> and https://bugs.webkit.org/show_bug.cgi?id=171483
935
936         Reviewed by Geoff Garen (and kind of Andy Estes).
937         
938         Updates include:
939         -Taking a file path as the config argument instead of a directory.
940         -Proper sandbox extension handling.
941         -Proper and thorough API test.
942
943         * NetworkProcess/NetworkProcess.cpp:
944         (WebKit::NetworkProcess::syncAllCookies):
945         * NetworkProcess/NetworkProcess.h:
946         * NetworkProcess/NetworkProcess.messages.in:
947
948         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
949         (WebKit::NetworkProcess::syncAllCookies):
950
951         * NetworkProcess/mac/RemoteNetworkingContext.mm:
952         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
953
954         * Shared/WebsiteDataStoreParameters.cpp:
955         (WebKit::WebsiteDataStoreParameters::encode):
956         (WebKit::WebsiteDataStoreParameters::decode):
957         * Shared/WebsiteDataStoreParameters.h:
958
959         * UIProcess/API/Cocoa/WKProcessPool.mm:
960         (-[WKProcessPool _syncNetworkProcessCookies]):
961         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
962
963         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
964         (-[WKWebsiteDataStore _initWithConfiguration:]):
965
966         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
967         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
968         (-[_WKWebsiteDataStoreConfiguration _cookieStoragePath]):
969         (-[_WKWebsiteDataStoreConfiguration _setCookieStoragePath:]):
970         (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): Deleted.
971         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): Deleted.
972
973         * UIProcess/WebProcessPool.cpp:
974         (WebKit::WebProcessPool::syncNetworkProcessCookies):
975         * UIProcess/WebProcessPool.h:
976
977         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
978         (WebKit::WebsiteDataStore::parameters):
979
980         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
981         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
982
983         * UIProcess/WebsiteData/WebsiteDataStore.h:
984         (WebKit::WebsiteDataStore::resolvedCookieStoragePath):
985         (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): Deleted.
986
987 2017-04-30  Brady Eidson  <beidson@apple.com>
988
989         Regression (r215941) Unexpected logging causes perf tests to fail.
990         <rdar://problem/31907269> and https://bugs.webkit.org/show_bug.cgi?id=171482
991
992         Reviewed by Alexey Proskuryakov.
993
994         * Shared/mac/SandboxExtensionMac.mm:
995         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
996
997         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
998         (WebKit::WebProcessPool::networkingCachesDirectory):
999         (WebKit::WebProcessPool::webContentCachesDirectory):
1000
1001         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1002         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory
1003           if a custom one has been set.
1004
1005 2017-04-29  Youenn Fablet  <youenn@apple.com>
1006
1007         Readd assertion removed accidentally in r215955
1008         https://bugs.webkit.org/show_bug.cgi?id=171466
1009
1010         Reviewed by Eric Carlson.
1011
1012         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1013         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
1014
1015 2017-04-29  Andy Estes  <aestes@apple.com>
1016
1017         [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback
1018         https://bugs.webkit.org/show_bug.cgi?id=171468
1019         <rdar://problem/31900349>
1020
1021         Reviewed by Eric Carlson.
1022
1023         * UIProcess/Cocoa/WebViewImpl.mm:
1024         (WebKit::WebViewImpl::updateMediaTouchBar): Set canTogglePictureInPicture to YES by default
1025         on WebPlaybackControlsManager.
1026
1027 2017-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
1028
1029         Move WebCore CPUTime to WTF and implement it in all the platforms
1030         https://bugs.webkit.org/show_bug.cgi?id=171477
1031
1032         Reviewed by Chris Dumez.
1033
1034         We now hold Seconds in CPUTime instead of int64_t. It finally sends
1035         Seconds through WebKit2 IPC. We do not need to specialize ArgumentCoder
1036         for Seconds since Seconds just holds double.
1037
1038         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
1039         (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
1040         (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
1041         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
1042         * UIProcess/PerActivityStateCPUUsageSampler.h:
1043         * UIProcess/WebProcessPool.cpp:
1044         (WebKit::WebProcessPool::reportWebContentCPUTime):
1045         * UIProcess/WebProcessPool.h:
1046         * UIProcess/WebProcessPool.messages.in:
1047         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1048         (WebKit::WebChromeClient::reportProcessCPUTime):
1049         * WebProcess/WebCoreSupport/WebChromeClient.h:
1050
1051 2017-04-28  Brady Eidson  <beidson@apple.com>
1052
1053         Teach the DatabaseProcess to be fully SessionID aware
1054         https://bugs.webkit.org/show_bug.cgi?id=171451
1055
1056         Reviewed by Geoffrey Garen.
1057         
1058         SessionIDs were already at the periphery of IDB and the DatabaseProcess.
1059         Getting a separate IDBServer per SessionID is a pretty straightforward improvement.
1060
1061         * DatabaseProcess/DatabaseProcess.cpp:
1062         (WebKit::DatabaseProcess::idbServer):
1063         (WebKit::DatabaseProcess::initializeWebsiteDataStore):
1064         (WebKit::DatabaseProcess::fetchWebsiteData):
1065         (WebKit::DatabaseProcess::deleteWebsiteData):
1066         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
1067         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
1068         (WebKit::DatabaseProcess::initializeDatabaseProcess): Deleted.
1069         (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Deleted.
1070         (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Deleted.
1071         * DatabaseProcess/DatabaseProcess.h:
1072         (WebKit::DatabaseProcess::indexedDatabaseDirectory): Deleted.
1073         * DatabaseProcess/DatabaseProcess.messages.in:
1074
1075         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
1076         (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
1077         * DatabaseProcess/DatabaseToWebProcessConnection.h:
1078         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
1079
1080         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1081         (WebKit::WebIDBConnectionToClient::create):
1082         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1083         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
1084         (WebKit::WebIDBConnectionToClient::deleteDatabase):
1085         (WebKit::WebIDBConnectionToClient::openDatabase):
1086         (WebKit::WebIDBConnectionToClient::abortTransaction):
1087         (WebKit::WebIDBConnectionToClient::commitTransaction):
1088         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1089         (WebKit::WebIDBConnectionToClient::createObjectStore):
1090         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
1091         (WebKit::WebIDBConnectionToClient::renameObjectStore):
1092         (WebKit::WebIDBConnectionToClient::clearObjectStore):
1093         (WebKit::WebIDBConnectionToClient::createIndex):
1094         (WebKit::WebIDBConnectionToClient::deleteIndex):
1095         (WebKit::WebIDBConnectionToClient::renameIndex):
1096         (WebKit::WebIDBConnectionToClient::putOrAdd):
1097         (WebKit::WebIDBConnectionToClient::getRecord):
1098         (WebKit::WebIDBConnectionToClient::getAllRecords):
1099         (WebKit::WebIDBConnectionToClient::getCount):
1100         (WebKit::WebIDBConnectionToClient::deleteRecord):
1101         (WebKit::WebIDBConnectionToClient::openCursor):
1102         (WebKit::WebIDBConnectionToClient::iterateCursor):
1103         (WebKit::WebIDBConnectionToClient::establishTransaction):
1104         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1105         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
1106         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
1107         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
1108         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
1109         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
1110         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
1111         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1112
1113         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
1114         (WebKit::DatabaseProcessCreationParameters::encode):
1115         (WebKit::DatabaseProcessCreationParameters::decode):
1116         * Shared/Databases/DatabaseProcessCreationParameters.h:
1117
1118         * UIProcess/WebProcessPool.cpp:
1119         (WebKit::WebProcessPool::ensureDatabaseProcess):
1120         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
1121         (WebKit::WebProcessPool::pageAddedToProcess):
1122         * UIProcess/WebProcessPool.h:
1123
1124         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1125         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1126         (WebKit::WebsiteDataStore::databaseProcessParameters):
1127         * UIProcess/WebsiteData/WebsiteDataStore.h:
1128         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory):
1129
1130         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1131         (WebKit::WebIDBConnectionToServer::create):
1132         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
1133         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1134
1135         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
1136         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
1137
1138 2017-04-28  Youenn Fablet  <youenn@apple.com>
1139
1140         getUserMedia video streams should follow device orientation
1141         https://bugs.webkit.org/show_bug.cgi?id=171284
1142
1143         Reviewed by Eric Carlson.
1144
1145         Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory.
1146         Refactoring to return a CaptureSourceOrError instead of passing an out parameter in addition to returning a RefPtr.
1147
1148         * Shared/WebCoreArgumentCoders.h:
1149         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1150         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1151         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1152         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1153         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1154         (WebKit::UserMediaCaptureManager::createCaptureSource):
1155         (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted.
1156         * WebProcess/cocoa/UserMediaCaptureManager.h:
1157
1158 2017-04-28  Chris Dumez  <cdumez@apple.com>
1159
1160         [iOS] We should not take a background assertion for the UIProcess when app is MobileMail
1161         https://bugs.webkit.org/show_bug.cgi?id=171435
1162         <rdar://problem/31132330>
1163
1164         Reviewed by Geoffrey Garen.
1165
1166         Add SPI to disable taking on background process assertions in the UIProcess.
1167         This is useful for MobileMail.
1168
1169         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1170         (API::ProcessPoolConfiguration::copy):
1171         * UIProcess/API/APIProcessPoolConfiguration.h:
1172         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1173         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1174         (-[_WKProcessPoolConfiguration shouldTakeUIBackgroundAssertion]):
1175         (-[_WKProcessPoolConfiguration setShouldTakeUIBackgroundAssertion:]):
1176         * UIProcess/Network/NetworkProcessProxy.cpp:
1177         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1178         * UIProcess/ProcessAssertion.h:
1179         (WebKit::ProcessAssertion::setClient):
1180         * UIProcess/ProcessThrottler.cpp:
1181         (WebKit::ProcessThrottler::ProcessThrottler):
1182         (WebKit::m_shouldTakeUIBackgroundAssertion):
1183         (WebKit::ProcessThrottler::didConnectToProcess):
1184         * UIProcess/ProcessThrottler.h:
1185         * UIProcess/WebProcessPool.cpp:
1186         (WebKit::WebProcessPool::WebProcessPool):
1187         * UIProcess/WebProcessPool.h:
1188         * UIProcess/WebProcessProxy.cpp:
1189         (WebKit::WebProcessProxy::WebProcessProxy):
1190
1191 2017-04-28  Chris Dumez  <cdumez@apple.com>
1192
1193         Unreviewed attempt to fix iOS build after r215943.
1194
1195         * Configurations/Base.xcconfig:
1196
1197 2017-04-28  Andy Estes  <aestes@apple.com>
1198
1199         [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes
1200         https://bugs.webkit.org/show_bug.cgi?id=171434
1201         <rdar://problem/31887922>
1202
1203         Reviewed by Eric Carlson.
1204
1205         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
1206         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
1207         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
1208         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Set
1209         m_audioMediaSelectedIndex and notified clients.
1210         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Ditto for
1211         m_legibleMediaSelectedIndex.
1212         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Called
1213         WebPlaybackSessionModelContext::setAudioMediaSelectionIndex().
1214         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Called
1215         WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex().
1216         * WebProcess/cocoa/WebPlaybackSessionManager.h:
1217         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1218         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionIndexChanged): Called
1219         WebPlaybackSessionManager:: audioMediaSelectionIndexChanged().
1220         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionIndexChanged): Called
1221         WebPlaybackSessionManager::legibleMediaSelectionIndexChanged().
1222         (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): Sent
1223         WebPlaybackSessionManagerProxy::SetAudioMediaSelectionIndex().
1224         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): Sent
1225         WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionIndex().
1226
1227 2017-04-28  Brady Eidson  <beidson@apple.com>
1228
1229         Start of support for multiple WebsiteDataStore/SessionIDs per process
1230         https://bugs.webkit.org/show_bug.cgi?id=171422
1231
1232         Reviewed by Geoffrey Garen.
1233
1234         * CMakeLists.txt:
1235         * WebKit2.xcodeproj/project.pbxproj:
1236
1237         * NetworkProcess/NetworkProcess.cpp:
1238         (WebKit::NetworkProcess::addWebsiteDataStore):
1239         (WebKit::NetworkProcess::destroySession):
1240         (WebKit::NetworkProcess::destroyPrivateBrowsingSession): Deleted.
1241         * NetworkProcess/NetworkProcess.h:
1242         * NetworkProcess/NetworkProcess.messages.in:
1243
1244         * NetworkProcess/RemoteNetworkingContext.h:
1245         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1246         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1247         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
1248         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1249
1250         * Shared/WebsiteDataStoreParameters.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h.
1251         (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters):
1252         (WebKit::WebsiteDataStoreParameters::encode):
1253         (WebKit::WebsiteDataStoreParameters::decode):
1254         * Shared/WebsiteDataStoreParameters.h: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h.
1255
1256         * UIProcess/API/APIWebsiteDataStore.cpp:
1257         (API::WebsiteDataStore::defaultDataStore):
1258         (API::WebsiteDataStore::createLegacy):
1259         (API::WebsiteDataStore::WebsiteDataStore):
1260         (API::WebsiteDataStore::create): Deleted.
1261         * UIProcess/API/APIWebsiteDataStore.h:
1262
1263         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1264         (-[WKWebsiteDataStore _initWithConfiguration:]):
1265
1266         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1267         (webkitWebsiteDataManagerCreate):
1268         (webkitWebsiteDataManagerGetDataStore):
1269
1270         * UIProcess/WebPageProxy.cpp:
1271         (WebKit::m_weakPtrFactory):
1272         * UIProcess/WebPageProxy.h:
1273
1274         * UIProcess/WebProcessPool.cpp:
1275         (WebKit::WebProcessPool::WebProcessPool):
1276         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
1277         (WebKit::WebProcessPool::pageAddedToProcess):
1278         (WebKit::WebProcessPool::pageRemovedFromProcess):
1279
1280         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1281         (WebKit::WebsiteDataStore::parameters):
1282         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1283         (WebKit::WebsiteDataStore::create):
1284         (WebKit::WebsiteDataStore::WebsiteDataStore):
1285         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1286         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1287         (WebKit::WebsiteDataStore::parameters):
1288         * UIProcess/WebsiteData/WebsiteDataStore.h:
1289
1290         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
1291         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1292         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1293         (WebKit::WebFrameNetworkingContext::storageSession):
1294         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1295         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1296         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
1297
1298         * WebProcess/WebProcess.cpp:
1299         (WebKit::WebProcess::addWebsiteDataStore):
1300         (WebKit::WebProcess::destroySession):
1301         (WebKit::WebProcess::destroyPrivateBrowsingSession): Deleted.
1302         * WebProcess/WebProcess.h:
1303         * WebProcess/WebProcess.messages.in:
1304         * WebProcess/cocoa/WebProcessCocoa.mm:
1305
1306 2017-04-28  Youenn Fablet  <youenn@apple.com>
1307
1308         Adding a runtime flag specific to MediaDevices
1309         https://bugs.webkit.org/show_bug.cgi?id=171433
1310
1311         Reviewed by Geoffrey Garen.
1312
1313         Adding a preference for MediaDevices.
1314         Setting media devices runtime flag to false by default.
1315         Setting peer connection and media stream flags to true by default.
1316         Sending microphone sandbox extension based on media devices and not media stream flag.
1317
1318         * Shared/WebPreferencesDefinitions.h:
1319         * UIProcess/API/C/WKPreferences.cpp:
1320         (WKPreferencesSetMediaDevicesEnabled):
1321         (WKPreferencesGetMediaDevicesEnabled):
1322         * UIProcess/API/C/WKPreferencesRef.h:
1323         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1324         (WebKit::WebProcessPool::platformInitializeWebProcess):
1325         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1326         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1327         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1328         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1329         * WebProcess/WebPage/WebPage.cpp:
1330         (WebKit::WebPage::updatePreferences):
1331
1332 2017-04-28  Brady Eidson  <beidson@apple.com>
1333
1334         Teach WebProcessPool to track a map of SessionIDs to WebPageProxys to manage their lifetime
1335         https://bugs.webkit.org/show_bug.cgi?id=171408
1336
1337         Reviewed by Alex Christensen.
1338
1339         * UIProcess/API/APIPageConfiguration.cpp:
1340         (API::PageConfiguration::sessionID):
1341         * UIProcess/API/APIPageConfiguration.h:
1342         * UIProcess/WebPageProxy.cpp:
1343         (WebKit::WebPageProxy::reattachToWebProcess):
1344         (WebKit::WebPageProxy::close):
1345         * UIProcess/WebProcessPool.cpp:
1346         (WebKit::WebProcessPool::pageAddedToProcess):
1347         (WebKit::WebProcessPool::pageRemovedFromProcess):
1348         * UIProcess/WebProcessPool.h:
1349         * UIProcess/WebProcessProxy.cpp:
1350         (WebKit::WebProcessProxy::createWebPage):
1351         (WebKit::WebProcessProxy::addExistingWebPage):
1352         (WebKit::WebProcessProxy::removeWebPage):
1353         * UIProcess/WebProcessProxy.h:
1354
1355 2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1356
1357         Move UUID from WebCore/platform to WTF
1358         https://bugs.webkit.org/show_bug.cgi?id=171372
1359
1360         Reviewed by Michael Catanzaro.
1361
1362         * UIProcess/Automation/WebAutomationSession.cpp:
1363         (WebKit::WebAutomationSession::handleForWebPageProxy):
1364         (WebKit::WebAutomationSession::handleForWebFrameID):
1365         * UIProcess/gtk/WaylandCompositor.cpp:
1366         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1367         (WebKit::createUUID):
1368         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1369         (WebKit::PDFPlugin::openWithNativeApplication):
1370
1371 2017-04-27  Chris Dumez  <cdumez@apple.com>
1372
1373         Align colspan/rowspan limits with the latest HTML specification
1374         https://bugs.webkit.org/show_bug.cgi?id=171322
1375
1376         Reviewed by Darin Adler.
1377
1378         GTK build fix.
1379
1380         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
1381         (webkit_dom_html_table_cell_element_get_col_span):
1382         (webkit_dom_html_table_cell_element_set_col_span):
1383
1384 2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1385
1386         WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction
1387         https://bugs.webkit.org/show_bug.cgi?id=171386
1388         <rdar://problem/31557237>
1389
1390         Reviewed by Beth Dakin.
1391
1392         Add a new WKUIDelegate hook, _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:.
1393
1394         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1395
1396 2017-04-27  Brady Eidson  <beidson@apple.com>
1397
1398         Refactor SessionID to support multiple non-ephemeral (persistent) sessions.
1399         https://bugs.webkit.org/show_bug.cgi?id=171367
1400
1401         Reviewed by Andy Estes.
1402
1403         * Shared/ChildProcess.cpp:
1404         (WebKit::ChildProcess::initialize): Child processes should never be generating new SessionIDs,
1405           so enable generation protection.
1406
1407         * Shared/WebCoreArgumentCoders.cpp:
1408         (IPC::ArgumentCoder<SessionID>::encode): Deleted.
1409         (IPC::ArgumentCoder<SessionID>::decode): Deleted.
1410         * Shared/WebCoreArgumentCoders.h:
1411
1412         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1413         (WebKit::WebsiteDataStore::createNonPersistent):
1414         (WebKit::generateNonPersistentSessionID): Deleted.
1415
1416 2017-04-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1417
1418         REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument
1419         https://bugs.webkit.org/show_bug.cgi?id=170333
1420
1421         Reviewed by Simon Fraser.
1422
1423         Disbale the async decoding for large images for now.
1424
1425         * WebProcess/WebPage/WebPage.cpp:
1426         (WebKit::WebPage::updatePreferences):
1427
1428 2017-04-27  Brent Fulgham  <bfulgham@apple.com>
1429
1430         [WK2][macOS] Allow multi-touch related iokit-get-properties
1431         https://bugs.webkit.org/show_bug.cgi?id=171355
1432         <rdar://problem/31851928>
1433
1434         Reviewed by Alexey Proskuryakov.
1435
1436         During testing I've noticed Sandbox Violations being generated during some 'Force Touch' track pad use.
1437         The sandbox should allow these IOKit properties to be accessed.
1438
1439         * WebProcess/com.apple.WebProcess.sb.in:
1440
1441 2017-04-27  Alex Christensen  <achristensen@webkit.org>
1442
1443         Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration
1444         https://bugs.webkit.org/show_bug.cgi?id=171399
1445
1446         Reviewed by Brady Eidson.
1447
1448         This SPI isn't hooked up yet, but it has a test that will need to be updated once it works.
1449
1450         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1451         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1452         (-[WKWebsiteDataStore _initWithConfiguration:]):
1453         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h:
1454         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1455         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
1456         (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]):
1457         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]):
1458         * UIProcess/WebsiteData/WebsiteDataStore.h:
1459         (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory):
1460
1461 2017-04-27  Chris Dumez  <cdumez@apple.com>
1462
1463         Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
1464         https://bugs.webkit.org/show_bug.cgi?id=171226
1465
1466         Reviewed by Simon Fraser.
1467
1468         GTK build fix.
1469
1470         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1471         (toClientRect):
1472         (webkit_dom_element_get_bounding_client_rect):
1473         (webkit_dom_element_get_client_rects):
1474
1475 2017-04-27  Brady Eidson  <beidson@apple.com>
1476
1477         Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages.
1478         https://bugs.webkit.org/show_bug.cgi?id=171365
1479
1480         Reviewed by Andy Estes.
1481
1482         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1483         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1484
1485 2017-04-27  Alex Christensen  <achristensen@webkit.org>
1486
1487         Modernize Frame.h
1488         https://bugs.webkit.org/show_bug.cgi?id=171357
1489
1490         Reviewed by Andy Estes.
1491
1492         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1493         (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled):
1494         * WebProcess/WebCoreSupport/WebEditorClient.h:
1495         * WebProcess/WebPage/WebPage.cpp:
1496         (WebKit::WebPage::contextMenuAtPointInWindow):
1497         (WebKit::handleContextMenuEvent):
1498         (WebKit::WebPage::isSelectTrailingWhitespaceEnabled):
1499         * WebProcess/WebPage/WebPage.h:
1500         * WebProcess/WebPage/ios/WebPageIOS.mm:
1501         (WebKit::WebPage::selectWithGesture):
1502         (WebKit::WebPage::selectPositionAtPoint):
1503         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
1504         (WebKit::WebPage::rangeForGranularityAtPoint):
1505         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1506         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
1507         (WebKit::WebPage::updateSelectionWithExtentPoint):
1508
1509 2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1510
1511         [GTK] Remote inspector should support inspecting targets with previous version of backend commands
1512         https://bugs.webkit.org/show_bug.cgi?id=171267
1513
1514         Reviewed by Michael Catanzaro.
1515
1516         There's a FIXME for this in the code. The remote inspector proxy allows to pass a backend commands URL when
1517         inspecting a target. That URL, if not empty, is used as Protocol/InspectorBackendCommands.js in the inspector
1518         code instead of the local copy. We are currently assuming that both ends use the same version of that file.
1519
1520         * UIProcess/glib/RemoteInspectorClient.cpp:
1521         (WebKit::RemoteInspectorProxy::load): Pass RemoteInspectorClient::backendCommandsURL() to load().
1522         (WebKit::RemoteInspectorClient::setupConnection): Get the local backend commands hash and pass it to
1523         SetupInspectorClient method. Extract the server backend commands from the result and call setBackendCommands().
1524         (WebKit::RemoteInspectorClient::setBackendCommands): Create a data URL for the server backend commands file
1525         conents if needed.
1526         * UIProcess/glib/RemoteInspectorClient.h:
1527         (WebKit::RemoteInspectorClient::backendCommandsURL):
1528
1529 2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1530
1531         WebItemProviderPasteboard should not synchronously load provided data
1532         https://bugs.webkit.org/show_bug.cgi?id=171341
1533         <rdar://problem/31614010>
1534
1535         Reviewed by Tim Horton.
1536
1537         Adds plumbing for updatePreferredTypeIdentifiers through the WebPasteboardProxy. This allows the web process to
1538         signal to the UI process what UTIs the current drop target should accept and load. See WebCore ChangeLog for more
1539         details.
1540
1541         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1542         (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers):
1543         * UIProcess/WebPasteboardProxy.h:
1544         * UIProcess/WebPasteboardProxy.messages.in:
1545         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1546         (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers):
1547         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1548
1549 2017-04-26  Youenn Fablet  <youenn@apple.com>
1550
1551         Unauthenticated CORS preflight requests should not use client certificates
1552         https://bugs.webkit.org/show_bug.cgi?id=171298
1553
1554         Reviewed by Alex Christensen.
1555
1556         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1557         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ensuring that session dedicated to requests that do not want to use credentials do not look for client credentials.
1558
1559 2017-04-26  Eric Carlson  <eric.carlson@apple.com>
1560
1561         The current page is given a muted state when starting a media stream on iOS.
1562         https://bugs.webkit.org/show_bug.cgi?id=171290
1563         <rdar://problem/31821427>
1564
1565         Reviewed by Jer Noble.
1566
1567         * UIProcess/UserMediaProcessManager.cpp:
1568         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Don't mute the current
1569         page on iOS either, that will prevent the new media stream from playing.
1570
1571 2017-04-26  Alex Christensen  <achristensen@webkit.org>
1572
1573         Make user script injection more robust
1574         https://bugs.webkit.org/show_bug.cgi?id=171339
1575         <rdar://problem/30643691>
1576
1577         Reviewed by Geoffrey Garen.
1578
1579         * WebProcess/UserContent/WebUserContentController.cpp:
1580         (WebKit::WebUserContentController::forEachUserScript):
1581         (WebKit::WebUserContentController::forEachUserStyleSheet):
1582         (WebKit::WebUserContentController::forEachUserMessageHandler):
1583         * WebProcess/UserContent/WebUserContentController.h:
1584
1585 2017-04-26  Zalan Bujtas  <zalan@apple.com>
1586
1587         RTL: recent searches popover is displayed in incorrect location
1588         https://bugs.webkit.org/show_bug.cgi?id=171338
1589         <rdar://problem/31377807>
1590
1591         Reviewed by Dean Jackson.
1592
1593         Add RTL support for the pop-under branch.
1594
1595         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1596         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1597
1598 2017-04-26  Antti Koivisto  <antti@apple.com>
1599
1600         Enable expired-only reload policy on Mac and iOS
1601         https://bugs.webkit.org/show_bug.cgi?id=171264
1602         <rdar://problem/31807637>
1603
1604         Reviewed by Andreas Kling.
1605
1606         Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
1607         The behavor is enabled in Safari and for other clients based on SDK version check.
1608
1609         * UIProcess/API/C/WKPage.cpp:
1610         (WKPageReload):
1611         * UIProcess/API/Cocoa/WKWebView.mm:
1612         (-[WKWebView reload]):
1613         * UIProcess/Cocoa/VersionChecks.h:
1614
1615 2017-04-26  Andy Estes  <aestes@apple.com>
1616
1617         [macOS] Add picture-in-picture support to WebPlaybackControlsManager
1618         https://bugs.webkit.org/show_bug.cgi?id=171328
1619         <rdar://problem/29875010>
1620
1621         Reviewed by Jer Noble.
1622
1623         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
1624         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
1625         (WebKit::WebPlaybackSessionModelContext::togglePictureInPicture): Added. Calls
1626         WebPlaybackSessionManagerProxy::togglePictureAndPicture().
1627         (WebKit::WebPlaybackSessionManagerProxy::togglePictureInPicture): Added. Sends
1628         TogglePictureInPicture to WebPlaybackSessionManager.
1629         * UIProcess/Cocoa/WebViewImpl.mm:
1630         (WebKit::WebViewImpl::updateMediaTouchBar): Called
1631         -[WebPlaybackControlsManager setAllowsPictureInPicturePlayback:YES] if
1632         WebPreferences::allowsPictureInPictureMediaPlayback() is true.
1633         * WebProcess/cocoa/WebPlaybackSessionManager.h:
1634         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
1635         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1636         (WebKit::WebPlaybackSessionManager::togglePictureInPicture): Added. Sets a
1637         UserGestureIndicator and calls WebPlaybackSessionModel::togglePictureInPicture().
1638
1639 2017-04-26  Tim Horton  <timothy_horton@apple.com>
1640
1641         WebKit calls AppKit NSCell API from a background queue
1642         https://bugs.webkit.org/show_bug.cgi?id=171318
1643         <rdar://problem/31798317>
1644
1645         Reviewed by Anders Carlsson.
1646
1647         * UIProcess/mac/ServicesController.mm:
1648         (WebKit::ServicesController::refreshExistingServices):
1649         Synchronously bounce to the main thread to do non-thread-safe NSCell related work.
1650
1651 2017-04-25  Alex Christensen  <achristensen@webkit.org>
1652
1653         Encoded filename should be decoded for WKContentExtension.identifier
1654         https://bugs.webkit.org/show_bug.cgi?id=171316
1655
1656         Reviewed by Andy Estes.
1657
1658         * UIProcess/API/APIContentExtensionStore.cpp:
1659         (API::createExtension):
1660         (API::ContentExtensionStore::lookupContentExtension):
1661         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):
1662
1663 2017-04-26  Andrew Gold  <agold@apple.com>
1664
1665         Move mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences
1666         https://bugs.webkit.org/show_bug.cgi?id=171294
1667
1668         Reviewed by Eric Carlson.
1669
1670         Since we now want the ability to toggle this setting dynamically, I have
1671         moved it from WKWebViewConfiguration to WKPreferences.
1672
1673         * UIProcess/API/Cocoa/WKPreferences.mm:
1674         (-[WKPreferences _mediaStreamEnabled]):
1675         (-[WKPreferences _setMediaStreamEnabled:]):
1676
1677         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1678         * UIProcess/API/Cocoa/WKWebView.mm:
1679         (-[WKWebView _initializeWithConfiguration:]): No longer set mediaStream enabled from
1680         the configuration.
1681
1682         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1683         (-[WKWebViewConfiguration copyWithZone:]):
1684         (-[WKWebViewConfiguration _mediaStreamEnabled]): Deleted.
1685         (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Deleted.
1686         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1687
1688 2017-04-25  Alex Christensen  <achristensen@webkit.org>
1689
1690         REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
1691         https://bugs.webkit.org/show_bug.cgi?id=171297
1692         <rdar://problem/31530719>
1693
1694         Reviewed by Geoffrey Garen.
1695
1696         * Shared/WebEventConversion.cpp:
1697         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1698
1699 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1700
1701         Unreviewed, speculative build fix
1702
1703         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1704
1705         For the time being, remove all references to UIItemProviders from this private header.
1706         This should be fixed to use unavailability macros in a followup. See <rdar://problem/31827095>.
1707
1708 2017-04-25  Brent Fulgham  <bfulgham@apple.com>
1709
1710         Limit allowed size of document.title to avoid locking WebKit clients
1711         https://bugs.webkit.org/show_bug.cgi?id=165113
1712         <rdar://problem/28324389>
1713
1714         Reviewed by Darin Adler.
1715
1716         When a web application attempts to set an extremely long title, truncate the
1717         title to a more reasonable size.
1718
1719         We do this at at the presentation layer, rather than in the DOM, so that we do
1720         not affect script function. Instead, we merely limit display to a level that is
1721         reasonable for normal GUI widgets. Anything else needs to be truncated in the UI
1722         layer, so it is a waste of effort to send across IPC.
1723
1724         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1725         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
1726         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1727
1728 2017-04-25  John Wilander  <wilander@apple.com>
1729
1730         Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting
1731         https://bugs.webkit.org/show_bug.cgi?id=171295
1732         <rdar://problem/31823818>
1733
1734         Reviewed by Brent Fulgham.
1735
1736         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
1737         (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree):
1738         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler):
1739         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain):
1740             Changes and additions to test infrastructure.
1741         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
1742         * UIProcess/WebResourceLoadStatisticsManager.cpp:
1743         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
1744         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
1745         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain):
1746         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
1747             Changes and additions to test infrastructure.
1748         * UIProcess/WebResourceLoadStatisticsManager.h:
1749         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1750         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1751             No longer sends a boolean parameter to
1752             WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
1753
1754 2017-04-25  Simon Fraser  <simon.fraser@apple.com>
1755
1756         REGRESSION (r213719): WebGL content on cubeslam.com is 1/4 expected size
1757         https://bugs.webkit.org/show_bug.cgi?id=171300
1758         rdar://problem/31051538
1759
1760         Reviewed by Dean Jackson.
1761
1762         Propagating the contentsScale to the UI process for canvas content layers causes
1763         scaling issues, so don't do it for contents-provided layers.
1764         
1765         No test because WebGL can't be tested in the iOS simulator.
1766
1767         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1768         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
1769
1770 2017-04-25  Brady Eidson  <beidson@apple.com>
1771
1772         Update WebProcess(Pool) to assume there's always a WebsiteDataStore
1773         https://bugs.webkit.org/show_bug.cgi?id=171299
1774
1775         Reviewed by Alex Christensen.
1776
1777         * UIProcess/WebPageProxy.cpp:
1778         (WebKit::WebPageProxy::reattachToWebProcess):
1779         * UIProcess/WebProcessPool.cpp:
1780         (WebKit::WebProcessPool::createNewWebProcess):
1781         (WebKit::WebProcessPool::warmInitialProcess):
1782         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1783         (WebKit::WebProcessPool::createWebPage):
1784         * UIProcess/WebProcessPool.h:
1785         * UIProcess/WebProcessProxy.cpp:
1786         (WebKit::WebProcessProxy::create):
1787         (WebKit::WebProcessProxy::WebProcessProxy):
1788         (WebKit::m_userMediaCaptureManagerProxy):
1789         * UIProcess/WebProcessProxy.h:
1790         (WebKit::WebProcessProxy::websiteDataStore):
1791
1792 2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>
1793
1794         Unreviewed, rolling out r215730.
1795
1796         The LayoutTest for this change is a flaky timeout on mac-wk1
1797         debug.
1798
1799         Reverted changeset:
1800
1801         "Enable expired-only reload policy on Mac and iOS"
1802         https://bugs.webkit.org/show_bug.cgi?id=171264
1803         http://trac.webkit.org/changeset/215730
1804
1805 2017-04-24  Matt Rajca  <mrajca@apple.com>
1806
1807         Indicate presence of audio when handling autoplay events.
1808         https://bugs.webkit.org/show_bug.cgi?id=171227
1809
1810         Reviewed by Alex Christensen.
1811
1812         * UIProcess/API/APIUIClient.h:
1813         (API::UIClient::handleAutoplayEvent):
1814         * UIProcess/API/C/WKPage.cpp:
1815         (WKPageSetPageUIClient):
1816         * UIProcess/API/C/WKPageUIClient.h:
1817         * UIProcess/WebPageProxy.cpp:
1818         (WebKit::WebPageProxy::handleAutoplayEvent):
1819         * UIProcess/WebPageProxy.h:
1820         * UIProcess/WebPageProxy.messages.in:
1821         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1822         (WebKit::WebChromeClient::handleAutoplayEvent):
1823         * WebProcess/WebCoreSupport/WebChromeClient.h:
1824
1825 2017-04-25  Daniel Bates  <dabates@apple.com>
1826
1827         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
1828         https://bugs.webkit.org/show_bug.cgi?id=136452
1829         <rdar://problem/23412620>
1830
1831         Reviewed by Brent Fulgham.
1832
1833         Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.
1834
1835         * Configurations/FeatureDefines.xcconfig:
1836
1837 2017-04-25  John Wilander  <wilander@apple.com>
1838
1839         Resource Load Statistics: Clear network process cache when clearing store
1840         https://bugs.webkit.org/show_bug.cgi?id=171256
1841         <rdar://problem/31802347>
1842
1843         Reviewed by Brent Fulgham.
1844
1845         * NetworkProcess/NetworkProcess.cpp:
1846         (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
1847             Now takes and passes on the boolean parameter clearFirst to
1848             WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts().
1849         * NetworkProcess/NetworkProcess.h:
1850         * NetworkProcess/NetworkProcess.messages.in:
1851             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
1852             takes the boolean parameter clearFirst.
1853         * UIProcess/Network/NetworkProcessProxy.cpp:
1854         (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
1855             Now takes and passes on the boolean parameter clearFirst to
1856             Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains.
1857         * UIProcess/Network/NetworkProcessProxy.h:
1858         * UIProcess/Network/NetworkProcessProxy.messages.in:
1859             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
1860             takes the boolean parameter clearFirst.
1861         * UIProcess/WebResourceLoadStatisticsManager.cpp:
1862         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
1863             Now uses the boolean parameter clearFirst when calling
1864             WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
1865         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
1866             No longer uses the deleted store getter.
1867         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
1868             No longer uses the deleted store getter.
1869         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1870         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1871             No sends the boolean parameter clearFirst to
1872             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
1873         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
1874             Now expects a handler with the boolean parameter clearFirst.
1875         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1876         * UIProcess/WebResourceLoadStatisticsStore.h:
1877             Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore().
1878         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1879         (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
1880             Now takes and passes on the boolean parameter clearFirst in its
1881             message to the network process.
1882         (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
1883             Now expects a handler with the boolean parameter clearFirst.
1884         * UIProcess/WebsiteData/WebsiteDataStore.h:
1885
1886 2017-04-25  Chris Dumez  <cdumez@apple.com>
1887
1888         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
1889         https://bugs.webkit.org/show_bug.cgi?id=171239
1890         <rdar://problem/31789855>
1891
1892         Reviewed by Alex Christensen.
1893
1894         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML.
1895         This is not as per HTML specification:
1896         - https://html.spec.whatwg.org/#as-a-download (Step 2)
1897
1898         Content-Disposition header filename is supposed to override the value of the download attribute.
1899
1900         Firefox and Chrome follow the specification.
1901
1902         * NetworkProcess/NetworkProcess.cpp:
1903         (WebKit::NetworkProcess::findPendingDownloadLocation):
1904         * UIProcess/Downloads/DownloadProxy.cpp:
1905         (WebKit::DownloadProxy::didReceiveResponse):
1906
1907 2017-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1908
1909         [GTK] Add WebKitInspectorWindow to create inspector windows from local and remote inspector
1910         https://bugs.webkit.org/show_bug.cgi?id=171261
1911
1912         Reviewed by Michael Catanzaro.
1913
1914         The code is currently duplicated in WebInspectorProxyGtk.cpp and RemoteWebInspectorProxyGtk.cpp. We can simplify
1915         it by using a common widget in both places.
1916         This patch also fixes the build when using GTK+ < 3.16.
1917
1918         * PlatformGTK.cmake:
1919         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
1920         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
1921         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1922         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1923         (WebKit::WebInspectorProxy::createInspectorWindow):
1924         (WebKit::WebInspectorProxy::updateInspectorWindowTitle):
1925         * UIProcess/gtk/WebKitInspectorWindow.cpp: Added.
1926         (webkit_inspector_window_class_init):
1927         (webkit_inspector_window_init):
1928         (webkitInspectorWindowNew):
1929         (webkitInspectorWindowSetSubtitle):
1930         * UIProcess/gtk/WebKitInspectorWindow.h: Added.
1931
1932 2017-04-25  Antti Koivisto  <antti@apple.com>
1933
1934         Enable expired-only reload policy on Mac and iOS
1935         https://bugs.webkit.org/show_bug.cgi?id=171264
1936         <rdar://problem/31807637>
1937
1938         Reviewed by Andreas Kling.
1939
1940         Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
1941         The behavor is enabled in Safari and for other clients based on SDK version check.
1942
1943         * UIProcess/API/C/WKPage.cpp:
1944         (WKPageReload):
1945         * UIProcess/API/Cocoa/WKWebView.mm:
1946         (-[WKWebView reload]):
1947         * UIProcess/Cocoa/VersionChecks.h:
1948
1949 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1950
1951         Support reading NSURL titles from the pasteboard when performing data interaction
1952         https://bugs.webkit.org/show_bug.cgi?id=171156
1953         <rdar://problem/31356937>
1954
1955         Reviewed by Tim Horton.
1956
1957         Adjust for interface changes in WebCore to support plumbing the title of an NSURL from the platform pasteboard
1958         back to WebCore. Additionally, implement WebEditorClient::hasRichlyEditableSelection (which previously returned
1959         false) to check whether the current selection is richly editable, or the drop caret is in richly editable content.
1960         See WebCore ChangeLog for more details.
1961
1962         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1963         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
1964         * UIProcess/WebPasteboardProxy.h:
1965         * UIProcess/WebPasteboardProxy.messages.in:
1966         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1967         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
1968         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1969         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
1970         (WebKit::WebEditorClient::hasRichlyEditableSelection):
1971         * WebProcess/WebPage/WebPage.cpp:
1972         (WebKit::WebPage::hasRichlyEditableSelection):
1973         * WebProcess/WebPage/WebPage.h:
1974
1975 2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1976
1977         Respect fidelity order when reading web content from item providers
1978         https://bugs.webkit.org/show_bug.cgi?id=171155
1979         <rdar://problem/31356937>
1980
1981         Reviewed by Tim Horton.
1982
1983         Adjusts for changes in WebCore by adding plumbing to support Pasteboard::getTypesByFidelityForItemAtIndex. See
1984         WebCore/ChangeLog for more details.
1985
1986         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1987         (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex):
1988         * UIProcess/WebPasteboardProxy.h:
1989         * UIProcess/WebPasteboardProxy.messages.in:
1990         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1991         (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex):
1992         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1993
1994 2017-04-24  Brady Eidson  <beidson@apple.com>
1995
1996         WebProcessPools should always have a WebsiteDataStore
1997         https://bugs.webkit.org/show_bug.cgi?id=171252
1998
1999         Reviewed by Alex Christensen.
2000
2001         * UIProcess/API/APIWebsiteDataStore.cpp:
2002         (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted.
2003         * UIProcess/API/APIWebsiteDataStore.h:
2004         * UIProcess/API/C/WKContext.cpp:
2005         (WKContextGetWebsiteDataStore):
2006         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2007         (WebKit::WebProcessPool::platformInitialize):
2008         * UIProcess/WebProcessPool.cpp:
2009         (WebKit::WebProcessPool::WebProcessPool):
2010         (WebKit::WebProcessPool::createWebPage):
2011         * UIProcess/WebProcessPool.h:
2012         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2013         (WebKit::WebsiteDataStore::isAssociatedProcessPool):
2014
2015 2017-04-24  Youenn Fablet  <youenn@apple.com>
2016
2017         Set defaults video getUserMedia constraints
2018         https://bugs.webkit.org/show_bug.cgi?id=171127
2019
2020         Reviewed by Eric Carlson.
2021
2022         Updated to cope with MediaStreamConstraintsImpl refactoring.
2023
2024         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2025         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2026         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2027         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2028
2029 2017-04-24  Chris Dumez  <cdumez@apple.com>
2030
2031         Allow tabs with capturing audio or video to exceed background CPU limit
2032         https://bugs.webkit.org/show_bug.cgi?id=171249
2033         <rdar://problem/31796314>
2034
2035         Reviewed by Geoffrey Garen.
2036
2037         Allow tabs with capturing audio or video to exceed background CPU limit as this
2038         is a legit case of potentially high background CPU use.
2039
2040         * UIProcess/WebProcessProxy.cpp:
2041         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
2042
2043 2017-04-24  Andy Estes  <aestes@apple.com>
2044
2045         Try to fix the 32-bit macOS build.
2046
2047         * UIProcess/Cocoa/WebViewImpl.mm:
2048
2049 2017-04-24  Andy Estes  <aestes@apple.com>
2050
2051         [macOS] Enable media selection button on AVTouchBarScrubber
2052         https://bugs.webkit.org/show_bug.cgi?id=171149
2053         <rdar://problem/29875010>
2054
2055         Reviewed by Beth Dakin.
2056
2057         * UIProcess/Cocoa/WebViewImpl.mm:
2058         (WebKit::WebViewImpl::updateMediaTouchBar):
2059
2060 2017-04-24  Alex Christensen  <achristensen@webkit.org>
2061
2062         Reduce copies and allocations in SharedBuffer::append
2063         https://bugs.webkit.org/show_bug.cgi?id=170956
2064
2065         Reviewed by Andreas Kling.
2066
2067         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2068         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2069         * Platform/IPC/DataReference.cpp:
2070         (IPC::SharedBufferDataReference::encode):
2071         * Shared/ShareableResource.cpp:
2072         (WebKit::ShareableResource::wrapInSharedBuffer):
2073         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
2074         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
2075         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2076         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
2077         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2078         (WebKit::PDFPlugin::addArchiveResource):
2079         (WebKit::PDFPlugin::liveResourceData):
2080         (WebKit::PDFPlugin::writeItemsToPasteboard):
2081         * WebProcess/Plugins/PluginView.cpp:
2082         (WebKit::PluginView::redeliverManualStream):
2083         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2084         (WebKit::WebDragClient::declareAndWriteDragImage):
2085         * WebProcess/WebPage/mac/WebPageMac.mm:
2086         (WebKit::WebPage::cachedResponseDataForURL):
2087
2088 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2089
2090         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
2091         https://bugs.webkit.org/show_bug.cgi?id=166680
2092
2093         Reviewed by Michael Catanzaro.
2094
2095         Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a
2096         custom protocol "inspector" that loads a page with the list of debuggable targets.
2097
2098         * PlatformGTK.cmake: Add new files to compilation and remove the old ones.
2099         * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed.
2100         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added.
2101         (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler):
2102         (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler):
2103         (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed):
2104         (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed):
2105         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
2106         (WebKit::RemoteInspectorProtocolHandler::inspect):
2107         (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
2108         (WebKit::RemoteInspectorProtocolHandler::connectionClosed):
2109         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added.
2110         * UIProcess/API/gtk/WebKitWebContext.cpp:
2111         (webkitWebContextConstructed):
2112         * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs.
2113         * UIProcess/InspectorServer/HTTPRequest.h:
2114         * UIProcess/InspectorServer/WebInspectorServer.h:
2115         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed.
2116         * UIProcess/RemoteWebInspectorProxy.cpp:
2117         * UIProcess/RemoteWebInspectorProxy.h:
2118         * UIProcess/WebProcessPool.cpp:
2119         * UIProcess/glib/RemoteInspectorClient.cpp: Added.
2120         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
2121         (WebKit::RemoteInspectorClient::~RemoteInspectorClient):
2122         (WebKit::dbusConnectionCallAsyncReadyCallback):
2123         (WebKit::RemoteInspectorClient::connectionClosedCallback):
2124         (WebKit::RemoteInspectorClient::setupConnection):
2125         (WebKit::RemoteInspectorClient::connectionClosed):
2126         (WebKit::RemoteInspectorClient::inspect):
2127         (WebKit::RemoteInspectorClient::sendMessageToBackend):
2128         (WebKit::RemoteInspectorClient::closeFromFrontend):
2129         (WebKit::RemoteInspectorClient::setTargetList):
2130         (WebKit::RemoteInspectorClient::sendMessageToFrontend):
2131         * UIProcess/glib/RemoteInspectorClient.h: Added.
2132         (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver):
2133         (WebKit::RemoteInspectorClient::targets):
2134         (WebKit::RemoteInspectorClient::hostAndPort):
2135         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added.
2136         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
2137         (WebKit::inspectorViewDestroyed):
2138         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
2139         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
2140         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
2141         (WebKit::RemoteWebInspectorProxy::platformSave):
2142         (WebKit::RemoteWebInspectorProxy::platformAppend):
2143         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
2144         (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab):
2145         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2146         (WebKit::initializeRemoteInspectorServer):
2147         (WebKit::WebProcessPool::platformInitialize):
2148         (WebKit::WebProcessPool::platformInitializeWebProcess):
2149         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
2150         (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes.
2151         * config.h:
2152
2153 2017-04-23  Dan Bernstein  <mitz@apple.com>
2154
2155         [macOS] WKWebInspectorProxyObjCAdapter has a public ivar
2156         https://bugs.webkit.org/show_bug.cgi?id=171200
2157
2158         Reviewed by Geoffrey Garen.
2159
2160         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private.
2161
2162 2017-04-23  Commit Queue  <commit-queue@webkit.org>
2163
2164         Unreviewed, rolling out r215657 and r215676.
2165         https://bugs.webkit.org/show_bug.cgi?id=171201
2166
2167         Broke the build (Requested by ap on #webkit).
2168
2169         Reverted changesets:
2170
2171         "[macOS] Enable media selection button on AVTouchBarScrubber"
2172         https://bugs.webkit.org/show_bug.cgi?id=171149
2173         http://trac.webkit.org/changeset/215657
2174
2175         "Build fix after r215657."
2176         http://trac.webkit.org/changeset/215676
2177
2178 2017-04-23  Alexey Proskuryakov  <ap@apple.com>
2179
2180         Build fix after r215657.
2181
2182         * UIProcess/Cocoa/WebViewImpl.mm:
2183
2184 2017-04-23  Andy Estes  <aestes@apple.com>
2185
2186         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
2187         https://bugs.webkit.org/show_bug.cgi?id=171192
2188         <rdar://problem/29875010>
2189
2190         Reviewed by Wenson Hsieh.
2191
2192         * Shared/WebCoreArgumentCoders.cpp:
2193         (IPC::ArgumentCoder<MediaSelectionOption>::encode):
2194         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
2195         * Shared/WebCoreArgumentCoders.h:
2196         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
2197         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
2198         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
2199         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions):
2200         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions):
2201         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
2202         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
2203         * WebProcess/cocoa/WebPlaybackSessionManager.h:
2204         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2205         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged):
2206         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged):
2207         (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
2208         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
2209
2210 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2211
2212         Support writing link titles to the pasteboard when beginning data interaction on a link
2213         https://bugs.webkit.org/show_bug.cgi?id=171154
2214         <rdar://problem/31356937>
2215
2216         Reviewed by Andy Estes.
2217
2218         Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details.
2219
2220         * Scripts/webkit/messages.py:
2221         (headers_for_type):
2222         * Shared/WebCoreArgumentCoders.cpp:
2223         (IPC::ArgumentCoder<PasteboardURL>::encode):
2224         (IPC::ArgumentCoder<PasteboardURL>::decode):
2225         * Shared/WebCoreArgumentCoders.h:
2226
2227         Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and
2228         its title.
2229
2230         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2231         (WebKit::WebPasteboardProxy::writeURLToPasteboard):
2232         * UIProcess/WebPasteboardProxy.h:
2233         * UIProcess/WebPasteboardProxy.messages.in:
2234
2235         Add IPC plumbing for writing PasteboarURLs to the pasteboard.
2236
2237         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2238         (WebKit::WebPlatformStrategies::writeToPasteboard):
2239         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2240
2241 2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2242
2243         Unreviewed, rolling out r215608.
2244
2245         Hundreds of test failures on GTK bot
2246
2247         Reverted changeset:
2248
2249         "Reduce copies and allocations in SharedBuffer::append"
2250         https://bugs.webkit.org/show_bug.cgi?id=170956
2251         http://trac.webkit.org/changeset/215608
2252
2253 2017-04-21  Andy Estes  <aestes@apple.com>
2254
2255         [macOS] Enable media selection button on AVTouchBarScrubber
2256         https://bugs.webkit.org/show_bug.cgi?id=171149
2257         <rdar://problem/29875010>
2258
2259         Reviewed by Beth Dakin.
2260
2261         * UIProcess/Cocoa/WebViewImpl.mm:
2262         (WebKit::WebViewImpl::updateMediaTouchBar):
2263
2264 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2265
2266         [WK2] Add delegate hooks for overriding unhanded data interaction operations
2267         https://bugs.webkit.org/show_bug.cgi?id=171005
2268         <rdar://problem/31669646>
2269
2270         Reviewed by Tim Horton.
2271
2272         Adds support for overriding data interaction operations through two new delegate methods:
2273         _webView:willUpdateDataInteractionOperationToOperation:forSession:, and
2274         _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different
2275         operation type than what WebKit would originally have returned, and the latter may be overridden to run custom
2276         logic after the web process has handled a data interaction operation.
2277
2278         Additionally, includes some minor cleanup around WKContentViewInteraction. With the new
2279         _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate
2280         may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely.
2281         Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct
2282         instead, so that all state associated with data interaction may be cleaned up at the same time.
2283
2284         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2285         * UIProcess/API/Cocoa/WKWebView.mm:
2286         (-[WKWebView _testingDelegate]): Deleted.
2287         (-[WKWebView _setTestingDelegate:]): Deleted.
2288         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2289         * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed.
2290         * UIProcess/PageClient.h:
2291         * UIProcess/WebPageProxy.h:
2292         * UIProcess/WebPageProxy.messages.in:
2293
2294         Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process
2295         know whether or not the data interaction operation was handled by the web process, and is eventually plumbed
2296         through to the UI delegate via the new SPI.
2297
2298         * UIProcess/ios/PageClientImplIOS.h:
2299         * UIProcess/ios/PageClientImplIOS.mm:
2300         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
2301         * UIProcess/ios/WKContentViewInteraction.h:
2302         * UIProcess/ios/WKContentViewInteraction.mm:
2303         (-[WKContentView cleanupInteraction]):
2304         (-[WKContentView _displayFormNodeInputView]):
2305         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2306         * UIProcess/ios/WebPageProxyIOS.mm:
2307         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
2308         * WebKit2.xcodeproj/project.pbxproj:
2309         * WebProcess/WebPage/WebPage.cpp:
2310         (WebKit::WebPage::performDragControllerAction):
2311
2312 2017-04-21  Anders Carlsson  <andersca@apple.com>
2313
2314         Stop using deprecated APIs, part 5
2315         https://bugs.webkit.org/show_bug.cgi?id=171134
2316         rdar://problem/31589635
2317
2318         Reviewed by Tim Horton.
2319
2320         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2321         (WebKit::toPKPaymentAuthorizationStatus):
2322         Remove this and add a new version that doesn't use any deprecated values.
2323
2324         (WebKit::toPKPaymentAuthorizationStatus):
2325         New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes.
2326
2327         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
2328         Use the new toPKPaymentAuthorizationStatus versions.
2329
2330         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
2331         Ditto.
2332
2333         (WebKit::status): Deleted.
2334
2335 2017-04-21  David Kilzer  <ddkilzer@apple.com>
2336
2337         Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
2338         <https://webkit.org/b/171122>
2339
2340         Reviewed by Brent Fulgham.
2341
2342         * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
2343         headers to check for build settings.
2344
2345 2017-04-21  Jer Noble  <jer.noble@apple.com>
2346
2347         [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess
2348         https://bugs.webkit.org/show_bug.cgi?id=170846
2349
2350         Reviewed by Jon Lee.
2351
2352         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2353         (WebKit::UserMediaCaptureManagerProxy::setMuted):
2354         (WebKit::UserMediaCaptureManagerProxy::setEnabled):
2355         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2356         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2357         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2358         (WebKit::UserMediaCaptureManager::Source::setMuted):
2359         (WebKit::UserMediaCaptureManager::Source::setEnabled):
2360         (WebKit::UserMediaCaptureManager::setMuted):
2361         (WebKit::UserMediaCaptureManager::setEnabled):
2362         * WebProcess/cocoa/UserMediaCaptureManager.h:
2363
2364 2017-04-21  Jer Noble  <jer.noble@apple.com>
2365
2366         [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess
2367         https://bugs.webkit.org/show_bug.cgi?id=170847
2368
2369         Reviewed by Jon Lee.
2370
2371         * Shared/WebPreferencesDefinitions.h:
2372         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2373         (-[WKWebViewConfiguration copyWithZone:]):
2374         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted.
2375         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted.
2376
2377 2017-04-21  Anders Carlsson  <andersca@apple.com>
2378
2379         Stop using deprecated APIs, part 4
2380         https://bugs.webkit.org/show_bug.cgi?id=171125
2381         rdar://problem/31589635
2382
2383         Reviewed by Tim Horton.
2384
2385         It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point
2386         so just remove the status parameter.
2387
2388         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2389         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
2390         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
2391         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
2392
2393 2017-04-21  Andrew Gold  <agold@apple.com>
2394
2395         -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] 
2396         decision handler should only have one parameter.
2397         https://bugs.webkit.org/show_bug.cgi?id=171081
2398
2399         Reviewed by Tim Horton.
2400
2401         Because user media authorization is all or nothing, we should not have separate booleans
2402         to indicate authorization. Additionally, rather than passing two separate booleans to the
2403         UIDelegate, we now pass an NS_OPTIONS parameter.
2404
2405         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2406         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS.
2407
2408         * UIProcess/Cocoa/UIDelegate.mm:
2409         * UIProcess/Cocoa/UIDelegate.mm:
2410         (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method.
2411         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
2412
2413 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2414
2415         Unreviewed, added missing file to PlatformMac.cmake
2416
2417         * PlatformMac.cmake:
2418
2419 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2420
2421         Unreviewed follow-up for r215609
2422
2423         * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too.
2424
2425 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2426
2427         Include iOS-specific headers inside preprocessor guard
2428         https://bugs.webkit.org/show_bug.cgi?id=171104
2429
2430         Reviewed by Michael Catanzaro.
2431
2432         This patch should fix Mac cmake build.
2433
2434         * UIProcess/API/Cocoa/WKWebView.mm:
2435
2436 2017-04-21  Alex Christensen  <achristensen@webkit.org>
2437
2438         Reduce copies and allocations in SharedBuffer::append
2439         https://bugs.webkit.org/show_bug.cgi?id=170956
2440
2441         Reviewed by Andreas Kling.
2442
2443         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2444         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2445         * Platform/IPC/DataReference.cpp:
2446         (IPC::SharedBufferDataReference::encode):
2447         * Shared/ShareableResource.cpp:
2448         (WebKit::ShareableResource::wrapInSharedBuffer):
2449         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
2450         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
2451         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2452         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
2453         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2454         (WebKit::PDFPlugin::addArchiveResource):
2455         (WebKit::PDFPlugin::liveResourceData):
2456         (WebKit::PDFPlugin::writeItemsToPasteboard):
2457         * WebProcess/Plugins/PluginView.cpp:
2458         (WebKit::PluginView::redeliverManualStream):
2459         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2460         (WebKit::WebDragClient::declareAndWriteDragImage):
2461         * WebProcess/WebPage/mac/WebPageMac.mm:
2462         (WebKit::WebPage::cachedResponseDataForURL):
2463
2464 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
2465
2466         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
2467         https://bugs.webkit.org/show_bug.cgi?id=171071
2468
2469         Reviewed by Michael Catanzaro.
2470
2471         "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
2472         build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
2473         be available for all ports.
2474
2475         * CMakeLists.txt:
2476         * PlatformMac.cmake:
2477
2478 2017-04-20  Brady Eidson  <beidson@apple.com>
2479
2480         WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:...
2481         <rdar://problem/31739023> and https://bugs.webkit.org/show_bug.cgi?id=171090
2482
2483         Reviewed by Andy Estes.
2484
2485         * UIProcess/Cocoa/UIDelegate.mm:
2486         (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly.
2487
2488 2017-04-20  Dan Bernstein  <mitz@apple.com>
2489
2490         Disable header postprocessing when building for Sierra
2491
2492         Absolutely rubber-stamped by Anders Carlsson.
2493
2494         * Configurations/WebKit.xcconfig:
2495
2496 2017-04-20  Matt Rajca  <mrajca@apple.com>
2497
2498         Cocoa: add private API for suppressing first responder changes
2499         https://bugs.webkit.org/show_bug.cgi?id=171069
2500         <rdar://problem/31658967>
2501
2502         Reviewed by Tim Horton.
2503
2504         Some clients may not want the web view to be programmatically made the first responder
2505         and invoking -makeFirstResponder: unconditionally posts 'first responder did change'
2506         notifications.
2507
2508         Added API test.
2509
2510         * UIProcess/API/Cocoa/WKWebView.mm:
2511         (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
2512         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2513         * UIProcess/Cocoa/WebViewImpl.h:
2514         * UIProcess/Cocoa/WebViewImpl.mm:
2515         (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges):
2516         * UIProcess/PageClient.h:
2517         * UIProcess/mac/PageClientImpl.h:
2518         * UIProcess/mac/PageClientImpl.mm:
2519         (WebKit::PageClientImpl::makeFirstResponder):
2520
2521 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
2522
2523         [MediaStream iOS] Hold process assertion while media capture is active
2524         https://bugs.webkit.org/show_bug.cgi?id=171017
2525         <rdar://problem/31719177>
2526
2527         Reviewed by Dean Jackson.
2528
2529         * UIProcess/WebPageProxy.cpp:
2530         (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary.
2531         (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active.
2532         (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted,
2533         so pass IsCapturingMedia to activityStateDidChange.
2534         (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto.
2535
2536         * WebProcess/WebPage/WebPage.cpp:
2537         (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture
2538         is active. 
2539
2540 2017-04-20  Anders Carlsson  <andersca@apple.com>
2541
2542         Fix build.
2543
2544         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2545         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
2546
2547 2017-04-20  Brady Eidson  <beidson@apple.com>
2548
2549         Add CompletionHandlerCallChecker to SPI added in r215545.
2550         https://bugs.webkit.org/show_bug.cgi?id=171067
2551
2552         Reviewed by Dan Bernstein.
2553
2554         * UIProcess/Cocoa/UIDelegate.mm:
2555         (WebKit::UIDelegate::UIClient::createNewPageCommon):
2556
2557 2017-04-20  Anders Carlsson  <andersca@apple.com>
2558
2559         Replace isFinalStateStatus with isFinalStateResult
2560         https://bugs.webkit.org/show_bug.cgi?id=171072
2561         rdar://problem/31589635
2562
2563         Reviewed by Tim Horton.
2564
2565         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2566         (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
2567
2568 2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2569
2570         [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy
2571         https://bugs.webkit.org/show_bug.cgi?id=170922
2572         <rdar://problem/31634990>
2573
2574         Reviewed by Tim Horton.
2575
2576         Refactors part of the asynchronous position information mechanism introduced in
2577         <https://trac.webkit.org/changeset/215171>, and introduces infrastructure for unit testing UI-side position
2578         information requests.
2579
2580         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView
2581         responsible for invoking queued position information handlers after receiving a position information response
2582         from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all
2583         callbacks whose requests are satisfied by the incoming position information update, saving the indices of these
2584         handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of
2585         pending callbacks. This is problematic when a synchronous position update (via
2586         ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since
2587         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we
2588         will attempt to remove a callback at the same index twice.
2589
2590         To fix this, we change the array of pending position information handlers to be an array of optionals instead.
2591         When invoking and removing pending handlers after a position information response arrives, we now mark callbacks
2592         as handled by setting them to std::nullopt. Then, when the top-level invocation to
2593         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers
2594         from the pending vector.
2595
2596         Covered by 6 new unit tests:
2597         - PositionInformationTests.FindDraggableLinkAtPosition
2598         - PositionInformationTests.RequestDraggableLinkAtPosition
2599         - PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock
2600         - PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock
2601         - PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock
2602         - PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock
2603
2604         * UIProcess/API/Cocoa/WKWebView.mm:
2605         (-[WKWebView draggableElementAtPosition:]):
2606         (-[WKWebView requestDraggableElementAtPosition:completionBlock:]):
2607
2608         Uses WKContentView's position information request helpers to search for draggable elements on the page. There
2609         are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo.
2610
2611         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2612         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added.
2613         * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added.
2614
2615         Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment).
2616
2617         (-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]):
2618         (-[_WKDraggableElementInfo copyWithZone:]):
2619         * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added.
2620         * UIProcess/ios/WKContentViewInteraction.h:
2621         * UIProcess/ios/WKContentViewInteraction.mm:
2622         (-[WKContentView currentPositionInformation]):
2623         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2624         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
2625         * WebKit2.xcodeproj/project.pbxproj:
2626
2627 2017-04-20  Anders Carlsson  <andersca@apple.com>
2628
2629         Fix a PassKit function declaration typo
2630         https://bugs.webkit.org/show_bug.cgi?id=171068
2631         rdar://problem/31635008
2632
2633         Reviewed by Tim Horton.
2634
2635         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2636         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2637
2638 2017-04-20  Jer Noble  <jer.noble@apple.com>
2639
2640         [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
2641         https://bugs.webkit.org/show_bug.cgi?id=171021
2642
2643         Reviewed by Eric Carlson.
2644
2645         Pass a deviceID rather than a CaptureDevice across the process boundary.
2646
2647         * Shared/WebCoreArgumentCoders.h:
2648         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2649         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2650         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2651         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2652         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2653         (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
2654         * WebProcess/cocoa/UserMediaCaptureManager.h:
2655
2656 2017-04-20  Alex Christensen  <achristensen@webkit.org>
2657
2658         Fix assertions in webProcessProxyFromConnection
2659         https://bugs.webkit.org/show_bug.cgi?id=171025
2660         <rdar://problem/31184073>
2661
2662         Reviewed by Brady Eidson.
2663
2664         * UIProcess/WebProcessPool.cpp:
2665         (WebKit::webProcessProxyFromConnection):
2666         If we have a Connection, then we have a valid process attached to that connection,
2667         unless it's a Connection to a different type of child process.
2668         Calling ChildProcessProxy::connection on other web processes that are in State::Launching,
2669         then we get an assertion.  Luckily, ChildProcessProxy::hasConnection was introduced in r210861
2670         for this reason.
2671
2672 2017-04-20  Brent Fulgham  <bfulgham@apple.com>
2673
2674         [WK2][macOS] Allow iokit-get-properties for IOAudioControlValue
2675         https://bugs.webkit.org/show_bug.cgi?id=171020
2676         <rdar://problem/30878974>
2677
2678         Reviewed by Alexey Proskuryakov.
2679
2680         * WebProcess/com.apple.WebProcess.sb.in: Add missing property name.
2681
2682 2017-04-19  Joseph Pecoraro  <pecoraro@apple.com>
2683
2684         Remove WebKitTestRunner code for enabling features that are already enabled by default
2685         https://bugs.webkit.org/show_bug.cgi?id=171033
2686
2687         Reviewed by Ryosuke Niwa.
2688
2689         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2690         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2691
2692 2017-04-19  Youenn Fablet  <youenn@apple.com>
2693
2694         [Mac] Allow customizing H264 encoder
2695         https://bugs.webkit.org/show_bug.cgi?id=170829
2696
2697         Reviewed by Alex Christensen.
2698
2699         * Configurations/FeatureDefines.xcconfig:
2700         * WebKit2.xcodeproj/project.pbxproj:
2701
2702 2017-04-19  Brady Eidson  <beidson@apple.com>
2703
2704         Add asynchronous equivalent of -[<WKUIDelegate> webView:createWebViewWithConfiguration:...].
2705         <rdar://problem/30699851> and https://bugs.webkit.org/show_bug.cgi?id=171018
2706
2707         Reviewed by Tim Horton.
2708
2709         * UIProcess/API/APIUIClient.h:
2710         (API::UIClient::createNewPageAsync):
2711
2712         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2713
2714         * UIProcess/Cocoa/UIDelegate.h:
2715         * UIProcess/Cocoa/UIDelegate.mm:
2716         (WebKit::UIDelegate::setDelegate):
2717         (WebKit::UIDelegate::UIClient::createNewPageCommon):
2718         (WebKit::UIDelegate::UIClient::createNewPage):
2719         (WebKit::UIDelegate::UIClient::createNewPageAsync):
2720
2721         * UIProcess/WebPageProxy.cpp:
2722         (WebKit::WebPageProxy::createNewPage):
2723         * UIProcess/WebPageProxy.h:
2724         * UIProcess/WebPageProxy.messages.in:
2725
2726 2017-04-19  Anders Carlsson  <andersca@apple.com>
2727
2728         Stop using deprecated APIs, part 3
2729         https://bugs.webkit.org/show_bug.cgi?id=171003
2730         rdar://problem/31589635
2731
2732         Reviewed by Tim Horton.
2733
2734         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2735         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
2736         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
2737         Don't encode/decode status.
2738
2739         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2740         (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession):
2741         Hide the UI and report back.
2742
2743         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2744         Add new member.
2745
2746         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2747         Add new message.
2748
2749         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2750         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
2751         Always pass success in the old code path. Stop using the deprecated method.
2752
2753         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2754         (WebKit::WebPaymentCoordinator::cancelPaymentSession):
2755         Send a message to the UI process.
2756
2757         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2758         Add new member.
2759
2760 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
2761
2762         [MediaStream] Limit capture to one tab at a time
2763         https://bugs.webkit.org/show_bug.cgi?id=171009
2764
2765         Reviewed by Jon Lee.
2766
2767         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2768         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used.
2769         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2770
2771         * UIProcess/UserMediaProcessManager.cpp:
2772         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams
2773         on other pages.
2774         (WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage.
2775         * UIProcess/UserMediaProcessManager.h:
2776
2777         * UIProcess/WebPageProxy.cpp:
2778         (WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call
2779         willEnableMediaStreamInPage so streams in other pages are muted first.
2780
2781 2017-04-19  Brady Eidson  <beidson@apple.com>
2782
2783         REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed.
2784         <rdar://problem/30774839> and https://bugs.webkit.org/show_bug.cgi?id=171002
2785
2786         Reviewed by Alex Christensen.
2787
2788         The original change unnecessarily avoided using the initial warmed process if an explicit
2789         data store was set on the new WKWebView.
2790         
2791         Fixing that fixes the regression.
2792         
2793         * UIProcess/API/Cocoa/WKProcessPool.mm:
2794         (-[WKProcessPool _webProcessCount]):
2795         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2796
2797         * UIProcess/WebProcessPool.cpp:
2798         (WebKit::WebProcessPool::createWebPage):
2799
2800 2017-04-19  Anders Carlsson  <andersca@apple.com>
2801
2802         Rename cancelPayment to cancelPaymentSession
2803         https://bugs.webkit.org/show_bug.cgi?id=171007
2804
2805         Reviewed by Tim Horton.
2806
2807         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2808         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
2809         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
2810         (WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted.
2811         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2812         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2813         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
2814         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2815         (WebKit::WebPaymentCoordinator::didCancelPaymentSession):
2816         (WebKit::WebPaymentCoordinator::didCancelPayment): Deleted.
2817         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2818         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
2819
2820 2017-04-19  David Kilzer  <ddkilzer@apple.com>
2821
2822         Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString()
2823         <https://webkit.org/b/170994>
2824         <rdar://problem/29889932>
2825
2826         Reviewed by Brent Fulgham.
2827
2828         * Platform/unix/EnvironmentUtilities.cpp:
2829         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
2830         Switch from using strcpy() to strlcpy().  Also switch from using
2831         strstr() to strnstr().
2832         * Platform/unix/EnvironmentUtilities.h: Switch to #pragma once.
2833         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
2834         Export function for testing.
2835         * WebKit2.xcodeproj/project.pbxproj:
2836         (EnvironmentUtilitiesTest.h): Make header private for testing.
2837
2838 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
2839
2840         Provide a way for clients to unmute a media stream.
2841         https://bugs.webkit.org/show_bug.cgi?id=170855
2842         <rdar://problem/31656855>
2843
2844         Unreviewed, fix a typo missed in the review of r215420.
2845
2846         * UIProcess/API/Cocoa/WKWebView.mm:
2847         (-[WKWebView _setPageMuted:]):
2848
2849 2017-04-19  Adrian Perez de Castro  <aperez@igalia.com>
2850
2851         [GTK] WebKitAutocleanups.h regression in v2.16.1 release
2852         https://bugs.webkit.org/show_bug.cgi?id=170987
2853
2854         Reviewed by Carlos Garcia Campos.
2855
2856         * UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon.
2857
2858 2017-04-18  Per Arne Vollan  <pvollan@apple.com>
2859
2860         Dragging a few items over MiniBrowser has 0 in the red indicator.
2861         https://bugs.webkit.org/show_bug.cgi?id=170874
2862
2863         Reviewed by Tim Horton.
2864
2865         When WebKit does not accept the drag items, the drag count badge should not be updated.
2866         Also, if WebKit changes the drag count badge, it should be restored to its original
2867         value when the drag exits.
2868
2869         * UIProcess/Cocoa/WebViewImpl.h:
2870         * UIProcess/Cocoa/WebViewImpl.mm:
2871         (WebKit::WebViewImpl::draggingEntered):
2872         (WebKit::WebViewImpl::draggingUpdated):
2873         (WebKit::WebViewImpl::draggingExited):
2874
2875 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2876
2877         [WK2] Add infrastructure and unit tests for file uploads using data interaction
2878         https://bugs.webkit.org/show_bug.cgi?id=170903
2879         <rdar://problem/31314689>
2880
2881         Reviewed by Tim Horton.
2882
2883         See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a
2884         BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where
2885         multiple files are being "data interacted" onto an element. See <https://bugs.webkit.org/show_bug.cgi?id=170880>
2886         for more details about the change this patch is testing.
2887
2888         * UIProcess/API/Cocoa/WKWebView.mm:
2889         (-[WKWebView _simulateDataInteractionUpdated:]):
2890         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2891         * UIProcess/ios/WKContentViewInteraction.h:
2892
2893 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2894
2895         [WK2] Support DataTransfer::files() when performing a DHTML data interaction
2896         https://bugs.webkit.org/show_bug.cgi?id=170880
2897         <rdar://problem/31314689>
2898
2899         Reviewed by Tim Horton.
2900
2901         See the WebCore ChangeLog for more details.
2902
2903         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2904         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction):
2905         * UIProcess/WebPageProxy.cpp:
2906         (WebKit::WebPageProxy::didPerformDragControllerAction):
2907         (WebKit::WebPageProxy::resetCurrentDragInformation):
2908         * UIProcess/WebPageProxy.h:
2909         (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag):
2910         * UIProcess/WebPageProxy.messages.in:
2911
2912         Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior.
2913
2914         * UIProcess/WebPasteboardProxy.h:
2915         * UIProcess/WebPasteboardProxy.messages.in:
2916
2917         Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath.
2918
2919         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2920         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction):
2921         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2922         * WebProcess/WebPage/WebPage.cpp:
2923         (WebKit::WebPage::performDragControllerAction):
2924
2925 2017-04-18  John Wilander  <wilander@apple.com>
2926
2927         Resource Load Statistics: Check both origins and cookieHostNames for domain matches in data removal
2928         https://bugs.webkit.org/show_bug.cgi?id=170763
2929         <rdar://problem/31573091>
2930
2931         Reviewed by Alex Christensen.
2932
2933         * UIProcess/WebProcessProxy.cpp:
2934         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
2935             Move semantics for topPrivatelyControlledDomains vector.
2936         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores): Deleted.
2937             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
2938         * UIProcess/WebProcessProxy.h:
2939         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2940         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2941             Move semantics for prevalentResourceDomains vector.
2942         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2943         (WebKit::hostIsInDomain):
2944             Static convenience function.
2945         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain):
2946             Checks for matching cookieHostNames if types contains WebsiteDataType::Cookies.
2947             Also checks origins.
2948         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2949         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2950         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
2951             Now makes use of the new function
2952             WebKit::WebsiteDataRecord::validForTopPrivatelyControlledDomain().
2953         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains):
2954             Move semantics for topPrivatelyControlledDomains vector.
2955         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains): Deleted.
2956             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
2957         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains): Deleted.
2958             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
2959         * UIProcess/WebsiteData/WebsiteDataStore.h:
2960
2961 2017-04-18  Brent Fulgham  <bfulgham@apple.com>
2962
2963         [iOS][WK2] Prevent ephemeral files from being backed up
2964         https://bugs.webkit.org/show_bug.cgi?id=170963
2965         <rdar://problem/30470332>
2966
2967         Reviewed by Brady Eidson.
2968
2969         Tell the OS to skip temporary data files when performing backups.
2970
2971         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: Added.
2972         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Added.
2973         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2974         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2975         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Add stub for
2976         non-iOS platforms.
2977         * UIProcess/WebResourceLoadStatisticsStore.h:
2978         * WebKit2.xcodeproj/project.pbxproj: Add new file.
2979
2980 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2981
2982         [WK2] Cannot select text on nytimes.com when the selection granularity is WKSelectionGranularityCharacter
2983         https://bugs.webkit.org/show_bug.cgi?id=170968
2984         <rdar://problem/31692560>
2985
2986         Reviewed by Dan Bernstein.
2987
2988         Makes a small adjustment to textInteractionGesture:shouldBeginAtPoint:. When determining whether to allow the
2989         text interaction assistant to recognize at a given point, instead of depending on whether or not the hit node is
2990         the same as the assisted node, only enforce this restriction when editing an assisted node. Otherwise, default
2991         to allowing the selection gesture.
2992
2993         Note that character granularity selection was working on most pages before, due to the fact that
2994         nodeAtPositionIsAssistedNode was true in many cases when there is no assisted node at all. This is because, in
2995         WebPage.mm, we compute the hit-tested node responding to click events to be null, and then set
2996         nodeAtPositionIsAssistedNode to be equal to hitNode == m_assistedNode, which ends up being true because both of
2997         these values are null.
2998
2999         This allowed text selection to work in the simple case when selection granularity character is used, but not
3000         when the node containing the selected point actually does respond to click events, since the comparison returns
3001         false.
3002
3003         New layout test: LayoutTests/editing/selection/character-granularity-select-text-with-click-handler.html.
3004
3005         * UIProcess/ios/WKContentViewInteraction.mm:
3006         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3007
3008 2017-04-18  Keith Rollin  <krollin@apple.com>
3009
3010         Add additional information when logging URL disposition in WebLoaderStrategy::scheduleLoad
3011         https://bugs.webkit.org/show_bug.cgi?id=170813
3012
3013         Reviewed by Alex Christensen.
3014
3015         There are a few logging statements in WebLoaderStrategy::scheduleLoad
3016         that report, for example, "URL will be loaded as data". These
3017         statements also log the address of the frame doing the loading and the
3018         identifier of the resource. For consistency with other logging and to
3019         make scripted analysis of the logs more robust, also include the
3020         pageID and frameID in the logging.
3021
3022         * WebProcess/Network/WebLoaderStrategy.cpp:
3023         (WebKit::WebLoaderStrategy::scheduleLoad):
3024
3025 2017-04-18  Anders Carlsson  <andersca@apple.com>
3026
3027         Stop using deprecated APIs, part 2
3028         https://bugs.webkit.org/show_bug.cgi?id=170965
3029
3030         Reviewed by Tim Horton.
3031
3032         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3033         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode):
3034         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
3035         Remove the status member variable.
3036
3037         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3038         (WebKit::status):
3039         New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate.
3040
3041         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
3042         Stop using the deprecated API.
3043
3044 2017-04-18  Timothy Horton  <timothy_horton@apple.com>
3045
3046         Force scroll view insets to be respected regardless of rubber-banding state
3047         https://bugs.webkit.org/show_bug.cgi?id=170937
3048         <rdar://problem/31412788>
3049
3050         Reviewed by Simon Fraser.
3051
3052         * Platform/spi/ios/UIKitSPI.h:
3053         * UIProcess/API/Cocoa/WKWebView.mm:
3054         (-[WKWebView _initializeWithConfiguration:]):
3055
3056 2017-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3057
3058         [GLIB] Define priorities also for async network IO tasks
3059         https://bugs.webkit.org/show_bug.cgi?id=170905
3060
3061         Reviewed by Žan Doberšek.
3062
3063         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3064         (WebKit::NetworkCache::inputStreamReadReadyCallback):
3065         (WebKit::NetworkCache::IOChannel::read):
3066         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
3067         (WebKit::NetworkCache::IOChannel::write):
3068         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3069         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
3070         (WebKit::NetworkDataTaskSoup::read):
3071         (WebKit::NetworkDataTaskSoup::requestNextPart):
3072         (WebKit::NetworkDataTaskSoup::writeDownload):
3073         (WebKit::NetworkDataTaskSoup::didFinishDownload):
3074         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
3075         (webkitURISchemeRequestReadCallback):
3076         (webkit_uri_scheme_request_finish):
3077
3078 2017-04-17  Timothy Horton  <timothy_horton@apple.com>
3079
3080         Plumb all four obscured insets to WebCore, instead of just top/left
3081         https://bugs.webkit.org/show_bug.cgi?id=170913
3082
3083         Reviewed by Wenson Hsieh.
3084
3085         * Shared/VisibleContentRectUpdateInfo.cpp:
3086         (WebKit::VisibleContentRectUpdateInfo::encode):
3087         (WebKit::VisibleContentRectUpdateInfo::decode):
3088         (WebKit::operator<<):
3089         * Shared/VisibleContentRectUpdateInfo.h:
3090         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3091         (WebKit::VisibleContentRectUpdateInfo::obscuredInsets):
3092         (WebKit::operator==):
3093         (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted.
3094         * Shared/WebCoreArgumentCoders.cpp:
3095         (IPC::ArgumentCoder<FloatRectInsets>::encode):
3096         (IPC::ArgumentCoder<FloatRectInsets>::decode):
3097         * Shared/WebCoreArgumentCoders.h:
3098         * UIProcess/API/Cocoa/WKWebView.mm:
3099         (-[WKWebView _didCommitLayerTree:]):
3100         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
3101         (-[WKWebView _updateVisibleContentRects]):
3102         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3103         * UIProcess/PageClient.h:
3104         * UIProcess/WebPageProxy.cpp:
3105         * UIProcess/WebPageProxy.h:
3106         * UIProcess/WebPageProxy.messages.in:
3107         * UIProcess/ios/PageClientImplIOS.h:
3108         * UIProcess/ios/PageClientImplIOS.mm:
3109         (WebKit::PageClientImpl::restorePageState):
3110         * UIProcess/ios/WKContentView.h:
3111         * UIProcess/ios/WKContentView.mm:
3112         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3113         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
3114         * UIProcess/ios/WebPageProxyIOS.mm:
3115         (WebKit::WebPageProxy::restorePageState):
3116         * WebProcess/WebPage/ios/WebPageIOS.mm:
3117         (WebKit::WebPage::restorePageState):
3118         (WebKit::WebPage::updateVisibleContentRects):
3119         Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization).
3120
3121 2017-04-17  Joseph Pecoraro  <pecoraro@apple.com>
3122
3123         Web Inspector: Doesn't show size of compressed content correctly
3124         https://bugs.webkit.org/show_bug.cgi?id=155112
3125         <rdar://problem/25006728>
3126
3127         Reviewed by Alex Christensen and Timothy Hatcher.
3128
3129         * NetworkProcess/NetworkResourceLoader.cpp:
3130         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
3131         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3132         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3133         Include size information in network load metrics.
3134
3135 2017-04-17  Youenn Fablet  <youenn@apple.com>
3136
3137         com.apple.WebKit.Networking.Development crashed in com.apple.WebKit: WebKit::NetworkRTCProvider::resolvedName
3138         https://bugs.webkit.org/show_bug.cgi?id=170889
3139
3140         Reviewed by Alex Christensen.
3141
3142         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3143         (WebKit::NetworkRTCProvider::Resolver::~Resolver): Unschedule the host resolution in addition to cancelling it.
3144         Providing a test would need to stop the resolver between the time the resolver is created and gets
3145         data in the network process. Or we would need to change Resolver to be instantiated/tested on its own.
3146         * NetworkProcess/webrtc/NetworkRTCProvider.h:
3147
3148 2017-04-17  Brady Eidson  <beidson@apple.com>
3149
3150         Make WKHTTPCookieStore public.
3151         <rdar://problem/31024691> and https://bugs.webkit.org/show_bug.cgi?id=170920
3152
3153         Reviewed by Geoffrey Garen.
3154
3155         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
3156         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
3157         (-[WKHTTPCookieStore getAllCookies:]):
3158         (-[WKHTTPCookieStore allCookies:]): Deleted.
3159
3160         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3161         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3162         (-[WKWebsiteDataStore httpCookieStore]):
3163         (-[WKWebsiteDataStore _httpCookieStore]): Deleted.
3164         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3165
3166         * WebKit2.xcodeproj/project.pbxproj:
3167
3168 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
3169
3170         [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange
3171         https://bugs.webkit.org/show_bug.cgi?id=170911
3172
3173         Reviewed by Youenn Fablet.
3174
3175         * UIProcess/Cocoa/UIDelegate.mm:
3176         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): Fix typo.
3177
3178 2017-04-17  Keith Rollin  <krollin@apple.com>
3179
3180         Move and update WebLoaderStrategy logging statement
3181         https://bugs.webkit.org/show_bug.cgi?id=170140
3182
3183         Reviewed by Alex Christensen.
3184
3185         WebLoaderStrategy::scheduleLoad has a logging statement that says, in
3186         part: "Resource has been queued for scheduling with the
3187         NetworkProcess". This statement is emitted after the
3188         ScheduleResourceLoad message has been successfully sent to the
3189         NetworkProcess. The logging statement was added at this location to
3190         indicate that the resource-load had been successfully handed off; it
3191         pairs a similar logging statement that is emitted if the sending of
3192         the ScheduleResourceLoad message fails.
3193
3194         I think it would be better to move this logging statement before the
3195         ScheduleResourceLoad message is sent to the NetworkProcess (and change
3196         its wording to "Resource is being scheduled with the NetworkProcess").
3197         The reason for this change is to help make sure that the sequence of
3198         logging statements is more deterministic. In the current form, the
3199         message "Resource has been queued for scheduling with the
3200         NetworkProcess" normally appears before any NetworkProcess logging
3201         statements that indicate that the resource-loading is continuing
3202         there, but in rare occasions the logging statements can be reversed.
3203         This change in the ordering of the statements has caused a problem in
3204         a script I've written that examines the resource-loading process and
3205         looks for errors. By ensuring that the WebLoaderStrategy statement
3206         always appears before the NetworkResourceLoader statement, the flow
3207         makes better sense and the script can be more robust.
3208
3209         In making this change, we are probably not giving up any assurance
3210         that the ScheduleResourceLoad message has been sent to the
3211         NetworkResourceLoader. If the message is successfully sent, we'll see
3212         logging in the NetworkProcess. If the message has not been sent, we'll
3213         see WebLoaderStrategy logging an error.
3214
3215         * WebProcess/Network/WebLoaderStrategy.cpp:
3216         (WebKit::WebLoaderStrategy::scheduleLoad):
3217
3218 2017-04-17  Anders Carlsson  <andersca@apple.com>
3219
3220         Stop using deprecated APIs, part 1
3221         https://bugs.webkit.org/show_bug.cgi?id=170915
3222         rdar://problem/31589635
3223
3224         Reviewed by Tim Horton.
3225
3226         Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated
3227         and we always passed PKPaymentAuthorizationStatusSuccess anyway.
3228
3229         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3230         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
3231         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
3232         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3233         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
3234
3235 2017-04-17  Youenn Fablet  <youenn@apple.com>
3236
3237         Disable outdated WritableStream API
3238         https://bugs.webkit.org/show_bug.cgi?id=170749
3239         <rdar://problem/31446233>
3240
3241         Reviewed by Alex Christensen.
3242
3243         Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by:
3244         - A STREAMS_API compilation flag.
3245         - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT.
3246
3247         * Configurations/FeatureDefines.xcconfig:
3248         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3249         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3250
3251 2017-04-17  Tim Horton  <timothy_horton@apple.com>
3252
3253         Provide a viewport parameter to disable clipping to the safe area
3254         https://bugs.webkit.org/show_bug.cgi?id=170766
3255         <rdar://problem/31564634>
3256
3257         Reviewed by Beth Dakin.
3258
3259         * UIProcess/WebPageProxy.cpp:
3260         (WebKit::WebPageProxy::resetState):
3261         (WebKit::WebPageProxy::setClipToSafeArea):
3262         * UIProcess/WebPageProxy.h:
3263         (WebKit::WebPageProxy::clipToSafeArea):
3264         * UIProcess/WebPageProxy.messages.in:
3265         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3266         (WebKit::WebChromeClient::didChangeClipToSafeArea):
3267         * WebProcess/WebCoreSupport/WebChromeClient.h:
3268         * UIProcess/API/gtk/PageClientImpl.h:
3269         * UIProcess/PageClient.h:
3270         * UIProcess/ios/PageClientImplIOS.h:
3271         * UIProcess/ios/PageClientImplIOS.mm:
3272         (WebKit::PageClientImpl::didChangeClipToSafeArea):
3273         * UIProcess/mac/PageClientImpl.h:
3274         Forward clip-to-safe-area changes from ChromeClient to WKWebView.
3275         Update visible content rects when it changes, which will
3276         result in a call to updateFixedClippingView, as below.
3277         Keep track of the current state in the UI process.
3278
3279         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3280         * UIProcess/API/Cocoa/WKWebView.mm:
3281         (-[WKWebView _contentMayDrawInObscuredInsets]):
3282         Expose the current state of the clip-to-safe-area bit as SPI.
3283
3284         * UIProcess/ios/WKContentView.mm:
3285         (-[WKContentView updateFixedClippingView:]):
3286         Disable fixed clipping when clip-to-safe-area is disabled.
3287         
3288         * WebProcess/WebPage/ios/WebPageIOS.mm:
3289         (WebKit::WebPage::viewportConfigurationChanged):
3290         Push the viewport's clip-to-safe-area bit onto the main frame's FrameView.
3291
3292 2017-04-17  Dan Bernstein  <mitz@apple.com>
3293
3294         [Cocoa] Move isNullFunctionPointer down into WTF
3295         https://bugs.webkit.org/show_bug.cgi?id=170892
3296
3297         Reviewed by Sam Weinig.
3298
3299         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
3300         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Changed to use
3301           WTF::isNullFunctionPointer.
3302         (WebKit::isNullFunctionPointer): Deleted.
3303
3304 2017-04-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3305
3306         [WK2] Respect a new internal setting for defaulting to character selection granularity
3307         https://bugs.webkit.org/show_bug.cgi?id=170904
3308         <rdar://problem/31364280>
3309
3310         Reviewed by Dan Bernstein.
3311
3312         Respect a new WebKitDebugDefaultSelectionGranularityCharacter user default by initializing
3313         WKWebViewConfiguration with WKSelectionGranularityCharacter, but only when linked on or after the first iOS to
3314         use WKSelectionGranularityCharacter by default.
3315
3316         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3317         (-[WKWebViewConfiguration init]):
3318         * UIProcess/Cocoa/VersionChecks.h:
3319
3320 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
3321
3322         Provide a way for clients to unmute a media stream.
3323         https://bugs.webkit.org/show_bug.cgi?id=170855
3324         <rdar://problem/31656855>
3325
3326         Reviewed by Jon Lee.
3327
3328         * UIProcess/API/Cocoa/WKWebView.mm:
3329         (-[WKWebView _setPageMuted:]): New.
3330         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3331
3332 2017-04-17  Jeremy Jones  <jeremyj@apple.com>
3333
3334         Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video.
3335         https://bugs.webkit.org/show_bug.cgi?id=170778
3336
3337         Reviewed by Tim Horton.
3338
3339         setUseAVFoundationAudioCapture is moved from AVCaptureDeviceManager to RealtimeMediaSourceCenterMac.
3340
3341         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3342         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
3343
3344 2017-04-15  Keith Rollin  <krollin@apple.com>
3345
3346         Include resource size in some existing logging
3347         https://bugs.webkit.org/show_bug.cgi?id=170866
3348
3349         Reviewed by Alex Christensen.
3350
3351         In order to correlate resource load times with resource size, we log
3352         when the resource is starting to be loaded and when the resource is
3353         finished loading. In NetworkResourceLoader::didReceiveResponse, we
3354         also log the expected resource length. However, we can only log the
3355         length if it is provided in Content-Length, which is not always the
3356         case. If it's not provided, we end up logging "length = -1". To make
3357         up for this, change NetworkResourceLoader::didFinishLoading and
3358         WebResourceLoader:: didFinishLoading to log the length once we know
3359         it.
3360
3361         * NetworkProcess/NetworkResourceLoader.cpp:
3362         (WebKit::NetworkResourceLoader::didReceiveBuffer):
3363         (WebKit::NetworkResourceLoader::didFinishLoading):
3364         * NetworkProcess/NetworkResourceLoader.h:
3365         * WebProcess/Network/WebResourceLoader.cpp:
3366         (WebKit::WebResourceLoader::didReceiveData):
3367         (WebKit::WebResourceLoader::didFinishResourceLoad):
3368         * WebProcess/Network/WebResourceLoader.h:
3369
3370 2017-04-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3371
3372         [WK2] Support data interaction of files into file inputs
3373         https://bugs.webkit.org/show_bug.cgi?id=170803
3374         <rdar://problem/31286130>
3375
3376         Reviewed by Tim Horton.
3377
3378         Implements remaining support for performing data interaction onto file inputs. There are two main changes at
3379         this layer: plumbing the number of files in the pasteboard to the web process, and pulling the implementation of
3380         createSandboxExtensionsIfNeeded out of Mac-specific WebViewImpl::createSandboxExtensionsIfNeeded and into
3381         WebPageProxy::createSandboxExtensionsIfNeeded.
3382
3383         * Shared/WebCoreArgumentCoders.cpp:
3384         (IPC::ArgumentCoder<DragData>::encode):
3385         (IPC::ArgumentCoder<DragData>::decode):
3386
3387         Relax special-casing of encoding and decoding filenames to be PLATFORM(COCOA) rather than PLATFORM(MAC).
3388
3389         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3390         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
3391         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3392         (WebKit::WebPasteboardProxy::getNumberOfFiles):
3393
3394         More boilerplate plumbing to deliver the number of files in the pasteboard to the web process.
3395
3396         * UIProcess/Cocoa/WebViewImpl.h:
3397         * UIProcess/Cocoa/WebViewImpl.mm:
3398         (WebKit::WebViewImpl::performDragOperation):
3399         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): Deleted.
3400
3401         Move the logic in WebViewImpl::createSandboxExtensionsIfNeeded over to WebPageProxy::createSandboxExtensionsIfNeeded.
3402
3403         * UIProcess/WebPageProxy.h:
3404         * UIProcess/WebPasteboardProxy.h:
3405         * UIProcess/WebPasteboardProxy.messages.in:
3406         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3407         (WebKit::WebPlatformStrategies::getNumberOfFiles):
3408         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3409
3410 2017-04-14  Mark Lam  <mark.lam@apple.com>
3411
3412         Update architectures in xcconfig files.
3413         https://bugs.webkit.org/show_bug.cgi?id=170867
3414         <rdar://problem/31628104>
3415
3416         Reviewed by Joseph Pecoraro.
3417
3418         * Configurations/FeatureDefines.xcconfig:
3419
3420 2017-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3421
3422         [WK2] Support Icon creation from file URLs on iOS
3423         https://bugs.webkit.org/show_bug.cgi?id=170809
3424         <rdar://problem/31286130>
3425
3426         Reviewed by Tim Horton.
3427
3428         Refactors file icon generation logic to support showing an Icon representing the content at a list of file paths
3429         on iOS. Pulls out logic in WKFileUploadPanel responsible for generating the thumbnail image for a file input into
3430         separate helpers in WebIconUtilities, and then uses these utilities in both WKFileUploadPanel and
3431         WebChromeClientIOS.
3432
3433         * Shared/ios/WebIconUtilities.h: Added.
3434         * Shared/ios/WebIconUtilities.mm: Added.
3435         (WebKit::squareCropRectForSize):
3436         (WebKit::squareImage):
3437         (WebKit::thumbnailSizedImageForImage):
3438         (WebKit::fallbackIconForFile):
3439         (WebKit::iconForImageFile):
3440         (WebKit::iconForVideoFile):
3441         (WebKit::iconForFile):
3442
3443         Add logic for generating thumbnail icons, moved from WKFileUploadPanel.mm.
3444
3445         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3446         (squareCropRectForSize): Deleted.
3447         (squareImage): Deleted.
3448         (thumbnailSizedImageForImage): Deleted.
3449         (fallbackIconForFile): Deleted.
3450         (iconForImageFile): Deleted.
3451         (iconForVideoFile): Deleted.
3452         (iconForFile): Deleted.
3453
3454         Remove logic for generating thumbnail icons.
3455
3456         * WebKit2.xcodeproj/project.pbxproj:
3457         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3458         (WebKit::WebChromeClient::loadIconForFiles):
3459         (WebKit::WebChromeClient::createIconForFiles):
3460
3461         Rather than call Icon::createIconForFiles directly, loadIconForFiles now consults ChromeClient::createIconForFiles
3462         instead. On other platforms, this just turns around and calls Icon::createIconForFiles, but on iOS, we use the
3463         utilities introduced in WebIconUtilities to generate a file icon.
3464
3465         * WebProcess/WebCoreSupport/WebChromeClient.h:
3466         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3467         (WebKit::WebChromeClient::createIconForFiles):
3468
3469 2017-04-14  Brady Eidson  <beidson@apple.com>
3470
3471         Fix basic WKURLSchemeHandler bugs.
3472         <rdar://problem/30647559> and https://bugs.webkit.org/show_bug.cgi?id=170862
3473
3474         Reviewed by Andy Estes.
3475
3476         * UIProcess/Cocoa/NavigationState.mm:
3477         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3478
3479         * UIProcess/WebURLSchemeHandlerTask.cpp:
3480         (WebKit::WebURLSchemeHandlerTask::didReceiveResponse):
3481
3482         * WebProcess/Network/WebLoaderStrategy.cpp:
3483         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy):
3484         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy):
3485         (WebKit::WebLoaderStrategy::remove):
3486         * WebProcess/Network/WebLoaderStrategy.h:
3487
3488         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
3489         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
3490         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
3491         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
3492         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
3493
3494         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp:
3495         (WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy):
3496         (WebKit::WebURLSchemeHandlerTaskProxy::stopLoading):
3497         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse):
3498         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData):
3499         (WebKit::WebURLSchemeHandlerTaskProxy::didComplete):
3500         (WebKit::WebURLSchemeHandlerTaskProxy::hasLoader):
3501         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h:
3502         (WebKit::WebURLSchemeHandlerTaskProxy::identifier):
3503
3504 2017-04-14  Jer Noble  <jer.noble@apple.com>
3505
3506         [MediaSource] Push capabilities across process boundary during UIProcess capture.
3507         https://bugs.webkit.org/show_bug.cgi?id=170814
3508
3509         Reviewed by Eric Carlson.
3510
3511         Make a new synchronous getter for capabilities(), moderated by only requesting the capabilities() cross-process
3512         the first time called.
3513
3514         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3515         (WebKit::UserMediaCaptureManagerProxy::capabilities):
3516         (WebKit::UserMediaCaptureManagerProxy::supportedConstraints):
3517         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3518         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3519         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3520         (WebKit::UserMediaCaptureManager::Source::setCapabilities):
3521         (WebKit::UserMediaCaptureManager::capabilities):
3522         * WebProcess/cocoa/UserMediaCaptureManager.h:
3523
3524 2017-04-13  Dan Bernstein  <mitz@apple.com>
3525
3526         [Cocoa] Allow clients to specify in _WKProcessPoolConfiguration additional directory sandbox extensions
3527         https://bugs.webkit.org/show_bug.cgi?id=170387
3528
3529         Reviewed by Sam Weinig.
3530
3531         Test: TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm
3532
3533         Added an additionalReadAccessAllowedURLs property to _WKProcessPoolConfiguration.
3534
3535         * Shared/WebProcessCreationParameters.cpp:
3536         (WebKit::WebProcessCreationParameters::encode): Encode the new
3537           additionalSandboxExtensionHandles member.
3538         (WebKit::WebProcessCreationParameters::decode): Decode it.
3539         * Shared/WebProcessCreationParameters.h: Added additionalSandboxExtensionHandles member.
3540
3541         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3542         (API::ProcessPoolConfiguration::copy): Copy new m_additionalReadAccessAllowedPaths member.
3543         * UIProcess/API/APIProcessPoolConfiguration.h: Added m_additionalReadAccessAllowedPaths
3544           member and accessor functions.
3545
3546         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declared new
3547           additionalReadAccessAllowedURLs property whose value is an array of URLs to which the Web
3548           Content process will be given read access.
3549         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3550         (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): New getter that returns
3551           an array of file URLs from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths().
3552         (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): New setter that checks
3553           that the given URLs are file URLs and populates the ProcessPoolConfiguration’s
3554           additionalReadAccessAllowedPaths with their paths.
3555
3556         * UIProcess/WebProcessPool.cpp:
3557         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Populate the new
3558           m_resolvedPaths.additionalWebProcessSandboxExtensionPaths with resolved paths from the
3559           ProcessPoolConfiguration’s additionalReadAccessAllowedPaths.
3560         (WebKit::WebProcessPool::createNewWebProcess): Populate the WebProcessCreationParameters’s
3561           additionalSandboxExtensionHandles member with read-only sandbox extensions created from
3562           the resolved paths.
3563         * UIProcess/WebProcessPool.h: Added additionalWebProcessSandboxExtensionPaths member to
3564           the Paths struct.
3565
3566         * WebProcess/WebProcess.cpp:
3567         (WebKit::WebProcess::initializeWebProcess): Consume the additional sandbox extensions.
3568
3569 2017-04-13  Alex Christensen  <achristensen@webkit.org>
3570
3571         Fix CMake build
3572         https://bugs.webkit.org/show_bug.cgi?id=170815
3573
3574         Reviewed by Beth Dakin.
3575
3576         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3577         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
3578
3579 2017-04-12  Dan Bernstein  <mitz@apple.com>
3580
3581         [Mac] Future-proof .xcconfig files
3582         https://bugs.webkit.org/show_bug.cgi?id=170802
3583
3584         Reviewed by Tim Horton.
3585
3586         * Configurations/Base.xcconfig:
3587         * Configurations/DebugRelease.xcconfig:
3588         * Configurations/FeatureDefines.xcconfig:
3589         * Configurations/Version.xcconfig:
3590
3591 2017-04-12  Brady Eidson  <beidson@apple.com>
3592
3593         QuotaExceededError when saving to localStorage in private mode.
3594         https://bugs.webkit.org/show_bug.cgi?id=157010
3595
3596         Reviewed by Alex Christensen.
3597
3598         * WebProcess/Storage/StorageAreaMap.cpp:
3599         (WebKit::StorageAreaMap::StorageAreaMap):
3600         (WebKit::StorageAreaMap::~StorageAreaMap):
3601
3602         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3603         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
3604         (WebKit::StorageNamespaceImpl::storageArea):
3605         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
3606         (WebKit::StorageNamespaceImpl::copy):
3607         * WebProcess/Storage/StorageNamespaceImpl.h:
3608
3609         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
3610         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
3611         * WebProcess/Storage/WebStorageNamespaceProvider.h:
3612
3613 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
3614
3615         Unreviewed, fix build failure on Ubuntu LTS GTK bot
3616         https://bugs.webkit.org/show_bug.cgi?id=170781
3617
3618         * UIProcess/WebProcessPool.cpp:
3619         (WebKit::WebProcessPool::createNewWebProcess):
3620
3621 2017-04-12  Eric Carlson  <eric.carlson@apple.com>
3622
3623         [MediaStream] rename -[WKWebView _stopMediaCapture]
3624         https://bugs.webkit.org/show_bug.cgi?id=170791
3625         <rdar://problem/31589204>
3626
3627         Reviewed by Youenn Fablet.
3628
3629         * UIProcess/API/Cocoa/WKWebView.mm:
3630         (-[WKWebView _muteMediaCapture]):
3631         (-[WKWebView _stopMediaCapture]): Deleted.
3632         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3633
3634 2017-04-12  Ryan Haddad  <ryanhaddad@apple.com>
3635
3636         Unreviewed build fix.
3637
3638         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3639         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
3640         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
3641         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
3642         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
3643         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
3644         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
3645
3646 2017-04-12  Jer Noble  <jer.noble@apple.com>
3647
3648         [WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options.
3649         https://bugs.webkit.org/show_bug.cgi?id=170790
3650
3651         Reviewed by Alex Christensen.
3652
3653         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3654         (WKContextConfigurationCreate):
3655         (WKContextConfigurationCreateWithLegacyOptions):
3656         * UIProcess/API/C/WKContextConfigurationRef.h:
3657
3658 2017-04-12  Jer Noble  <jer.noble@apple.com>
3659
3660         [WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess.
3661         https://bugs.webkit.org/show_bug.cgi?id=170781
3662
3663         Reviewed by Alex Christensen.
3664
3665         Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through
3666         _WKProcessPoolConfiguration.
3667
3668         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3669         (API::ProcessPoolConfiguration::copy):
3670         * UIProcess/API/APIProcessPoolConfiguration.h:
3671         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3672         (WKContextConfigurationShouldCaptureAudioInUIProcess):
3673         (WKContextConfigurationSetShouldCaptureAudioInUIProcess):
3674         * UIProcess/API/C/WKContextConfigurationRef.h:
3675         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3676         (-[WKWebViewConfiguration copyWithZone:]):
3677         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]):
3678         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
3679         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3680         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3681         (-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]):
3682         (-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]):
3683         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3684         (WebKit::WebProcessPool::platformInitializeWebProcess):
3685         * UIProcess/WebProcessPool.cpp:
3686         (WebKit::WebProcessPool::createNewWebProcess):
3687
3688 2017-04-12  Keith Rollin  <krollin@apple.com>
3689
3690         Add some missing NetworkResourceLoader logging
3691         https://bugs.webkit.org/show_bug.cgi?id=170139
3692
3693         Reviewed by Alex Christensen.
3694
3695         Once execution enters the lambda in
3696         NetworkResourceLoader::retrieveCacheEntry, there is little indication
3697         of which exit point was taken. If flow enters into startNetworkLoad,
3698         we'll get some logging from that function, but not from the others.
3699         Add some logging so that we know what the result was from looking up
3700         the resource in the cache.
3701
3702         * NetworkProcess/NetworkResourceLoader.cpp:
3703         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3704
3705 2017-04-12  Anders Carlsson  <andersca@apple.com>
3706
3707         Tweak WebCore::setMetadataURL function
3708         https://bugs.webkit.org/show_bug.cgi?id=170786
3709
3710         Reviewed by Beth Dakin.
3711
3712         Update for WebCore changes.
3713
3714         * UIProcess/Cocoa/WebViewImpl.mm:
3715         (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination):
3716
3717 2017-04-12  Brent Fulgham  <bfulgham@apple.com>
3718
3719         [WK2][Mac] Stop allowing access to disk arbitration process
3720         https://bugs.webkit.org/show_bug.cgi?id=170517
3721         <rdar://problem/31071151>
3722
3723         Reviewed by Alex Christensen.
3724
3725         * WebProcess/com.apple.WebProcess.sb.in:
3726
3727 2017-04-12  Beth Dakin  <bdakin@apple.com>
3728
3729         32-bit build fix.
3730
3731         * UIProcess/API/mac/WKView.mm:
3732         (-[WKView _mediaPlaybackControlsView]):
3733
3734 2017-04-12  Beth Dakin  <bdakin@apple.com>
3735
3736         More 32-bit build fix.
3737
3738         * UIProcess/API/Cocoa/WKWebView.mm:
3739         (-[WKWebView _mediaPlaybackControlsView]):
3740         (-[WKWebView _addMediaPlaybackControlsView:]):
3741         * UIProcess/API/mac/WKView.mm:
3742         (-[WKView _mediaPlaybackControlsView]):
3743         (-[WKView _addMediaPlaybackControlsView:]):
3744
3745 2017-04-12  Beth Dakin  <bdakin@apple.com>
3746
3747         Another 32 bit build fix.
3748
3749         * UIProcess/Cocoa/WebViewImpl.h:
3750         * UIProcess/Cocoa/WebViewImpl.mm:
3751         (WebKit::WebViewImpl::mediaPlaybackControlsView):
3752
3753 2017-04-12  Alex Christensen  <achristensen@webkit.org>
3754
3755         Stop using didReceiveDataArray callback on El Capitan
3756         https://bugs.webkit.org/show_bug.cgi?id=170780
3757
3758         Reviewed by Brady Eidson.
3759
3760         * NetworkProcess/NetworkLoad.cpp:
3761         (WebKit::NetworkLoad::supportsDataArray): Deleted.
3762         (WebKit::NetworkLoad::didReceiveDataArray): Deleted.
3763         * NetworkProcess/NetworkLoad.h:
3764
3765 2017-04-12  Beth Dakin  <bdakin@apple.com>
3766
3767         Speculative build fix.
3768
3769         * UIProcess/API/Cocoa/WKViewPrivate.h:
3770
3771 2017-04-12  Beth Dakin  <bdakin@apple.com>
3772
3773         Attempted build fix.
3774
3775         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3776
3777 2017-04-12  Beth Dakin  <bdakin@apple.com>
3778
3779         Adopt AVKit name change from AVFunctionBar* to AVTouchBar*
3780         https://bugs.webkit.org/show_bug.cgi?id=170693
3781         -and corresponding-
3782         rdar://problem/31230018
3783
3784         Reviewed by Sam Weinig.
3785
3786         Since the new names only apply to some versions of macOS, this patch uses typedefs 
3787         for the older OS’s. SO:
3788
3789         AVFunctionBarScrubber is now AVTouchBarScrubber
3790
3791         AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider
3792
3793         AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption
3794
3795         And the protocol AVFunctionBarPlaybackControlsControlling is now 
3796         AVTouchBarPlaybackControlsControlling
3797
3798         Use the new name.
3799         * UIProcess/API/Cocoa/WKViewPrivate.h:
3800         * UIProcess/API/Cocoa/WKWebView.mm:
3801         (-[WKWebView _mediaPlaybackControlsView]):
3802         (-[WKWebView _addMediaPlaybackControlsView:]):
3803         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3804         * UIProcess/API/mac/WKView.mm:
3805         (-[WKView _mediaPlaybackControlsView]):
3806         (-[WKView _addMediaPlaybackControlsView:]):
3807         * UIProcess/Cocoa/WebViewImpl.h:
3808
3809         Soft links and allocations cannot use the typedefs.
3810         * UIProcess/Cocoa/WebViewImpl.mm:
3811         (WebKit::WebViewImpl::mediaPlaybackControlsView):
3812         (WebKit::WebViewImpl::updateMediaTouchBar):
3813
3814 2017-04-12  Eric Carlson  <eric.carlson@apple.com>
3815
3816         [MediaStream] Audio source in UI process not identified as capture source
3817         https://bugs.webkit.org/show_bug.cgi?id=170776
3818
3819         Reviewed by Youenn Fablet.
3820
3821         * WebProcess/cocoa/UserMediaCaptureManager.cpp: Override isCaptureSource.
3822
3823 2017-04-12  Andrew Gold  <agold@apple.com>
3824
3825         Allow iOS to toggle webRTCAPI legacy flag.
3826         https://bugs.webkit.org/show_bug.cgi?id=170735
3827
3828         Reviewed by Eric Carlson.
3829
3830         * UIProcess/API/Cocoa/WKPreferences.mm:
3831         (-[WKPreferences _webRTCLegacyAPIEnabled]):
3832         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
3833         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3834
3835 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
3836
3837         Unreviewed, build fix for GTK port after r215262
3838         https://bugs.webkit.org/show_bug.cgi?id=170758
3839
3840         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3841         (WebKit::NetworkDataTaskSoup::didRead):
3842
3843 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
3844
3845         [WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading implementation semantics to Pthread one
3846         https://bugs.webkit.org/show_bug.cgi?id=170502
3847
3848         Reviewed by Mark Lam.
3849
3850         Mechanical change. Use Thread:: APIs.
3851
3852         * NetworkProcess/NetworkProcess.cpp:
3853         (WebKit::NetworkProcess::initializeNetworkProcess):
3854         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3855         (WebKit::NetworkCache::IOChannel::readSyncInThread):
3856         * Platform/IPC/Connection.cpp:
3857         (IPC::Connection::processIncomingMessage):
3858         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
3859         (WebKit::XPCServiceInitializer):
3860         * UIProcess/linux/MemoryPressureMonitor.cpp:
3861         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
3862         * WebProcess/WebProcess.cpp:
3863         (WebKit::WebProcess::initializeWebProcess):
3864
3865 2017-04-10  Antti Koivisto  <antti@apple.com>
3866
3867         Cache small media resources in disk cache
3868         https://bugs.webkit.org/show_bug.cgi?id=170676
3869         <rdar://problem/31532649>
3870
3871         Reviewed by Andreas Kling.
3872
3873         * NetworkProcess/cache/NetworkCache.cpp:
3874         (WebKit::NetworkCache::makeRetrieveDecision):
3875
3876             Allow retrieving media resources.
3877
3878         (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange):
3879         (WebKit::NetworkCache::expectedTotalResourceSize):
3880         (WebKit::NetworkCache::makeStoreDecision):
3881
3882             Store media resource if we can figure out its total size and it is less than 5MB
3883             (and it is cacheable by the usual rules).
3884
3885 2017-04-12  Alex Christensen  <achristensen@webkit.org>
3886
3887         Modernize vector adoption
3888         https://bugs.webkit.org/show_bug.cgi?id=170758
3889
3890         Reviewed by Geoffrey Garen.
3891
3892         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
3893         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
3894         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3895         (WebKit::WebPlatformStrategies::bufferForType):
3896
3897 2017-04-12  Zan Dobersek  <zdobersek@igalia.com>
3898
3899         Unreviewed GTK+ debug build fix. Drop an unused debug-only member
3900         variable in the CompositingRunLoop class.
3901
3902         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
3903
3904 2017-04-11  Zan Dobersek  <zdobersek@igalia.com>
3905
3906         [GTK] Use the DisplayRefreshMonitor facilities
3907         https://bugs.webkit.org/show_bug.cgi?id=170599
3908
3909         Reviewed by Carlos Garcia Campos.
3910
3911         ThreadedCompositor gains a DisplayRefreshMonitor member that it can use
3912         to better coordinate display refresh callbacks on the main thread. Still,
3913         because currently the GTK+ port doesn't have a reliable way of notifying
3914         the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used
3915         in order to keep the updates at a reasonable rate. When the timer is fired,
3916         the ThreadedCompositor decides how to proceed based on state changes that
3917         might have occurred during composition or whether there's any display
3918         refresh callbacks that require handling on the main thread.
3919
3920         CompositingRunLoop now stores its state in an atomic variable that's then
3921         inspected whenever a new update is scheduled or completed. When scheduled,
3922         if there's no update in progress, a new update is requested through the
3923         timer. If there's already an update in progress, a new update is marked
3924         as pending after the current one completes. In that case, when the update
3925         is completed, a new update is requested through the timer.
3926
3927         ThreadedDisplayRefreshMonitor is used to coordinate updates between the
3928         main and the composition thread whenever the CoordinatedGraphics state
3929         demands it, or whenever there are clients registered to that monitor that
3930         require an update (e.g. a requestAnimationFrame() callback). After the
3931         update on the composition thread is finished, and the DisplayRefreshMonitor
3932         object requires an update, a callback at the same priority as the layer
3933         flush timer is scheduled on the main thread. In that callback we handle
3934         any clients registered for this DisplayRefreshMonitor before proceeding
3935         to handle any changes to the CoordinatedGraphics scene. In case the
3936         DisplayRefreshMonitor clients or the layer flushes already queued up
3937         any changes to the state, we immediately ask the ThreadedCompositor for
3938         an update.
3939
3940         * PlatformGTK.cmake:
3941         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3942         (WebKit::CoordinatedGraphicsScene::updateViewport):
3943         (WebKit::CoordinatedGraphicsScene::commitSceneState):
3944         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3945         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3946         (WebKit::CompositingRunLoop::CompositingRunLoop):
3947         (WebKit::CompositingRunLoop::isActive):
3948         (WebKit::CompositingRunLoop::scheduleUpdate):
3949         (WebKit::CompositingRunLoop::stopUpdates):
3950         (WebKit::CompositingRunLoop::updateCompleted):
3951         (WebKit::CompositingRunLoop::updateTimerFired):
3952         (WebKit::CompositingRunLoop::isCurrent):
3953         (WebKit::CompositingRunLoop::startUpdateTimer): Deleted.
3954         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
3955         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
3956         (): Deleted.
3957         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3958         (WebKit::m_displayRefreshMonitor):
3959         (WebKit::ThreadedCompositor::invalidate):
3960         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
3961         (WebKit::ThreadedCompositor::updateViewport):
3962         (WebKit::ThreadedCompositor::scheduleDisplayImmediately):
3963         (WebKit::ThreadedCompositor::renderLayerTree):
3964         (WebKit::ThreadedCompositor::sceneUpdateFinished):
3965         (WebKit::ThreadedCompositor::updateSceneState):
3966         (WebKit::ThreadedCompositor::displayRefreshMonitor):
3967         (WebKit::ThreadedCompositor::renderNextFrameIfNeeded):
3968         (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded):
3969         (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient):
3970         (WebKit::ThreadedCompositor::performFrameCompletion):
3971         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3972         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added.
3973         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
3974         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
3975         (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback):
3976         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
3977         (WebKit::ThreadedDisplayRefreshMonitor::invalidate):
3978         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
3979         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
3980         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3981         (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor):
3982         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3983         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3984         (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor):
3985         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3986         * WebProcess/WebPage/LayerTreeHost.h:
3987         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
3988
3989 2017-04-11  Alex Christensen  <achristensen@webkit.org>
3990
3991         Modernize and clean up code
3992         https://bugs.webkit.org/show_bug.cgi?id=170752
3993
3994         Reviewed by Sam Weinig.
3995
3996         * NetworkProcess/NetworkResourceLoader.h:
3997         * Shared/WebPreferencesStore.h:
3998         * UIProcess/API/APIHitTestResult.cpp:
3999         (API::HitTestResult::create):
4000         * UIProcess/API/APIHitTestResult.h:
4001         * UIProcess/API/C/WKPreferences.cpp:
4002         (WKPreferencesCreate):
4003         (WKPreferencesCreateWithIdentifier):
4004         (WKPreferencesCreateCopy):
4005         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
4006         * UIProcess/WebPreferences.cpp:
4007         (WebKit::WebPreferences::createWithLegacyDefaults):
4008         (WebKit::WebPreferences::copy):
4009         * UIProcess/WebPreferences.h:
4010         * WebProcess/Network/WebLoaderStrategy.h:
4011         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
4012         (WebKit::WebEditorClient::requestCheckingOfString):
4013         * WebProcess/WebPage/WebPage.cpp:
4014         (WebKit::WebPage::addTextCheckingRequest):
4015         * WebProcess/WebPage/WebPage.h:
4016         * WebProcess/WebPage/ios/WebPageIOS.mm:
4017         (WebKit::WebPage::rangeForWebSelectionAtPosition):
4018         (WebKit::WebPage::rangeForBlockAtPoint):
4019         (WebKit::WebPage::expandedRangeFromHandle):
4020         (WebKit::WebPage::contractedRangeFromHandle):
4021         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
4022         (WebKit::WebPage::changeBlockSelection):
4023         (WebKit::WebPage::rangeForGranularityAtPoint):
4024         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
4025
4026 2017-04-11  Dean Jackson  <dino@apple.com>
4027
4028         Disable outdated WritableStream API
4029         https://bugs.webkit.org/show_bug.cgi?id=170749
4030         <rdar://problem/31446233>
4031
4032         Reviewed by Tim Horton.
4033
4034         The API we implement is no longer accurate. Disable it until we
4035         are compatible with the new specification
4036
4037         * Configurations/FeatureDefines.xcconfig:
4038
4039 2017-04-11  Dan Bernstein  <mitz@apple.com>
4040
4041         [Cocoa] WebKit unnecessarily soft-links CorePrediction
4042         https://bugs.webkit.org/show_bug.cgi?id=170644
4043
4044         Reviewed by Sam Weinig.
4045
4046         * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added
4047           HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES.
4048
4049         * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where
4050           available. On macOS, use weak linking, because CorePrediction is not available in the
4051           Base System.
4052
4053         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed.
4054
4055         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with
4056           #if HAVE(CORE_PREDICTION).
4057         (WebKit::isNullFunctionPointer): Added this helper.
4058         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced
4059           dlopen()-based runtime check with a null check.
4060
4061         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if
4062           HAVE(CORE_PREDICTION).
4063
4064         * Platform/spi/Cocoa/CorePredictionSPI.h: Added.
4065
4066         * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION).
4067
4068         * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition.
4069
4070 2017-04-11  David Quesada  <david_quesada@apple.com>
4071
4072         Add SPI for handling geolocation authorization requests
4073         https://bugs.webkit.org/show_bug.cgi?id=170362
4074         rdar://problem/17508627
4075
4076         Reviewed by Alex Christensen.
4077
4078       &n