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