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