Unreviewed, rolling out r215730.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>
2
3         Unreviewed, rolling out r215730.
4
5         The LayoutTest for this change is a flaky timeout on mac-wk1
6         debug.
7
8         Reverted changeset:
9
10         "Enable expired-only reload policy on Mac and iOS"
11         https://bugs.webkit.org/show_bug.cgi?id=171264
12         http://trac.webkit.org/changeset/215730
13
14 2017-04-24  Matt Rajca  <mrajca@apple.com>
15
16         Indicate presence of audio when handling autoplay events.
17         https://bugs.webkit.org/show_bug.cgi?id=171227
18
19         Reviewed by Alex Christensen.
20
21         * UIProcess/API/APIUIClient.h:
22         (API::UIClient::handleAutoplayEvent):
23         * UIProcess/API/C/WKPage.cpp:
24         (WKPageSetPageUIClient):
25         * UIProcess/API/C/WKPageUIClient.h:
26         * UIProcess/WebPageProxy.cpp:
27         (WebKit::WebPageProxy::handleAutoplayEvent):
28         * UIProcess/WebPageProxy.h:
29         * UIProcess/WebPageProxy.messages.in:
30         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
31         (WebKit::WebChromeClient::handleAutoplayEvent):
32         * WebProcess/WebCoreSupport/WebChromeClient.h:
33
34 2017-04-25  Daniel Bates  <dabates@apple.com>
35
36         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
37         https://bugs.webkit.org/show_bug.cgi?id=136452
38         <rdar://problem/23412620>
39
40         Reviewed by Brent Fulgham.
41
42         Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.
43
44         * Configurations/FeatureDefines.xcconfig:
45
46 2017-04-25  John Wilander  <wilander@apple.com>
47
48         Resource Load Statistics: Clear network process cache when clearing store
49         https://bugs.webkit.org/show_bug.cgi?id=171256
50         <rdar://problem/31802347>
51
52         Reviewed by Brent Fulgham.
53
54         * NetworkProcess/NetworkProcess.cpp:
55         (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
56             Now takes and passes on the boolean parameter clearFirst to
57             WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts().
58         * NetworkProcess/NetworkProcess.h:
59         * NetworkProcess/NetworkProcess.messages.in:
60             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
61             takes the boolean parameter clearFirst.
62         * UIProcess/Network/NetworkProcessProxy.cpp:
63         (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
64             Now takes and passes on the boolean parameter clearFirst to
65             Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains.
66         * UIProcess/Network/NetworkProcessProxy.h:
67         * UIProcess/Network/NetworkProcessProxy.messages.in:
68             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
69             takes the boolean parameter clearFirst.
70         * UIProcess/WebResourceLoadStatisticsManager.cpp:
71         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
72             Now uses the boolean parameter clearFirst when calling
73             WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
74         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
75             No longer uses the deleted store getter.
76         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
77             No longer uses the deleted store getter.
78         * UIProcess/WebResourceLoadStatisticsStore.cpp:
79         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
80             No sends the boolean parameter clearFirst to
81             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
82         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
83             Now expects a handler with the boolean parameter clearFirst.
84         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
85         * UIProcess/WebResourceLoadStatisticsStore.h:
86             Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore().
87         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
88         (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
89             Now takes and passes on the boolean parameter clearFirst in its
90             message to the network process.
91         (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
92             Now expects a handler with the boolean parameter clearFirst.
93         * UIProcess/WebsiteData/WebsiteDataStore.h:
94
95 2017-04-25  Chris Dumez  <cdumez@apple.com>
96
97         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
98         https://bugs.webkit.org/show_bug.cgi?id=171239
99         <rdar://problem/31789855>
100
101         Reviewed by Alex Christensen.
102
103         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML.
104         This is not as per HTML specification:
105         - https://html.spec.whatwg.org/#as-a-download (Step 2)
106
107         Content-Disposition header filename is supposed to override the value of the download attribute.
108
109         Firefox and Chrome follow the specification.
110
111         * NetworkProcess/NetworkProcess.cpp:
112         (WebKit::NetworkProcess::findPendingDownloadLocation):
113         * UIProcess/Downloads/DownloadProxy.cpp:
114         (WebKit::DownloadProxy::didReceiveResponse):
115
116 2017-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
117
118         [GTK] Add WebKitInspectorWindow to create inspector windows from local and remote inspector
119         https://bugs.webkit.org/show_bug.cgi?id=171261
120
121         Reviewed by Michael Catanzaro.
122
123         The code is currently duplicated in WebInspectorProxyGtk.cpp and RemoteWebInspectorProxyGtk.cpp. We can simplify
124         it by using a common widget in both places.
125         This patch also fixes the build when using GTK+ < 3.16.
126
127         * PlatformGTK.cmake:
128         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
129         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
130         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
131         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
132         (WebKit::WebInspectorProxy::createInspectorWindow):
133         (WebKit::WebInspectorProxy::updateInspectorWindowTitle):
134         * UIProcess/gtk/WebKitInspectorWindow.cpp: Added.
135         (webkit_inspector_window_class_init):
136         (webkit_inspector_window_init):
137         (webkitInspectorWindowNew):
138         (webkitInspectorWindowSetSubtitle):
139         * UIProcess/gtk/WebKitInspectorWindow.h: Added.
140
141 2017-04-25  Antti Koivisto  <antti@apple.com>
142
143         Enable expired-only reload policy on Mac and iOS
144         https://bugs.webkit.org/show_bug.cgi?id=171264
145         <rdar://problem/31807637>
146
147         Reviewed by Andreas Kling.
148
149         Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
150         The behavor is enabled in Safari and for other clients based on SDK version check.
151
152         * UIProcess/API/C/WKPage.cpp:
153         (WKPageReload):
154         * UIProcess/API/Cocoa/WKWebView.mm:
155         (-[WKWebView reload]):
156         * UIProcess/Cocoa/VersionChecks.h:
157
158 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
159
160         Support reading NSURL titles from the pasteboard when performing data interaction
161         https://bugs.webkit.org/show_bug.cgi?id=171156
162         <rdar://problem/31356937>
163
164         Reviewed by Tim Horton.
165
166         Adjust for interface changes in WebCore to support plumbing the title of an NSURL from the platform pasteboard
167         back to WebCore. Additionally, implement WebEditorClient::hasRichlyEditableSelection (which previously returned
168         false) to check whether the current selection is richly editable, or the drop caret is in richly editable content.
169         See WebCore ChangeLog for more details.
170
171         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
172         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
173         * UIProcess/WebPasteboardProxy.h:
174         * UIProcess/WebPasteboardProxy.messages.in:
175         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
176         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
177         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
178         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
179         (WebKit::WebEditorClient::hasRichlyEditableSelection):
180         * WebProcess/WebPage/WebPage.cpp:
181         (WebKit::WebPage::hasRichlyEditableSelection):
182         * WebProcess/WebPage/WebPage.h:
183
184 2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
185
186         Respect fidelity order when reading web content from item providers
187         https://bugs.webkit.org/show_bug.cgi?id=171155
188         <rdar://problem/31356937>
189
190         Reviewed by Tim Horton.
191
192         Adjusts for changes in WebCore by adding plumbing to support Pasteboard::getTypesByFidelityForItemAtIndex. See
193         WebCore/ChangeLog for more details.
194
195         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
196         (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex):
197         * UIProcess/WebPasteboardProxy.h:
198         * UIProcess/WebPasteboardProxy.messages.in:
199         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
200         (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex):
201         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
202
203 2017-04-24  Brady Eidson  <beidson@apple.com>
204
205         WebProcessPools should always have a WebsiteDataStore
206         https://bugs.webkit.org/show_bug.cgi?id=171252
207
208         Reviewed by Alex Christensen.
209
210         * UIProcess/API/APIWebsiteDataStore.cpp:
211         (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted.
212         * UIProcess/API/APIWebsiteDataStore.h:
213         * UIProcess/API/C/WKContext.cpp:
214         (WKContextGetWebsiteDataStore):
215         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
216         (WebKit::WebProcessPool::platformInitialize):
217         * UIProcess/WebProcessPool.cpp:
218         (WebKit::WebProcessPool::WebProcessPool):
219         (WebKit::WebProcessPool::createWebPage):
220         * UIProcess/WebProcessPool.h:
221         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
222         (WebKit::WebsiteDataStore::isAssociatedProcessPool):
223
224 2017-04-24  Youenn Fablet  <youenn@apple.com>
225
226         Set defaults video getUserMedia constraints
227         https://bugs.webkit.org/show_bug.cgi?id=171127
228
229         Reviewed by Eric Carlson.
230
231         Updated to cope with MediaStreamConstraintsImpl refactoring.
232
233         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
234         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
235         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
236         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
237
238 2017-04-24  Chris Dumez  <cdumez@apple.com>
239
240         Allow tabs with capturing audio or video to exceed background CPU limit
241         https://bugs.webkit.org/show_bug.cgi?id=171249
242         <rdar://problem/31796314>
243
244         Reviewed by Geoffrey Garen.
245
246         Allow tabs with capturing audio or video to exceed background CPU limit as this
247         is a legit case of potentially high background CPU use.
248
249         * UIProcess/WebProcessProxy.cpp:
250         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
251
252 2017-04-24  Andy Estes  <aestes@apple.com>
253
254         Try to fix the 32-bit macOS build.
255
256         * UIProcess/Cocoa/WebViewImpl.mm:
257
258 2017-04-24  Andy Estes  <aestes@apple.com>
259
260         [macOS] Enable media selection button on AVTouchBarScrubber
261         https://bugs.webkit.org/show_bug.cgi?id=171149
262         <rdar://problem/29875010>
263
264         Reviewed by Beth Dakin.
265
266         * UIProcess/Cocoa/WebViewImpl.mm:
267         (WebKit::WebViewImpl::updateMediaTouchBar):
268
269 2017-04-24  Alex Christensen  <achristensen@webkit.org>
270
271         Reduce copies and allocations in SharedBuffer::append
272         https://bugs.webkit.org/show_bug.cgi?id=170956
273
274         Reviewed by Andreas Kling.
275
276         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
277         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
278         * Platform/IPC/DataReference.cpp:
279         (IPC::SharedBufferDataReference::encode):
280         * Shared/ShareableResource.cpp:
281         (WebKit::ShareableResource::wrapInSharedBuffer):
282         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
283         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
284         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
285         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
286         * WebProcess/Plugins/PDF/PDFPlugin.mm:
287         (WebKit::PDFPlugin::addArchiveResource):
288         (WebKit::PDFPlugin::liveResourceData):
289         (WebKit::PDFPlugin::writeItemsToPasteboard):
290         * WebProcess/Plugins/PluginView.cpp:
291         (WebKit::PluginView::redeliverManualStream):
292         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
293         (WebKit::WebDragClient::declareAndWriteDragImage):
294         * WebProcess/WebPage/mac/WebPageMac.mm:
295         (WebKit::WebPage::cachedResponseDataForURL):
296
297 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
298
299         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
300         https://bugs.webkit.org/show_bug.cgi?id=166680
301
302         Reviewed by Michael Catanzaro.
303
304         Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a
305         custom protocol "inspector" that loads a page with the list of debuggable targets.
306
307         * PlatformGTK.cmake: Add new files to compilation and remove the old ones.
308         * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed.
309         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added.
310         (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler):
311         (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler):
312         (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed):
313         (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed):
314         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
315         (WebKit::RemoteInspectorProtocolHandler::inspect):
316         (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
317         (WebKit::RemoteInspectorProtocolHandler::connectionClosed):
318         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added.
319         * UIProcess/API/gtk/WebKitWebContext.cpp:
320         (webkitWebContextConstructed):
321         * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs.
322         * UIProcess/InspectorServer/HTTPRequest.h:
323         * UIProcess/InspectorServer/WebInspectorServer.h:
324         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed.
325         * UIProcess/RemoteWebInspectorProxy.cpp:
326         * UIProcess/RemoteWebInspectorProxy.h:
327         * UIProcess/WebProcessPool.cpp:
328         * UIProcess/glib/RemoteInspectorClient.cpp: Added.
329         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
330         (WebKit::RemoteInspectorClient::~RemoteInspectorClient):
331         (WebKit::dbusConnectionCallAsyncReadyCallback):
332         (WebKit::RemoteInspectorClient::connectionClosedCallback):
333         (WebKit::RemoteInspectorClient::setupConnection):
334         (WebKit::RemoteInspectorClient::connectionClosed):
335         (WebKit::RemoteInspectorClient::inspect):
336         (WebKit::RemoteInspectorClient::sendMessageToBackend):
337         (WebKit::RemoteInspectorClient::closeFromFrontend):
338         (WebKit::RemoteInspectorClient::setTargetList):
339         (WebKit::RemoteInspectorClient::sendMessageToFrontend):
340         * UIProcess/glib/RemoteInspectorClient.h: Added.
341         (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver):
342         (WebKit::RemoteInspectorClient::targets):
343         (WebKit::RemoteInspectorClient::hostAndPort):
344         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added.
345         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
346         (WebKit::inspectorViewDestroyed):
347         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
348         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
349         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
350         (WebKit::RemoteWebInspectorProxy::platformSave):
351         (WebKit::RemoteWebInspectorProxy::platformAppend):
352         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
353         (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab):
354         * UIProcess/gtk/WebProcessPoolGtk.cpp:
355         (WebKit::initializeRemoteInspectorServer):
356         (WebKit::WebProcessPool::platformInitialize):
357         (WebKit::WebProcessPool::platformInitializeWebProcess):
358         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
359         (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes.
360         * config.h:
361
362 2017-04-23  Dan Bernstein  <mitz@apple.com>
363
364         [macOS] WKWebInspectorProxyObjCAdapter has a public ivar
365         https://bugs.webkit.org/show_bug.cgi?id=171200
366
367         Reviewed by Geoffrey Garen.
368
369         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private.
370
371 2017-04-23  Commit Queue  <commit-queue@webkit.org>
372
373         Unreviewed, rolling out r215657 and r215676.
374         https://bugs.webkit.org/show_bug.cgi?id=171201
375
376         Broke the build (Requested by ap on #webkit).
377
378         Reverted changesets:
379
380         "[macOS] Enable media selection button on AVTouchBarScrubber"
381         https://bugs.webkit.org/show_bug.cgi?id=171149
382         http://trac.webkit.org/changeset/215657
383
384         "Build fix after r215657."
385         http://trac.webkit.org/changeset/215676
386
387 2017-04-23  Alexey Proskuryakov  <ap@apple.com>
388
389         Build fix after r215657.
390
391         * UIProcess/Cocoa/WebViewImpl.mm:
392
393 2017-04-23  Andy Estes  <aestes@apple.com>
394
395         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
396         https://bugs.webkit.org/show_bug.cgi?id=171192
397         <rdar://problem/29875010>
398
399         Reviewed by Wenson Hsieh.
400
401         * Shared/WebCoreArgumentCoders.cpp:
402         (IPC::ArgumentCoder<MediaSelectionOption>::encode):
403         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
404         * Shared/WebCoreArgumentCoders.h:
405         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
406         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
407         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
408         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions):
409         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions):
410         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
411         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
412         * WebProcess/cocoa/WebPlaybackSessionManager.h:
413         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
414         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged):
415         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged):
416         (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
417         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
418
419 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
420
421         Support writing link titles to the pasteboard when beginning data interaction on a link
422         https://bugs.webkit.org/show_bug.cgi?id=171154
423         <rdar://problem/31356937>
424
425         Reviewed by Andy Estes.
426
427         Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details.
428
429         * Scripts/webkit/messages.py:
430         (headers_for_type):
431         * Shared/WebCoreArgumentCoders.cpp:
432         (IPC::ArgumentCoder<PasteboardURL>::encode):
433         (IPC::ArgumentCoder<PasteboardURL>::decode):
434         * Shared/WebCoreArgumentCoders.h:
435
436         Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and
437         its title.
438
439         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
440         (WebKit::WebPasteboardProxy::writeURLToPasteboard):
441         * UIProcess/WebPasteboardProxy.h:
442         * UIProcess/WebPasteboardProxy.messages.in:
443
444         Add IPC plumbing for writing PasteboarURLs to the pasteboard.
445
446         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
447         (WebKit::WebPlatformStrategies::writeToPasteboard):
448         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
449
450 2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>
451
452         Unreviewed, rolling out r215608.
453
454         Hundreds of test failures on GTK bot
455
456         Reverted changeset:
457
458         "Reduce copies and allocations in SharedBuffer::append"
459         https://bugs.webkit.org/show_bug.cgi?id=170956
460         http://trac.webkit.org/changeset/215608
461
462 2017-04-21  Andy Estes  <aestes@apple.com>
463
464         [macOS] Enable media selection button on AVTouchBarScrubber
465         https://bugs.webkit.org/show_bug.cgi?id=171149
466         <rdar://problem/29875010>
467
468         Reviewed by Beth Dakin.
469
470         * UIProcess/Cocoa/WebViewImpl.mm:
471         (WebKit::WebViewImpl::updateMediaTouchBar):
472
473 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
474
475         [WK2] Add delegate hooks for overriding unhanded data interaction operations
476         https://bugs.webkit.org/show_bug.cgi?id=171005
477         <rdar://problem/31669646>
478
479         Reviewed by Tim Horton.
480
481         Adds support for overriding data interaction operations through two new delegate methods:
482         _webView:willUpdateDataInteractionOperationToOperation:forSession:, and
483         _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different
484         operation type than what WebKit would originally have returned, and the latter may be overridden to run custom
485         logic after the web process has handled a data interaction operation.
486
487         Additionally, includes some minor cleanup around WKContentViewInteraction. With the new
488         _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate
489         may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely.
490         Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct
491         instead, so that all state associated with data interaction may be cleaned up at the same time.
492
493         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
494         * UIProcess/API/Cocoa/WKWebView.mm:
495         (-[WKWebView _testingDelegate]): Deleted.
496         (-[WKWebView _setTestingDelegate:]): Deleted.
497         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
498         * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed.
499         * UIProcess/PageClient.h:
500         * UIProcess/WebPageProxy.h:
501         * UIProcess/WebPageProxy.messages.in:
502
503         Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process
504         know whether or not the data interaction operation was handled by the web process, and is eventually plumbed
505         through to the UI delegate via the new SPI.
506
507         * UIProcess/ios/PageClientImplIOS.h:
508         * UIProcess/ios/PageClientImplIOS.mm:
509         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
510         * UIProcess/ios/WKContentViewInteraction.h:
511         * UIProcess/ios/WKContentViewInteraction.mm:
512         (-[WKContentView cleanupInteraction]):
513         (-[WKContentView _displayFormNodeInputView]):
514         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
515         * UIProcess/ios/WebPageProxyIOS.mm:
516         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
517         * WebKit2.xcodeproj/project.pbxproj:
518         * WebProcess/WebPage/WebPage.cpp:
519         (WebKit::WebPage::performDragControllerAction):
520
521 2017-04-21  Anders Carlsson  <andersca@apple.com>
522
523         Stop using deprecated APIs, part 5
524         https://bugs.webkit.org/show_bug.cgi?id=171134
525         rdar://problem/31589635
526
527         Reviewed by Tim Horton.
528
529         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
530         (WebKit::toPKPaymentAuthorizationStatus):
531         Remove this and add a new version that doesn't use any deprecated values.
532
533         (WebKit::toPKPaymentAuthorizationStatus):
534         New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes.
535
536         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
537         Use the new toPKPaymentAuthorizationStatus versions.
538
539         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
540         Ditto.
541
542         (WebKit::status): Deleted.
543
544 2017-04-21  David Kilzer  <ddkilzer@apple.com>
545
546         Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
547         <https://webkit.org/b/171122>
548
549         Reviewed by Brent Fulgham.
550
551         * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
552         headers to check for build settings.
553
554 2017-04-21  Jer Noble  <jer.noble@apple.com>
555
556         [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess
557         https://bugs.webkit.org/show_bug.cgi?id=170846
558
559         Reviewed by Jon Lee.
560
561         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
562         (WebKit::UserMediaCaptureManagerProxy::setMuted):
563         (WebKit::UserMediaCaptureManagerProxy::setEnabled):
564         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
565         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
566         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
567         (WebKit::UserMediaCaptureManager::Source::setMuted):
568         (WebKit::UserMediaCaptureManager::Source::setEnabled):
569         (WebKit::UserMediaCaptureManager::setMuted):
570         (WebKit::UserMediaCaptureManager::setEnabled):
571         * WebProcess/cocoa/UserMediaCaptureManager.h:
572
573 2017-04-21  Jer Noble  <jer.noble@apple.com>
574
575         [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess
576         https://bugs.webkit.org/show_bug.cgi?id=170847
577
578         Reviewed by Jon Lee.
579
580         * Shared/WebPreferencesDefinitions.h:
581         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
582         (-[WKWebViewConfiguration copyWithZone:]):
583         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted.
584         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted.
585
586 2017-04-21  Anders Carlsson  <andersca@apple.com>
587
588         Stop using deprecated APIs, part 4
589         https://bugs.webkit.org/show_bug.cgi?id=171125
590         rdar://problem/31589635
591
592         Reviewed by Tim Horton.
593
594         It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point
595         so just remove the status parameter.
596
597         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
598         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
599         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
600         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
601
602 2017-04-21  Andrew Gold  <agold@apple.com>
603
604         -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] 
605         decision handler should only have one parameter.
606         https://bugs.webkit.org/show_bug.cgi?id=171081
607
608         Reviewed by Tim Horton.
609
610         Because user media authorization is all or nothing, we should not have separate booleans
611         to indicate authorization. Additionally, rather than passing two separate booleans to the
612         UIDelegate, we now pass an NS_OPTIONS parameter.
613
614         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
615         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS.
616
617         * UIProcess/Cocoa/UIDelegate.mm:
618         * UIProcess/Cocoa/UIDelegate.mm:
619         (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method.
620         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
621
622 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
623
624         Unreviewed, added missing file to PlatformMac.cmake
625
626         * PlatformMac.cmake:
627
628 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
629
630         Unreviewed follow-up for r215609
631
632         * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too.
633
634 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
635
636         Include iOS-specific headers inside preprocessor guard
637         https://bugs.webkit.org/show_bug.cgi?id=171104
638
639         Reviewed by Michael Catanzaro.
640
641         This patch should fix Mac cmake build.
642
643         * UIProcess/API/Cocoa/WKWebView.mm:
644
645 2017-04-21  Alex Christensen  <achristensen@webkit.org>
646
647         Reduce copies and allocations in SharedBuffer::append
648         https://bugs.webkit.org/show_bug.cgi?id=170956
649
650         Reviewed by Andreas Kling.
651
652         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
653         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
654         * Platform/IPC/DataReference.cpp:
655         (IPC::SharedBufferDataReference::encode):
656         * Shared/ShareableResource.cpp:
657         (WebKit::ShareableResource::wrapInSharedBuffer):
658         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
659         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
660         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
661         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
662         * WebProcess/Plugins/PDF/PDFPlugin.mm:
663         (WebKit::PDFPlugin::addArchiveResource):
664         (WebKit::PDFPlugin::liveResourceData):
665         (WebKit::PDFPlugin::writeItemsToPasteboard):
666         * WebProcess/Plugins/PluginView.cpp:
667         (WebKit::PluginView::redeliverManualStream):
668         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
669         (WebKit::WebDragClient::declareAndWriteDragImage):
670         * WebProcess/WebPage/mac/WebPageMac.mm:
671         (WebKit::WebPage::cachedResponseDataForURL):
672
673 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
674
675         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
676         https://bugs.webkit.org/show_bug.cgi?id=171071
677
678         Reviewed by Michael Catanzaro.
679
680         "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
681         build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
682         be available for all ports.
683
684         * CMakeLists.txt:
685         * PlatformMac.cmake:
686
687 2017-04-20  Brady Eidson  <beidson@apple.com>
688
689         WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:...
690         <rdar://problem/31739023> and https://bugs.webkit.org/show_bug.cgi?id=171090
691
692         Reviewed by Andy Estes.
693
694         * UIProcess/Cocoa/UIDelegate.mm:
695         (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly.
696
697 2017-04-20  Dan Bernstein  <mitz@apple.com>
698
699         Disable header postprocessing when building for Sierra
700
701         Absolutely rubber-stamped by Anders Carlsson.
702
703         * Configurations/WebKit.xcconfig:
704
705 2017-04-20  Matt Rajca  <mrajca@apple.com>
706
707         Cocoa: add private API for suppressing first responder changes
708         https://bugs.webkit.org/show_bug.cgi?id=171069
709         <rdar://problem/31658967>
710
711         Reviewed by Tim Horton.
712
713         Some clients may not want the web view to be programmatically made the first responder
714         and invoking -makeFirstResponder: unconditionally posts 'first responder did change'
715         notifications.
716
717         Added API test.
718
719         * UIProcess/API/Cocoa/WKWebView.mm:
720         (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
721         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
722         * UIProcess/Cocoa/WebViewImpl.h:
723         * UIProcess/Cocoa/WebViewImpl.mm:
724         (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges):
725         * UIProcess/PageClient.h:
726         * UIProcess/mac/PageClientImpl.h:
727         * UIProcess/mac/PageClientImpl.mm:
728         (WebKit::PageClientImpl::makeFirstResponder):
729
730 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
731
732         [MediaStream iOS] Hold process assertion while media capture is active
733         https://bugs.webkit.org/show_bug.cgi?id=171017
734         <rdar://problem/31719177>
735
736         Reviewed by Dean Jackson.
737
738         * UIProcess/WebPageProxy.cpp:
739         (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary.
740         (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active.
741         (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted,
742         so pass IsCapturingMedia to activityStateDidChange.
743         (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto.
744
745         * WebProcess/WebPage/WebPage.cpp:
746         (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture
747         is active. 
748
749 2017-04-20  Anders Carlsson  <andersca@apple.com>
750
751         Fix build.
752
753         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
754         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
755
756 2017-04-20  Brady Eidson  <beidson@apple.com>
757
758         Add CompletionHandlerCallChecker to SPI added in r215545.
759         https://bugs.webkit.org/show_bug.cgi?id=171067
760
761         Reviewed by Dan Bernstein.
762
763         * UIProcess/Cocoa/UIDelegate.mm:
764         (WebKit::UIDelegate::UIClient::createNewPageCommon):
765
766 2017-04-20  Anders Carlsson  <andersca@apple.com>
767
768         Replace isFinalStateStatus with isFinalStateResult
769         https://bugs.webkit.org/show_bug.cgi?id=171072
770         rdar://problem/31589635
771
772         Reviewed by Tim Horton.
773
774         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
775         (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
776
777 2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
778
779         [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy
780         https://bugs.webkit.org/show_bug.cgi?id=170922
781         <rdar://problem/31634990>
782
783         Reviewed by Tim Horton.
784
785         Refactors part of the asynchronous position information mechanism introduced in
786         <https://trac.webkit.org/changeset/215171>, and introduces infrastructure for unit testing UI-side position
787         information requests.
788
789         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView
790         responsible for invoking queued position information handlers after receiving a position information response
791         from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all
792         callbacks whose requests are satisfied by the incoming position information update, saving the indices of these
793         handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of
794         pending callbacks. This is problematic when a synchronous position update (via
795         ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since
796         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we
797         will attempt to remove a callback at the same index twice.
798
799         To fix this, we change the array of pending position information handlers to be an array of optionals instead.
800         When invoking and removing pending handlers after a position information response arrives, we now mark callbacks
801         as handled by setting them to std::nullopt. Then, when the top-level invocation to
802         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers
803         from the pending vector.
804
805         Covered by 6 new unit tests:
806         - PositionInformationTests.FindDraggableLinkAtPosition
807         - PositionInformationTests.RequestDraggableLinkAtPosition
808         - PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock
809         - PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock
810         - PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock
811         - PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock
812
813         * UIProcess/API/Cocoa/WKWebView.mm:
814         (-[WKWebView draggableElementAtPosition:]):
815         (-[WKWebView requestDraggableElementAtPosition:completionBlock:]):
816
817         Uses WKContentView's position information request helpers to search for draggable elements on the page. There
818         are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo.
819
820         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
821         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added.
822         * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added.
823
824         Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment).
825
826         (-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]):
827         (-[_WKDraggableElementInfo copyWithZone:]):
828         * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added.
829         * UIProcess/ios/WKContentViewInteraction.h:
830         * UIProcess/ios/WKContentViewInteraction.mm:
831         (-[WKContentView currentPositionInformation]):
832         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
833         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
834         * WebKit2.xcodeproj/project.pbxproj:
835
836 2017-04-20  Anders Carlsson  <andersca@apple.com>
837
838         Fix a PassKit function declaration typo
839         https://bugs.webkit.org/show_bug.cgi?id=171068
840         rdar://problem/31635008
841
842         Reviewed by Tim Horton.
843
844         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
845         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
846
847 2017-04-20  Jer Noble  <jer.noble@apple.com>
848
849         [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
850         https://bugs.webkit.org/show_bug.cgi?id=171021
851
852         Reviewed by Eric Carlson.
853
854         Pass a deviceID rather than a CaptureDevice across the process boundary.
855
856         * Shared/WebCoreArgumentCoders.h:
857         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
858         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
859         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
860         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
861         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
862         (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
863         * WebProcess/cocoa/UserMediaCaptureManager.h:
864
865 2017-04-20  Alex Christensen  <achristensen@webkit.org>
866
867         Fix assertions in webProcessProxyFromConnection
868         https://bugs.webkit.org/show_bug.cgi?id=171025
869         <rdar://problem/31184073>
870
871         Reviewed by Brady Eidson.
872
873         * UIProcess/WebProcessPool.cpp:
874         (WebKit::webProcessProxyFromConnection):
875         If we have a Connection, then we have a valid process attached to that connection,
876         unless it's a Connection to a different type of child process.
877         Calling ChildProcessProxy::connection on other web processes that are in State::Launching,
878         then we get an assertion.  Luckily, ChildProcessProxy::hasConnection was introduced in r210861
879         for this reason.
880
881 2017-04-20  Brent Fulgham  <bfulgham@apple.com>
882
883         [WK2][macOS] Allow iokit-get-properties for IOAudioControlValue
884         https://bugs.webkit.org/show_bug.cgi?id=171020
885         <rdar://problem/30878974>
886
887         Reviewed by Alexey Proskuryakov.
888
889         * WebProcess/com.apple.WebProcess.sb.in: Add missing property name.
890
891 2017-04-19  Joseph Pecoraro  <pecoraro@apple.com>
892
893         Remove WebKitTestRunner code for enabling features that are already enabled by default
894         https://bugs.webkit.org/show_bug.cgi?id=171033
895
896         Reviewed by Ryosuke Niwa.
897
898         * WebProcess/InjectedBundle/InjectedBundle.cpp:
899         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
900
901 2017-04-19  Youenn Fablet  <youenn@apple.com>
902
903         [Mac] Allow customizing H264 encoder
904         https://bugs.webkit.org/show_bug.cgi?id=170829
905
906         Reviewed by Alex Christensen.
907
908         * Configurations/FeatureDefines.xcconfig:
909         * WebKit2.xcodeproj/project.pbxproj:
910
911 2017-04-19  Brady Eidson  <beidson@apple.com>
912
913         Add asynchronous equivalent of -[<WKUIDelegate> webView:createWebViewWithConfiguration:...].
914         <rdar://problem/30699851> and https://bugs.webkit.org/show_bug.cgi?id=171018
915
916         Reviewed by Tim Horton.
917
918         * UIProcess/API/APIUIClient.h:
919         (API::UIClient::createNewPageAsync):
920
921         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
922
923         * UIProcess/Cocoa/UIDelegate.h:
924         * UIProcess/Cocoa/UIDelegate.mm:
925         (WebKit::UIDelegate::setDelegate):
926         (WebKit::UIDelegate::UIClient::createNewPageCommon):
927         (WebKit::UIDelegate::UIClient::createNewPage):
928         (WebKit::UIDelegate::UIClient::createNewPageAsync):
929
930         * UIProcess/WebPageProxy.cpp:
931         (WebKit::WebPageProxy::createNewPage):
932         * UIProcess/WebPageProxy.h:
933         * UIProcess/WebPageProxy.messages.in:
934
935 2017-04-19  Anders Carlsson  <andersca@apple.com>
936
937         Stop using deprecated APIs, part 3
938         https://bugs.webkit.org/show_bug.cgi?id=171003
939         rdar://problem/31589635
940
941         Reviewed by Tim Horton.
942
943         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
944         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
945         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
946         Don't encode/decode status.
947
948         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
949         (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession):
950         Hide the UI and report back.
951
952         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
953         Add new member.
954
955         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
956         Add new message.
957
958         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
959         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
960         Always pass success in the old code path. Stop using the deprecated method.
961
962         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
963         (WebKit::WebPaymentCoordinator::cancelPaymentSession):
964         Send a message to the UI process.
965
966         * WebProcess/ApplePay/WebPaymentCoordinator.h:
967         Add new member.
968
969 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
970
971         [MediaStream] Limit capture to one tab at a time
972         https://bugs.webkit.org/show_bug.cgi?id=171009
973
974         Reviewed by Jon Lee.
975
976         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
977         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used.
978         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
979
980         * UIProcess/UserMediaProcessManager.cpp:
981         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams
982         on other pages.
983         (WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage.
984         * UIProcess/UserMediaProcessManager.h:
985
986         * UIProcess/WebPageProxy.cpp:
987         (WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call
988         willEnableMediaStreamInPage so streams in other pages are muted first.
989
990 2017-04-19  Brady Eidson  <beidson@apple.com>
991
992         REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed.
993         <rdar://problem/30774839> and https://bugs.webkit.org/show_bug.cgi?id=171002
994
995         Reviewed by Alex Christensen.
996
997         The original change unnecessarily avoided using the initial warmed process if an explicit
998         data store was set on the new WKWebView.
999         
1000         Fixing that fixes the regression.
1001         
1002         * UIProcess/API/Cocoa/WKProcessPool.mm:
1003         (-[WKProcessPool _webProcessCount]):
1004         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1005
1006         * UIProcess/WebProcessPool.cpp:
1007         (WebKit::WebProcessPool::createWebPage):
1008
1009 2017-04-19  Anders Carlsson  <andersca@apple.com>
1010
1011         Rename cancelPayment to cancelPaymentSession
1012         https://bugs.webkit.org/show_bug.cgi?id=171007
1013
1014         Reviewed by Tim Horton.
1015
1016         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1017         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
1018         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
1019         (WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted.
1020         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1021         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1022         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
1023         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1024         (WebKit::WebPaymentCoordinator::didCancelPaymentSession):
1025         (WebKit::WebPaymentCoordinator::didCancelPayment): Deleted.
1026         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1027         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
1028
1029 2017-04-19  David Kilzer  <ddkilzer@apple.com>
1030
1031         Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString()
1032         <https://webkit.org/b/170994>
1033         <rdar://problem/29889932>
1034
1035         Reviewed by Brent Fulgham.
1036
1037         * Platform/unix/EnvironmentUtilities.cpp:
1038         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
1039         Switch from using strcpy() to strlcpy().  Also switch from using
1040         strstr() to strnstr().
1041         * Platform/unix/EnvironmentUtilities.h: Switch to #pragma once.
1042         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
1043         Export function for testing.
1044         * WebKit2.xcodeproj/project.pbxproj:
1045         (EnvironmentUtilitiesTest.h): Make header private for testing.
1046
1047 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
1048
1049         Provide a way for clients to unmute a media stream.
1050         https://bugs.webkit.org/show_bug.cgi?id=170855
1051         <rdar://problem/31656855>
1052
1053         Unreviewed, fix a typo missed in the review of r215420.
1054
1055         * UIProcess/API/Cocoa/WKWebView.mm:
1056         (-[WKWebView _setPageMuted:]):
1057
1058 2017-04-19  Adrian Perez de Castro  <aperez@igalia.com>
1059
1060         [GTK] WebKitAutocleanups.h regression in v2.16.1 release
1061         https://bugs.webkit.org/show_bug.cgi?id=170987
1062
1063         Reviewed by Carlos Garcia Campos.
1064
1065         * UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon.
1066
1067 2017-04-18  Per Arne Vollan  <pvollan@apple.com>
1068
1069         Dragging a few items over MiniBrowser has 0 in the red indicator.
1070         https://bugs.webkit.org/show_bug.cgi?id=170874
1071
1072         Reviewed by Tim Horton.
1073
1074         When WebKit does not accept the drag items, the drag count badge should not be updated.
1075         Also, if WebKit changes the drag count badge, it should be restored to its original
1076         value when the drag exits.
1077
1078         * UIProcess/Cocoa/WebViewImpl.h:
1079         * UIProcess/Cocoa/WebViewImpl.mm:
1080         (WebKit::WebViewImpl::draggingEntered):
1081         (WebKit::WebViewImpl::draggingUpdated):
1082         (WebKit::WebViewImpl::draggingExited):
1083
1084 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1085
1086         [WK2] Add infrastructure and unit tests for file uploads using data interaction
1087         https://bugs.webkit.org/show_bug.cgi?id=170903
1088         <rdar://problem/31314689>
1089
1090         Reviewed by Tim Horton.
1091
1092         See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a
1093         BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where
1094         multiple files are being "data interacted" onto an element. See <https://bugs.webkit.org/show_bug.cgi?id=170880>
1095         for more details about the change this patch is testing.
1096
1097         * UIProcess/API/Cocoa/WKWebView.mm:
1098         (-[WKWebView _simulateDataInteractionUpdated:]):
1099         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1100         * UIProcess/ios/WKContentViewInteraction.h:
1101
1102 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1103
1104         [WK2] Support DataTransfer::files() when performing a DHTML data interaction
1105         https://bugs.webkit.org/show_bug.cgi?id=170880
1106         <rdar://problem/31314689>
1107
1108         Reviewed by Tim Horton.
1109
1110         See the WebCore ChangeLog for more details.
1111
1112         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1113         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction):
1114         * UIProcess/WebPageProxy.cpp:
1115         (WebKit::WebPageProxy::didPerformDragControllerAction):
1116         (WebKit::WebPageProxy::resetCurrentDragInformation):
1117         * UIProcess/WebPageProxy.h:
1118         (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag):
1119         * UIProcess/WebPageProxy.messages.in:
1120
1121         Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior.
1122
1123         * UIProcess/WebPasteboardProxy.h:
1124         * UIProcess/WebPasteboardProxy.messages.in:
1125
1126         Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath.
1127
1128         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1129         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction):
1130         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1131         * WebProcess/WebPage/WebPage.cpp:
1132         (WebKit::WebPage::performDragControllerAction):
1133
1134 2017-04-18  John Wilander  <wilander@apple.com>
1135
1136         Resource Load Statistics: Check both origins and cookieHostNames for domain matches in data removal
1137         https://bugs.webkit.org/show_bug.cgi?id=170763
1138         <rdar://problem/31573091>
1139
1140         Reviewed by Alex Christensen.
1141
1142         * UIProcess/WebProcessProxy.cpp:
1143         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1144             Move semantics for topPrivatelyControlledDomains vector.
1145         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores): Deleted.
1146             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
1147         * UIProcess/WebProcessProxy.h:
1148         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1149         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1150             Move semantics for prevalentResourceDomains vector.
1151         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1152         (WebKit::hostIsInDomain):
1153             Static convenience function.
1154         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain):
1155             Checks for matching cookieHostNames if types contains WebsiteDataType::Cookies.
1156             Also checks origins.
1157         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1158         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1159         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
1160             Now makes use of the new function
1161             WebKit::WebsiteDataRecord::validForTopPrivatelyControlledDomain().
1162         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains):
1163             Move semantics for topPrivatelyControlledDomains vector.
1164         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains): Deleted.
1165             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
1166         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains): Deleted.
1167             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
1168         * UIProcess/WebsiteData/WebsiteDataStore.h:
1169
1170 2017-04-18  Brent Fulgham  <bfulgham@apple.com>
1171
1172         [iOS][WK2] Prevent ephemeral files from being backed up
1173         https://bugs.webkit.org/show_bug.cgi?id=170963
1174         <rdar://problem/30470332>
1175
1176         Reviewed by Brady Eidson.
1177
1178         Tell the OS to skip temporary data files when performing backups.
1179
1180         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: Added.
1181         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Added.
1182         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1183         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1184         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Add stub for
1185         non-iOS platforms.
1186         * UIProcess/WebResourceLoadStatisticsStore.h:
1187         * WebKit2.xcodeproj/project.pbxproj: Add new file.
1188
1189 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1190
1191         [WK2] Cannot select text on nytimes.com when the selection granularity is WKSelectionGranularityCharacter
1192         https://bugs.webkit.org/show_bug.cgi?id=170968
1193         <rdar://problem/31692560>
1194
1195         Reviewed by Dan Bernstein.
1196
1197         Makes a small adjustment to textInteractionGesture:shouldBeginAtPoint:. When determining whether to allow the
1198         text interaction assistant to recognize at a given point, instead of depending on whether or not the hit node is
1199         the same as the assisted node, only enforce this restriction when editing an assisted node. Otherwise, default
1200         to allowing the selection gesture.
1201
1202         Note that character granularity selection was working on most pages before, due to the fact that
1203         nodeAtPositionIsAssistedNode was true in many cases when there is no assisted node at all. This is because, in
1204         WebPage.mm, we compute the hit-tested node responding to click events to be null, and then set
1205         nodeAtPositionIsAssistedNode to be equal to hitNode == m_assistedNode, which ends up being true because both of
1206         these values are null.
1207
1208         This allowed text selection to work in the simple case when selection granularity character is used, but not
1209         when the node containing the selected point actually does respond to click events, since the comparison returns
1210         false.
1211
1212         New layout test: LayoutTests/editing/selection/character-granularity-select-text-with-click-handler.html.
1213
1214         * UIProcess/ios/WKContentViewInteraction.mm:
1215         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1216
1217 2017-04-18  Keith Rollin  <krollin@apple.com>
1218
1219         Add additional information when logging URL disposition in WebLoaderStrategy::scheduleLoad
1220         https://bugs.webkit.org/show_bug.cgi?id=170813
1221
1222         Reviewed by Alex Christensen.
1223
1224         There are a few logging statements in WebLoaderStrategy::scheduleLoad
1225         that report, for example, "URL will be loaded as data". These
1226         statements also log the address of the frame doing the loading and the
1227         identifier of the resource. For consistency with other logging and to
1228         make scripted analysis of the logs more robust, also include the
1229         pageID and frameID in the logging.
1230
1231         * WebProcess/Network/WebLoaderStrategy.cpp:
1232         (WebKit::WebLoaderStrategy::scheduleLoad):
1233
1234 2017-04-18  Anders Carlsson  <andersca@apple.com>
1235
1236         Stop using deprecated APIs, part 2
1237         https://bugs.webkit.org/show_bug.cgi?id=170965
1238
1239         Reviewed by Tim Horton.
1240
1241         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1242         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode):
1243         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
1244         Remove the status member variable.
1245
1246         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1247         (WebKit::status):
1248         New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate.
1249
1250         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
1251         Stop using the deprecated API.
1252
1253 2017-04-18  Timothy Horton  <timothy_horton@apple.com>
1254
1255         Force scroll view insets to be respected regardless of rubber-banding state
1256         https://bugs.webkit.org/show_bug.cgi?id=170937
1257         <rdar://problem/31412788>
1258
1259         Reviewed by Simon Fraser.
1260
1261         * Platform/spi/ios/UIKitSPI.h:
1262         * UIProcess/API/Cocoa/WKWebView.mm:
1263         (-[WKWebView _initializeWithConfiguration:]):
1264
1265 2017-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1266
1267         [GLIB] Define priorities also for async network IO tasks
1268         https://bugs.webkit.org/show_bug.cgi?id=170905
1269
1270         Reviewed by Žan Doberšek.
1271
1272         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1273         (WebKit::NetworkCache::inputStreamReadReadyCallback):
1274         (WebKit::NetworkCache::IOChannel::read):
1275         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
1276         (WebKit::NetworkCache::IOChannel::write):
1277         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1278         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
1279         (WebKit::NetworkDataTaskSoup::read):
1280         (WebKit::NetworkDataTaskSoup::requestNextPart):
1281         (WebKit::NetworkDataTaskSoup::writeDownload):
1282         (WebKit::NetworkDataTaskSoup::didFinishDownload):
1283         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1284         (webkitURISchemeRequestReadCallback):
1285         (webkit_uri_scheme_request_finish):
1286
1287 2017-04-17  Timothy Horton  <timothy_horton@apple.com>
1288
1289         Plumb all four obscured insets to WebCore, instead of just top/left
1290         https://bugs.webkit.org/show_bug.cgi?id=170913
1291
1292         Reviewed by Wenson Hsieh.
1293
1294         * Shared/VisibleContentRectUpdateInfo.cpp:
1295         (WebKit::VisibleContentRectUpdateInfo::encode):
1296         (WebKit::VisibleContentRectUpdateInfo::decode):
1297         (WebKit::operator<<):
1298         * Shared/VisibleContentRectUpdateInfo.h:
1299         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1300         (WebKit::VisibleContentRectUpdateInfo::obscuredInsets):
1301         (WebKit::operator==):
1302         (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted.
1303         * Shared/WebCoreArgumentCoders.cpp:
1304         (IPC::ArgumentCoder<FloatRectInsets>::encode):
1305         (IPC::ArgumentCoder<FloatRectInsets>::decode):
1306         * Shared/WebCoreArgumentCoders.h:
1307         * UIProcess/API/Cocoa/WKWebView.mm:
1308         (-[WKWebView _didCommitLayerTree:]):
1309         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
1310         (-[WKWebView _updateVisibleContentRects]):
1311         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1312         * UIProcess/PageClient.h:
1313         * UIProcess/WebPageProxy.cpp:
1314         * UIProcess/WebPageProxy.h:
1315         * UIProcess/WebPageProxy.messages.in:
1316         * UIProcess/ios/PageClientImplIOS.h:
1317         * UIProcess/ios/PageClientImplIOS.mm:
1318         (WebKit::PageClientImpl::restorePageState):
1319         * UIProcess/ios/WKContentView.h:
1320         * UIProcess/ios/WKContentView.mm:
1321         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1322         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
1323         * UIProcess/ios/WebPageProxyIOS.mm:
1324         (WebKit::WebPageProxy::restorePageState):
1325         * WebProcess/WebPage/ios/WebPageIOS.mm:
1326         (WebKit::WebPage::restorePageState):
1327         (WebKit::WebPage::updateVisibleContentRects):
1328         Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization).
1329
1330 2017-04-17  Joseph Pecoraro  <pecoraro@apple.com>
1331
1332         Web Inspector: Doesn't show size of compressed content correctly
1333         https://bugs.webkit.org/show_bug.cgi?id=155112
1334         <rdar://problem/25006728>
1335
1336         Reviewed by Alex Christensen and Timothy Hatcher.
1337
1338         * NetworkProcess/NetworkResourceLoader.cpp:
1339         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1340         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1341         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1342         Include size information in network load metrics.
1343
1344 2017-04-17  Youenn Fablet  <youenn@apple.com>
1345
1346         com.apple.WebKit.Networking.Development crashed in com.apple.WebKit: WebKit::NetworkRTCProvider::resolvedName
1347         https://bugs.webkit.org/show_bug.cgi?id=170889
1348
1349         Reviewed by Alex Christensen.
1350
1351         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1352         (WebKit::NetworkRTCProvider::Resolver::~Resolver): Unschedule the host resolution in addition to cancelling it.
1353         Providing a test would need to stop the resolver between the time the resolver is created and gets
1354         data in the network process. Or we would need to change Resolver to be instantiated/tested on its own.
1355         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1356
1357 2017-04-17  Brady Eidson  <beidson@apple.com>
1358
1359         Make WKHTTPCookieStore public.
1360         <rdar://problem/31024691> and https://bugs.webkit.org/show_bug.cgi?id=170920
1361
1362         Reviewed by Geoffrey Garen.
1363
1364         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
1365         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1366         (-[WKHTTPCookieStore getAllCookies:]):
1367         (-[WKHTTPCookieStore allCookies:]): Deleted.
1368
1369         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1370         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1371         (-[WKWebsiteDataStore httpCookieStore]):
1372         (-[WKWebsiteDataStore _httpCookieStore]): Deleted.
1373         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1374
1375         * WebKit2.xcodeproj/project.pbxproj:
1376
1377 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
1378
1379         [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange
1380         https://bugs.webkit.org/show_bug.cgi?id=170911
1381
1382         Reviewed by Youenn Fablet.
1383
1384         * UIProcess/Cocoa/UIDelegate.mm:
1385         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): Fix typo.
1386
1387 2017-04-17  Keith Rollin  <krollin@apple.com>
1388
1389         Move and update WebLoaderStrategy logging statement
1390         https://bugs.webkit.org/show_bug.cgi?id=170140
1391
1392         Reviewed by Alex Christensen.
1393
1394         WebLoaderStrategy::scheduleLoad has a logging statement that says, in
1395         part: "Resource has been queued for scheduling with the
1396         NetworkProcess". This statement is emitted after the
1397         ScheduleResourceLoad message has been successfully sent to the
1398         NetworkProcess. The logging statement was added at this location to
1399         indicate that the resource-load had been successfully handed off; it
1400         pairs a similar logging statement that is emitted if the sending of
1401         the ScheduleResourceLoad message fails.
1402
1403         I think it would be better to move this logging statement before the
1404         ScheduleResourceLoad message is sent to the NetworkProcess (and change
1405         its wording to "Resource is being scheduled with the NetworkProcess").
1406         The reason for this change is to help make sure that the sequence of
1407         logging statements is more deterministic. In the current form, the
1408         message "Resource has been queued for scheduling with the
1409         NetworkProcess" normally appears before any NetworkProcess logging
1410         statements that indicate that the resource-loading is continuing
1411         there, but in rare occasions the logging statements can be reversed.
1412         This change in the ordering of the statements has caused a problem in
1413         a script I've written that examines the resource-loading process and
1414         looks for errors. By ensuring that the WebLoaderStrategy statement
1415         always appears before the NetworkResourceLoader statement, the flow
1416         makes better sense and the script can be more robust.
1417
1418         In making this change, we are probably not giving up any assurance
1419         that the ScheduleResourceLoad message has been sent to the
1420         NetworkResourceLoader. If the message is successfully sent, we'll see
1421         logging in the NetworkProcess. If the message has not been sent, we'll
1422         see WebLoaderStrategy logging an error.
1423
1424         * WebProcess/Network/WebLoaderStrategy.cpp:
1425         (WebKit::WebLoaderStrategy::scheduleLoad):
1426
1427 2017-04-17  Anders Carlsson  <andersca@apple.com>
1428
1429         Stop using deprecated APIs, part 1
1430         https://bugs.webkit.org/show_bug.cgi?id=170915
1431         rdar://problem/31589635
1432
1433         Reviewed by Tim Horton.
1434
1435         Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated
1436         and we always passed PKPaymentAuthorizationStatusSuccess anyway.
1437
1438         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1439         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
1440         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
1441         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1442         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
1443
1444 2017-04-17  Youenn Fablet  <youenn@apple.com>
1445
1446         Disable outdated WritableStream API
1447         https://bugs.webkit.org/show_bug.cgi?id=170749
1448         <rdar://problem/31446233>
1449
1450         Reviewed by Alex Christensen.
1451
1452         Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by:
1453         - A STREAMS_API compilation flag.
1454         - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT.
1455
1456         * Configurations/FeatureDefines.xcconfig:
1457         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1458         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1459
1460 2017-04-17  Tim Horton  <timothy_horton@apple.com>
1461
1462         Provide a viewport parameter to disable clipping to the safe area
1463         https://bugs.webkit.org/show_bug.cgi?id=170766
1464         <rdar://problem/31564634>
1465
1466         Reviewed by Beth Dakin.
1467
1468         * UIProcess/WebPageProxy.cpp:
1469         (WebKit::WebPageProxy::resetState):
1470         (WebKit::WebPageProxy::setClipToSafeArea):
1471         * UIProcess/WebPageProxy.h:
1472         (WebKit::WebPageProxy::clipToSafeArea):
1473         * UIProcess/WebPageProxy.messages.in:
1474         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1475         (WebKit::WebChromeClient::didChangeClipToSafeArea):
1476         * WebProcess/WebCoreSupport/WebChromeClient.h:
1477         * UIProcess/API/gtk/PageClientImpl.h:
1478         * UIProcess/PageClient.h:
1479         * UIProcess/ios/PageClientImplIOS.h:
1480         * UIProcess/ios/PageClientImplIOS.mm:
1481         (WebKit::PageClientImpl::didChangeClipToSafeArea):
1482         * UIProcess/mac/PageClientImpl.h:
1483         Forward clip-to-safe-area changes from ChromeClient to WKWebView.
1484         Update visible content rects when it changes, which will
1485         result in a call to updateFixedClippingView, as below.
1486         Keep track of the current state in the UI process.
1487
1488         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1489         * UIProcess/API/Cocoa/WKWebView.mm:
1490         (-[WKWebView _contentMayDrawInObscuredInsets]):
1491         Expose the current state of the clip-to-safe-area bit as SPI.
1492
1493         * UIProcess/ios/WKContentView.mm:
1494         (-[WKContentView updateFixedClippingView:]):
1495         Disable fixed clipping when clip-to-safe-area is disabled.
1496         
1497         * WebProcess/WebPage/ios/WebPageIOS.mm:
1498         (WebKit::WebPage::viewportConfigurationChanged):
1499         Push the viewport's clip-to-safe-area bit onto the main frame's FrameView.
1500
1501 2017-04-17  Dan Bernstein  <mitz@apple.com>
1502
1503         [Cocoa] Move isNullFunctionPointer down into WTF
1504         https://bugs.webkit.org/show_bug.cgi?id=170892
1505
1506         Reviewed by Sam Weinig.
1507
1508         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
1509         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Changed to use
1510           WTF::isNullFunctionPointer.
1511         (WebKit::isNullFunctionPointer): Deleted.
1512
1513 2017-04-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1514
1515         [WK2] Respect a new internal setting for defaulting to character selection granularity
1516         https://bugs.webkit.org/show_bug.cgi?id=170904
1517         <rdar://problem/31364280>
1518
1519         Reviewed by Dan Bernstein.
1520
1521         Respect a new WebKitDebugDefaultSelectionGranularityCharacter user default by initializing
1522         WKWebViewConfiguration with WKSelectionGranularityCharacter, but only when linked on or after the first iOS to
1523         use WKSelectionGranularityCharacter by default.
1524
1525         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1526         (-[WKWebViewConfiguration init]):
1527         * UIProcess/Cocoa/VersionChecks.h:
1528
1529 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
1530
1531         Provide a way for clients to unmute a media stream.
1532         https://bugs.webkit.org/show_bug.cgi?id=170855
1533         <rdar://problem/31656855>
1534
1535         Reviewed by Jon Lee.
1536
1537         * UIProcess/API/Cocoa/WKWebView.mm:
1538         (-[WKWebView _setPageMuted:]): New.
1539         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1540
1541 2017-04-17  Jeremy Jones  <jeremyj@apple.com>
1542
1543         Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video.
1544         https://bugs.webkit.org/show_bug.cgi?id=170778
1545
1546         Reviewed by Tim Horton.
1547
1548         setUseAVFoundationAudioCapture is moved from AVCaptureDeviceManager to RealtimeMediaSourceCenterMac.
1549
1550         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1551         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
1552
1553 2017-04-15  Keith Rollin  <krollin@apple.com>
1554
1555         Include resource size in some existing logging
1556         https://bugs.webkit.org/show_bug.cgi?id=170866
1557
1558         Reviewed by Alex Christensen.
1559
1560         In order to correlate resource load times with resource size, we log
1561         when the resource is starting to be loaded and when the resource is
1562         finished loading. In NetworkResourceLoader::didReceiveResponse, we
1563         also log the expected resource length. However, we can only log the
1564         length if it is provided in Content-Length, which is not always the
1565         case. If it's not provided, we end up logging "length = -1". To make
1566         up for this, change NetworkResourceLoader::didFinishLoading and
1567         WebResourceLoader:: didFinishLoading to log the length once we know
1568         it.
1569
1570         * NetworkProcess/NetworkResourceLoader.cpp:
1571         (WebKit::NetworkResourceLoader::didReceiveBuffer):
1572         (WebKit::NetworkResourceLoader::didFinishLoading):
1573         * NetworkProcess/NetworkResourceLoader.h:
1574         * WebProcess/Network/WebResourceLoader.cpp:
1575         (WebKit::WebResourceLoader::didReceiveData):
1576         (WebKit::WebResourceLoader::didFinishResourceLoad):
1577         * WebProcess/Network/WebResourceLoader.h:
1578
1579 2017-04-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1580
1581         [WK2] Support data interaction of files into file inputs
1582         https://bugs.webkit.org/show_bug.cgi?id=170803
1583         <rdar://problem/31286130>
1584
1585         Reviewed by Tim Horton.
1586
1587         Implements remaining support for performing data interaction onto file inputs. There are two main changes at
1588         this layer: plumbing the number of files in the pasteboard to the web process, and pulling the implementation of
1589         createSandboxExtensionsIfNeeded out of Mac-specific WebViewImpl::createSandboxExtensionsIfNeeded and into
1590         WebPageProxy::createSandboxExtensionsIfNeeded.
1591
1592         * Shared/WebCoreArgumentCoders.cpp:
1593         (IPC::ArgumentCoder<DragData>::encode):
1594         (IPC::ArgumentCoder<DragData>::decode):
1595
1596         Relax special-casing of encoding and decoding filenames to be PLATFORM(COCOA) rather than PLATFORM(MAC).
1597
1598         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1599         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
1600         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1601         (WebKit::WebPasteboardProxy::getNumberOfFiles):
1602
1603         More boilerplate plumbing to deliver the number of files in the pasteboard to the web process.
1604
1605         * UIProcess/Cocoa/WebViewImpl.h:
1606         * UIProcess/Cocoa/WebViewImpl.mm:
1607         (WebKit::WebViewImpl::performDragOperation):
1608         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): Deleted.
1609
1610         Move the logic in WebViewImpl::createSandboxExtensionsIfNeeded over to WebPageProxy::createSandboxExtensionsIfNeeded.
1611
1612         * UIProcess/WebPageProxy.h:
1613         * UIProcess/WebPasteboardProxy.h:
1614         * UIProcess/WebPasteboardProxy.messages.in:
1615         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1616         (WebKit::WebPlatformStrategies::getNumberOfFiles):
1617         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1618
1619 2017-04-14  Mark Lam  <mark.lam@apple.com>
1620
1621         Update architectures in xcconfig files.
1622         https://bugs.webkit.org/show_bug.cgi?id=170867
1623         <rdar://problem/31628104>
1624
1625         Reviewed by Joseph Pecoraro.
1626
1627         * Configurations/FeatureDefines.xcconfig:
1628
1629 2017-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1630
1631         [WK2] Support Icon creation from file URLs on iOS
1632         https://bugs.webkit.org/show_bug.cgi?id=170809
1633         <rdar://problem/31286130>
1634
1635         Reviewed by Tim Horton.
1636
1637         Refactors file icon generation logic to support showing an Icon representing the content at a list of file paths
1638         on iOS. Pulls out logic in WKFileUploadPanel responsible for generating the thumbnail image for a file input into
1639         separate helpers in WebIconUtilities, and then uses these utilities in both WKFileUploadPanel and
1640         WebChromeClientIOS.
1641
1642         * Shared/ios/WebIconUtilities.h: Added.
1643         * Shared/ios/WebIconUtilities.mm: Added.
1644         (WebKit::squareCropRectForSize):
1645         (WebKit::squareImage):
1646         (WebKit::thumbnailSizedImageForImage):
1647         (WebKit::fallbackIconForFile):
1648         (WebKit::iconForImageFile):
1649         (WebKit::iconForVideoFile):
1650         (WebKit::iconForFile):
1651
1652         Add logic for generating thumbnail icons, moved from WKFileUploadPanel.mm.
1653
1654         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1655         (squareCropRectForSize): Deleted.
1656         (squareImage): Deleted.
1657         (thumbnailSizedImageForImage): Deleted.
1658         (fallbackIconForFile): Deleted.
1659         (iconForImageFile): Deleted.
1660         (iconForVideoFile): Deleted.
1661         (iconForFile): Deleted.
1662
1663         Remove logic for generating thumbnail icons.
1664
1665         * WebKit2.xcodeproj/project.pbxproj:
1666         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1667         (WebKit::WebChromeClient::loadIconForFiles):
1668         (WebKit::WebChromeClient::createIconForFiles):
1669
1670         Rather than call Icon::createIconForFiles directly, loadIconForFiles now consults ChromeClient::createIconForFiles
1671         instead. On other platforms, this just turns around and calls Icon::createIconForFiles, but on iOS, we use the
1672         utilities introduced in WebIconUtilities to generate a file icon.
1673
1674         * WebProcess/WebCoreSupport/WebChromeClient.h:
1675         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1676         (WebKit::WebChromeClient::createIconForFiles):
1677
1678 2017-04-14  Brady Eidson  <beidson@apple.com>
1679
1680         Fix basic WKURLSchemeHandler bugs.
1681         <rdar://problem/30647559> and https://bugs.webkit.org/show_bug.cgi?id=170862
1682
1683         Reviewed by Andy Estes.
1684
1685         * UIProcess/Cocoa/NavigationState.mm:
1686         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1687
1688         * UIProcess/WebURLSchemeHandlerTask.cpp:
1689         (WebKit::WebURLSchemeHandlerTask::didReceiveResponse):
1690
1691         * WebProcess/Network/WebLoaderStrategy.cpp:
1692         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy):
1693         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy):
1694         (WebKit::WebLoaderStrategy::remove):
1695         * WebProcess/Network/WebLoaderStrategy.h:
1696
1697         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
1698         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
1699         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
1700         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
1701         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
1702
1703         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp:
1704         (WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy):
1705         (WebKit::WebURLSchemeHandlerTaskProxy::stopLoading):
1706         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse):
1707         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData):
1708         (WebKit::WebURLSchemeHandlerTaskProxy::didComplete):
1709         (WebKit::WebURLSchemeHandlerTaskProxy::hasLoader):
1710         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h:
1711         (WebKit::WebURLSchemeHandlerTaskProxy::identifier):
1712
1713 2017-04-14  Jer Noble  <jer.noble@apple.com>
1714
1715         [MediaSource] Push capabilities across process boundary during UIProcess capture.
1716         https://bugs.webkit.org/show_bug.cgi?id=170814
1717
1718         Reviewed by Eric Carlson.
1719
1720         Make a new synchronous getter for capabilities(), moderated by only requesting the capabilities() cross-process
1721         the first time called.
1722
1723         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1724         (WebKit::UserMediaCaptureManagerProxy::capabilities):
1725         (WebKit::UserMediaCaptureManagerProxy::supportedConstraints):
1726         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1727         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1728         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1729         (WebKit::UserMediaCaptureManager::Source::setCapabilities):
1730         (WebKit::UserMediaCaptureManager::capabilities):
1731         * WebProcess/cocoa/UserMediaCaptureManager.h:
1732
1733 2017-04-13  Dan Bernstein  <mitz@apple.com>
1734
1735         [Cocoa] Allow clients to specify in _WKProcessPoolConfiguration additional directory sandbox extensions
1736         https://bugs.webkit.org/show_bug.cgi?id=170387
1737
1738         Reviewed by Sam Weinig.
1739
1740         Test: TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm
1741
1742         Added an additionalReadAccessAllowedURLs property to _WKProcessPoolConfiguration.
1743
1744         * Shared/WebProcessCreationParameters.cpp:
1745         (WebKit::WebProcessCreationParameters::encode): Encode the new
1746           additionalSandboxExtensionHandles member.
1747         (WebKit::WebProcessCreationParameters::decode): Decode it.
1748         * Shared/WebProcessCreationParameters.h: Added additionalSandboxExtensionHandles member.
1749
1750         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1751         (API::ProcessPoolConfiguration::copy): Copy new m_additionalReadAccessAllowedPaths member.
1752         * UIProcess/API/APIProcessPoolConfiguration.h: Added m_additionalReadAccessAllowedPaths
1753           member and accessor functions.
1754
1755         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declared new
1756           additionalReadAccessAllowedURLs property whose value is an array of URLs to which the Web
1757           Content process will be given read access.
1758         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1759         (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): New getter that returns
1760           an array of file URLs from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths().
1761         (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): New setter that checks
1762           that the given URLs are file URLs and populates the ProcessPoolConfiguration’s
1763           additionalReadAccessAllowedPaths with their paths.
1764
1765         * UIProcess/WebProcessPool.cpp:
1766         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Populate the new
1767           m_resolvedPaths.additionalWebProcessSandboxExtensionPaths with resolved paths from the
1768           ProcessPoolConfiguration’s additionalReadAccessAllowedPaths.
1769         (WebKit::WebProcessPool::createNewWebProcess): Populate the WebProcessCreationParameters’s
1770           additionalSandboxExtensionHandles member with read-only sandbox extensions created from
1771           the resolved paths.
1772         * UIProcess/WebProcessPool.h: Added additionalWebProcessSandboxExtensionPaths member to
1773           the Paths struct.
1774
1775         * WebProcess/WebProcess.cpp:
1776         (WebKit::WebProcess::initializeWebProcess): Consume the additional sandbox extensions.
1777
1778 2017-04-13  Alex Christensen  <achristensen@webkit.org>
1779
1780         Fix CMake build
1781         https://bugs.webkit.org/show_bug.cgi?id=170815
1782
1783         Reviewed by Beth Dakin.
1784
1785         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1786         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
1787
1788 2017-04-12  Dan Bernstein  <mitz@apple.com>
1789
1790         [Mac] Future-proof .xcconfig files
1791         https://bugs.webkit.org/show_bug.cgi?id=170802
1792
1793         Reviewed by Tim Horton.
1794
1795         * Configurations/Base.xcconfig:
1796         * Configurations/DebugRelease.xcconfig:
1797         * Configurations/FeatureDefines.xcconfig:
1798         * Configurations/Version.xcconfig:
1799
1800 2017-04-12  Brady Eidson  <beidson@apple.com>
1801
1802         QuotaExceededError when saving to localStorage in private mode.
1803         https://bugs.webkit.org/show_bug.cgi?id=157010
1804
1805         Reviewed by Alex Christensen.
1806
1807         * WebProcess/Storage/StorageAreaMap.cpp:
1808         (WebKit::StorageAreaMap::StorageAreaMap):
1809         (WebKit::StorageAreaMap::~StorageAreaMap):
1810
1811         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1812         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
1813         (WebKit::StorageNamespaceImpl::storageArea):
1814         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
1815         (WebKit::StorageNamespaceImpl::copy):
1816         * WebProcess/Storage/StorageNamespaceImpl.h:
1817
1818         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
1819         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
1820         * WebProcess/Storage/WebStorageNamespaceProvider.h:
1821
1822 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1823
1824         Unreviewed, fix build failure on Ubuntu LTS GTK bot
1825         https://bugs.webkit.org/show_bug.cgi?id=170781
1826
1827         * UIProcess/WebProcessPool.cpp:
1828         (WebKit::WebProcessPool::createNewWebProcess):
1829
1830 2017-04-12  Eric Carlson  <eric.carlson@apple.com>
1831
1832         [MediaStream] rename -[WKWebView _stopMediaCapture]
1833         https://bugs.webkit.org/show_bug.cgi?id=170791
1834         <rdar://problem/31589204>
1835
1836         Reviewed by Youenn Fablet.
1837
1838         * UIProcess/API/Cocoa/WKWebView.mm:
1839         (-[WKWebView _muteMediaCapture]):
1840         (-[WKWebView _stopMediaCapture]): Deleted.
1841         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1842
1843 2017-04-12  Ryan Haddad  <ryanhaddad@apple.com>
1844
1845         Unreviewed build fix.
1846
1847         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1848         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
1849         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
1850         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
1851         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
1852         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
1853         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
1854
1855 2017-04-12  Jer Noble  <jer.noble@apple.com>
1856
1857         [WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options.
1858         https://bugs.webkit.org/show_bug.cgi?id=170790
1859
1860         Reviewed by Alex Christensen.
1861
1862         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1863         (WKContextConfigurationCreate):
1864         (WKContextConfigurationCreateWithLegacyOptions):
1865         * UIProcess/API/C/WKContextConfigurationRef.h:
1866
1867 2017-04-12  Jer Noble  <jer.noble@apple.com>
1868
1869         [WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess.
1870         https://bugs.webkit.org/show_bug.cgi?id=170781
1871
1872         Reviewed by Alex Christensen.
1873
1874         Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through
1875         _WKProcessPoolConfiguration.
1876
1877         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1878         (API::ProcessPoolConfiguration::copy):
1879         * UIProcess/API/APIProcessPoolConfiguration.h:
1880         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1881         (WKContextConfigurationShouldCaptureAudioInUIProcess):
1882         (WKContextConfigurationSetShouldCaptureAudioInUIProcess):
1883         * UIProcess/API/C/WKContextConfigurationRef.h:
1884         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1885         (-[WKWebViewConfiguration copyWithZone:]):
1886         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]):
1887         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
1888         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1889         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1890         (-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]):
1891         (-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]):
1892         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1893         (WebKit::WebProcessPool::platformInitializeWebProcess):
1894         * UIProcess/WebProcessPool.cpp:
1895         (WebKit::WebProcessPool::createNewWebProcess):
1896
1897 2017-04-12  Keith Rollin  <krollin@apple.com>
1898
1899         Add some missing NetworkResourceLoader logging
1900         https://bugs.webkit.org/show_bug.cgi?id=170139
1901
1902         Reviewed by Alex Christensen.
1903
1904         Once execution enters the lambda in
1905         NetworkResourceLoader::retrieveCacheEntry, there is little indication
1906         of which exit point was taken. If flow enters into startNetworkLoad,
1907         we'll get some logging from that function, but not from the others.
1908         Add some logging so that we know what the result was from looking up
1909         the resource in the cache.
1910
1911         * NetworkProcess/NetworkResourceLoader.cpp:
1912         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1913
1914 2017-04-12  Anders Carlsson  <andersca@apple.com>
1915
1916         Tweak WebCore::setMetadataURL function
1917         https://bugs.webkit.org/show_bug.cgi?id=170786
1918
1919         Reviewed by Beth Dakin.
1920
1921         Update for WebCore changes.
1922
1923         * UIProcess/Cocoa/WebViewImpl.mm:
1924         (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination):
1925
1926 2017-04-12  Brent Fulgham  <bfulgham@apple.com>
1927
1928         [WK2][Mac] Stop allowing access to disk arbitration process
1929         https://bugs.webkit.org/show_bug.cgi?id=170517
1930         <rdar://problem/31071151>
1931
1932         Reviewed by Alex Christensen.
1933
1934         * WebProcess/com.apple.WebProcess.sb.in:
1935
1936 2017-04-12  Beth Dakin  <bdakin@apple.com>
1937
1938         32-bit build fix.
1939
1940         * UIProcess/API/mac/WKView.mm:
1941         (-[WKView _mediaPlaybackControlsView]):
1942
1943 2017-04-12  Beth Dakin  <bdakin@apple.com>
1944
1945         More 32-bit build fix.
1946
1947         * UIProcess/API/Cocoa/WKWebView.mm:
1948         (-[WKWebView _mediaPlaybackControlsView]):
1949         (-[WKWebView _addMediaPlaybackControlsView:]):
1950         * UIProcess/API/mac/WKView.mm:
1951         (-[WKView _mediaPlaybackControlsView]):
1952         (-[WKView _addMediaPlaybackControlsView:]):
1953
1954 2017-04-12  Beth Dakin  <bdakin@apple.com>
1955
1956         Another 32 bit build fix.
1957
1958         * UIProcess/Cocoa/WebViewImpl.h:
1959         * UIProcess/Cocoa/WebViewImpl.mm:
1960         (WebKit::WebViewImpl::mediaPlaybackControlsView):
1961
1962 2017-04-12  Alex Christensen  <achristensen@webkit.org>
1963
1964         Stop using didReceiveDataArray callback on El Capitan
1965         https://bugs.webkit.org/show_bug.cgi?id=170780
1966
1967         Reviewed by Brady Eidson.
1968
1969         * NetworkProcess/NetworkLoad.cpp:
1970         (WebKit::NetworkLoad::supportsDataArray): Deleted.
1971         (WebKit::NetworkLoad::didReceiveDataArray): Deleted.
1972         * NetworkProcess/NetworkLoad.h:
1973
1974 2017-04-12  Beth Dakin  <bdakin@apple.com>
1975
1976         Speculative build fix.
1977
1978         * UIProcess/API/Cocoa/WKViewPrivate.h:
1979
1980 2017-04-12  Beth Dakin  <bdakin@apple.com>
1981
1982         Attempted build fix.
1983
1984         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1985
1986 2017-04-12  Beth Dakin  <bdakin@apple.com>
1987
1988         Adopt AVKit name change from AVFunctionBar* to AVTouchBar*
1989         https://bugs.webkit.org/show_bug.cgi?id=170693
1990         -and corresponding-
1991         rdar://problem/31230018
1992
1993         Reviewed by Sam Weinig.
1994
1995         Since the new names only apply to some versions of macOS, this patch uses typedefs 
1996         for the older OS’s. SO:
1997
1998         AVFunctionBarScrubber is now AVTouchBarScrubber
1999
2000         AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider
2001
2002         AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption
2003
2004         And the protocol AVFunctionBarPlaybackControlsControlling is now 
2005         AVTouchBarPlaybackControlsControlling
2006
2007         Use the new name.
2008         * UIProcess/API/Cocoa/WKViewPrivate.h:
2009         * UIProcess/API/Cocoa/WKWebView.mm:
2010         (-[WKWebView _mediaPlaybackControlsView]):
2011         (-[WKWebView _addMediaPlaybackControlsView:]):
2012         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2013         * UIProcess/API/mac/WKView.mm:
2014         (-[WKView _mediaPlaybackControlsView]):
2015         (-[WKView _addMediaPlaybackControlsView:]):
2016         * UIProcess/Cocoa/WebViewImpl.h:
2017
2018         Soft links and allocations cannot use the typedefs.
2019         * UIProcess/Cocoa/WebViewImpl.mm:
2020         (WebKit::WebViewImpl::mediaPlaybackControlsView):
2021         (WebKit::WebViewImpl::updateMediaTouchBar):
2022
2023 2017-04-12  Eric Carlson  <eric.carlson@apple.com>
2024
2025         [MediaStream] Audio source in UI process not identified as capture source
2026         https://bugs.webkit.org/show_bug.cgi?id=170776
2027
2028         Reviewed by Youenn Fablet.
2029
2030         * WebProcess/cocoa/UserMediaCaptureManager.cpp: Override isCaptureSource.
2031
2032 2017-04-12  Andrew Gold  <agold@apple.com>
2033
2034         Allow iOS to toggle webRTCAPI legacy flag.
2035         https://bugs.webkit.org/show_bug.cgi?id=170735
2036
2037         Reviewed by Eric Carlson.
2038
2039         * UIProcess/API/Cocoa/WKPreferences.mm:
2040         (-[WKPreferences _webRTCLegacyAPIEnabled]):
2041         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
2042         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2043
2044 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2045
2046         Unreviewed, build fix for GTK port after r215262
2047         https://bugs.webkit.org/show_bug.cgi?id=170758
2048
2049         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2050         (WebKit::NetworkDataTaskSoup::didRead):
2051
2052 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2053
2054         [WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading implementation semantics to Pthread one
2055         https://bugs.webkit.org/show_bug.cgi?id=170502
2056
2057         Reviewed by Mark Lam.
2058
2059         Mechanical change. Use Thread:: APIs.
2060
2061         * NetworkProcess/NetworkProcess.cpp:
2062         (WebKit::NetworkProcess::initializeNetworkProcess):
2063         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2064         (WebKit::NetworkCache::IOChannel::readSyncInThread):
2065         * Platform/IPC/Connection.cpp:
2066         (IPC::Connection::processIncomingMessage):
2067         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2068         (WebKit::XPCServiceInitializer):
2069         * UIProcess/linux/MemoryPressureMonitor.cpp:
2070         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
2071         * WebProcess/WebProcess.cpp:
2072         (WebKit::WebProcess::initializeWebProcess):
2073
2074 2017-04-10  Antti Koivisto  <antti@apple.com>
2075
2076         Cache small media resources in disk cache
2077         https://bugs.webkit.org/show_bug.cgi?id=170676
2078         <rdar://problem/31532649>
2079
2080         Reviewed by Andreas Kling.
2081
2082         * NetworkProcess/cache/NetworkCache.cpp:
2083         (WebKit::NetworkCache::makeRetrieveDecision):
2084
2085             Allow retrieving media resources.
2086
2087         (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange):
2088         (WebKit::NetworkCache::expectedTotalResourceSize):
2089         (WebKit::NetworkCache::makeStoreDecision):
2090
2091             Store media resource if we can figure out its total size and it is less than 5MB
2092             (and it is cacheable by the usual rules).
2093
2094 2017-04-12  Alex Christensen  <achristensen@webkit.org>
2095
2096         Modernize vector adoption
2097         https://bugs.webkit.org/show_bug.cgi?id=170758
2098
2099         Reviewed by Geoffrey Garen.
2100
2101         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
2102         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
2103         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2104         (WebKit::WebPlatformStrategies::bufferForType):
2105
2106 2017-04-12  Zan Dobersek  <zdobersek@igalia.com>
2107
2108         Unreviewed GTK+ debug build fix. Drop an unused debug-only member
2109         variable in the CompositingRunLoop class.
2110
2111         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2112
2113 2017-04-11  Zan Dobersek  <zdobersek@igalia.com>
2114
2115         [GTK] Use the DisplayRefreshMonitor facilities
2116         https://bugs.webkit.org/show_bug.cgi?id=170599
2117
2118         Reviewed by Carlos Garcia Campos.
2119
2120         ThreadedCompositor gains a DisplayRefreshMonitor member that it can use
2121         to better coordinate display refresh callbacks on the main thread. Still,
2122         because currently the GTK+ port doesn't have a reliable way of notifying
2123         the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used
2124         in order to keep the updates at a reasonable rate. When the timer is fired,
2125         the ThreadedCompositor decides how to proceed based on state changes that
2126         might have occurred during composition or whether there's any display
2127         refresh callbacks that require handling on the main thread.
2128
2129         CompositingRunLoop now stores its state in an atomic variable that's then
2130         inspected whenever a new update is scheduled or completed. When scheduled,
2131         if there's no update in progress, a new update is requested through the
2132         timer. If there's already an update in progress, a new update is marked
2133         as pending after the current one completes. In that case, when the update
2134         is completed, a new update is requested through the timer.
2135
2136         ThreadedDisplayRefreshMonitor is used to coordinate updates between the
2137         main and the composition thread whenever the CoordinatedGraphics state
2138         demands it, or whenever there are clients registered to that monitor that
2139         require an update (e.g. a requestAnimationFrame() callback). After the
2140         update on the composition thread is finished, and the DisplayRefreshMonitor
2141         object requires an update, a callback at the same priority as the layer
2142         flush timer is scheduled on the main thread. In that callback we handle
2143         any clients registered for this DisplayRefreshMonitor before proceeding
2144         to handle any changes to the CoordinatedGraphics scene. In case the
2145         DisplayRefreshMonitor clients or the layer flushes already queued up
2146         any changes to the state, we immediately ask the ThreadedCompositor for
2147         an update.
2148
2149         * PlatformGTK.cmake:
2150         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2151         (WebKit::CoordinatedGraphicsScene::updateViewport):
2152         (WebKit::CoordinatedGraphicsScene::commitSceneState):
2153         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2154         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2155         (WebKit::CompositingRunLoop::CompositingRunLoop):
2156         (WebKit::CompositingRunLoop::isActive):
2157         (WebKit::CompositingRunLoop::scheduleUpdate):
2158         (WebKit::CompositingRunLoop::stopUpdates):
2159         (WebKit::CompositingRunLoop::updateCompleted):
2160         (WebKit::CompositingRunLoop::updateTimerFired):
2161         (WebKit::CompositingRunLoop::isCurrent):
2162         (WebKit::CompositingRunLoop::startUpdateTimer): Deleted.
2163         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
2164         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2165         (): Deleted.
2166         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2167         (WebKit::m_displayRefreshMonitor):
2168         (WebKit::ThreadedCompositor::invalidate):
2169         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
2170         (WebKit::ThreadedCompositor::updateViewport):
2171         (WebKit::ThreadedCompositor::scheduleDisplayImmediately):
2172         (WebKit::ThreadedCompositor::renderLayerTree):
2173         (WebKit::ThreadedCompositor::sceneUpdateFinished):
2174         (WebKit::ThreadedCompositor::updateSceneState):
2175         (WebKit::ThreadedCompositor::displayRefreshMonitor):
2176         (WebKit::ThreadedCompositor::renderNextFrameIfNeeded):
2177         (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded):
2178         (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient):
2179         (WebKit::ThreadedCompositor::performFrameCompletion):
2180         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2181         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added.
2182         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
2183         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
2184         (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback):
2185         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
2186         (WebKit::ThreadedDisplayRefreshMonitor::invalidate):
2187         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
2188         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
2189         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2190         (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor):
2191         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2192         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2193         (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor):
2194         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2195         * WebProcess/WebPage/LayerTreeHost.h:
2196         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
2197
2198 2017-04-11  Alex Christensen  <achristensen@webkit.org>
2199
2200         Modernize and clean up code
2201         https://bugs.webkit.org/show_bug.cgi?id=170752
2202
2203         Reviewed by Sam Weinig.
2204
2205         * NetworkProcess/NetworkResourceLoader.h:
2206         * Shared/WebPreferencesStore.h:
2207         * UIProcess/API/APIHitTestResult.cpp:
2208         (API::HitTestResult::create):
2209         * UIProcess/API/APIHitTestResult.h:
2210         * UIProcess/API/C/WKPreferences.cpp:
2211         (WKPreferencesCreate):
2212         (WKPreferencesCreateWithIdentifier):
2213         (WKPreferencesCreateCopy):
2214         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
2215         * UIProcess/WebPreferences.cpp:
2216         (WebKit::WebPreferences::createWithLegacyDefaults):
2217         (WebKit::WebPreferences::copy):
2218         * UIProcess/WebPreferences.h:
2219         * WebProcess/Network/WebLoaderStrategy.h:
2220         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2221         (WebKit::WebEditorClient::requestCheckingOfString):
2222         * WebProcess/WebPage/WebPage.cpp:
2223         (WebKit::WebPage::addTextCheckingRequest):
2224         * WebProcess/WebPage/WebPage.h:
2225         * WebProcess/WebPage/ios/WebPageIOS.mm:
2226         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2227         (WebKit::WebPage::rangeForBlockAtPoint):
2228         (WebKit::WebPage::expandedRangeFromHandle):
2229         (WebKit::WebPage::contractedRangeFromHandle):
2230         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
2231         (WebKit::WebPage::changeBlockSelection):
2232         (WebKit::WebPage::rangeForGranularityAtPoint):
2233         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
2234
2235 2017-04-11  Dean Jackson  <dino@apple.com>
2236
2237         Disable outdated WritableStream API
2238         https://bugs.webkit.org/show_bug.cgi?id=170749
2239         <rdar://problem/31446233>
2240
2241         Reviewed by Tim Horton.
2242
2243         The API we implement is no longer accurate. Disable it until we
2244         are compatible with the new specification
2245
2246         * Configurations/FeatureDefines.xcconfig:
2247
2248 2017-04-11  Dan Bernstein  <mitz@apple.com>
2249
2250         [Cocoa] WebKit unnecessarily soft-links CorePrediction
2251         https://bugs.webkit.org/show_bug.cgi?id=170644
2252
2253         Reviewed by Sam Weinig.
2254
2255         * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added
2256           HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES.
2257
2258         * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where
2259           available. On macOS, use weak linking, because CorePrediction is not available in the
2260           Base System.
2261
2262         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed.
2263
2264         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with
2265           #if HAVE(CORE_PREDICTION).
2266         (WebKit::isNullFunctionPointer): Added this helper.
2267         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced
2268           dlopen()-based runtime check with a null check.
2269
2270         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if
2271           HAVE(CORE_PREDICTION).
2272
2273         * Platform/spi/Cocoa/CorePredictionSPI.h: Added.
2274
2275         * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION).
2276
2277         * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition.
2278
2279 2017-04-11  David Quesada  <david_quesada@apple.com>
2280
2281         Add SPI for handling geolocation authorization requests
2282         https://bugs.webkit.org/show_bug.cgi?id=170362
2283         rdar://problem/17508627
2284
2285         Reviewed by Alex Christensen.
2286
2287         Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page
2288         requests geolocation access. To support testing this change, make it possible to override
2289         the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable
2290         object on the process pool that implements a protocol for providing location updates for
2291         web views in the process pool. If the client doesn't provide this object,
2292         WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1
2293         WebGeolocationCoreLocationProvider and conforms to the new protocol.
2294
2295         * Shared/Cocoa/APIObject.mm:
2296         (API::Object::newObject):
2297         * Shared/WebGeolocationPosition.h:
2298         (WebKit::WebGeolocationPosition::create):
2299         * UIProcess/API/C/WKGeolocationPosition.cpp:
2300         (WKGeolocationPositionCreate_b):
2301         * UIProcess/API/Cocoa/WKProcessPool.mm:
2302         (-[WKProcessPool _coreLocationProvider]):
2303         (-[WKProcessPool _setCoreLocationProvider:]):
2304         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2305         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2306         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
2307         * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
2308         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added.
2309         (WebKit::if):
2310         (-[_WKGeolocationPosition dealloc]):
2311         (-[_WKGeolocationPosition _apiObject]):
2312         * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
2313         (WebKit::wrapper):
2314         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2315         (kit):
2316         (-[WKGeolocationProviderIOS initWithProcessPool:]):
2317         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2318         (-[WKGeolocationProviderIOS positionChanged:]):
2319         (-[WKLegacyCoreLocationProvider setListener:]):
2320         (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]):
2321         (-[WKLegacyCoreLocationProvider start]):
2322         (-[WKLegacyCoreLocationProvider stop]):
2323         (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]):
2324         (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]):
2325         (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]):
2326         (-[WKLegacyCoreLocationProvider positionChanged:]):
2327         (-[WKLegacyCoreLocationProvider errorOccurred:]):
2328         (-[WKLegacyCoreLocationProvider resetGeolocation]):
2329         Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider
2330         to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS
2331         expects.
2332         * WebKit2.xcodeproj/project.pbxproj:
2333
2334 2017-04-11  Eric Carlson  <eric.carlson@apple.com>
2335
2336         [MediaStream] Set correct audio session category when capturing audio
2337         https://bugs.webkit.org/show_bug.cgi?id=170736
2338         <rdar://problem/31559405>
2339
2340         Reviewed by Jer Noble.
2341
2342         * UIProcess/WebPageProxy.cpp:
2343         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2344
2345 2017-04-11  Youenn Fablet  <youenn@apple.com>
2346
2347         Activate WebRTC data channel tests for WK1
2348         https://bugs.webkit.org/show_bug.cgi?id=170710
2349
2350         Reviewed by Eric Carlson.
2351
2352         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process.
2353
2354 2017-04-11  Chris Fleizach  <cfleizach@apple.com>
2355
2356         AX: PDF plugin needs to support PDF-DOM Mode
2357         https://bugs.webkit.org/show_bug.cgi?id=170589
2358
2359         Reviewed by Tim Horton.
2360
2361         Provide access to DOM objects with PDF document. This mean:
2362            1) Support a different set of attributes for WKPDFPluginAccessibilityObject.
2363                 WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer.
2364            2) Connect the focused UI element to the active annotation if possible.
2365            3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found.
2366
2367         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2368         * WebProcess/Plugins/PDF/PDFPlugin.h:
2369         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2370         (-[WKPDFPluginAccessibilityObject pdfLayerController]):
2371         (-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
2372         (-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]):
2373         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
2374         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
2375         (-[WKPDFPluginAccessibilityObject accessibilityActionNames]):
2376         (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]):
2377         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
2378         (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
2379         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
2380         (WebKit::PDFPlugin::convertFromRootViewToPDFView):
2381         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
2382         (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest):
2383         (WebKit::PDFPlugin::axObjectCache):
2384         (WebKit::PDFPlugin::accessibilityShadowPluginParentForElement):
2385         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
2386         (WebKit::PDFPluginAnnotation::attach):
2387         * WebProcess/Plugins/Plugin.h:
2388         (WebKit::Plugin::accessibilityShadowPluginParentForElement):
2389         (WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest):
2390         * WebProcess/Plugins/PluginView.cpp:
2391         (WebKit::PluginView::accessibilityShadowPluginParentForElement):
2392         * WebProcess/Plugins/PluginView.h:
2393         * WebProcess/WebPage/WebPage.h:
2394         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2395         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2396
2397 2017-04-11  Adrian Perez de Castro  <aperez@igalia.com>
2398
2399         [GTK] Attach popup menu to web view widget
2400         https://bugs.webkit.org/show_bug.cgi?id=145866
2401
2402         Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view.
2403         This improves the positioning choices that the toolkit can do, and solves a long-standing issue
2404         that caused long popup menus to hang outside of the available display area under Wayland.
2405
2406         Based on a patch by Jonas Ådahl <jadahl@gmail.com>.
2407
2408         Reviewed by Carlos Garcia Campos.
2409
2410         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2411         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
2412
2413 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2414
2415         Revert r215217
2416         https://bugs.webkit.org/show_bug.cgi?id=170703
2417
2418         * Configurations/FeatureDefines.xcconfig:
2419
2420 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2421
2422         Continue enabling WebRTC
2423         https://bugs.webkit.org/show_bug.cgi?id=170703
2424
2425         Reviewed by Youenn Fablet.
2426
2427         * Configurations/FeatureDefines.xcconfig:
2428
2429 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2430
2431         REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions
2432         https://bugs.webkit.org/show_bug.cgi?id=170707
2433         <rdar://problem/27788755>
2434
2435         Reviewed by Tim Horton.
2436
2437         We fix this by sending the UserContentController with the WebPageCreationParameters
2438         instead of in a IPC message immediately following creation.  By the time the WebPage
2439         receives its second message, it has already started loading the first main resource.
2440         
2441         I also changed all instances of calling ChildProcessProxy::connection() to send a message
2442         in favor of calling ChildProcessProxy::send, which does the same thing except if a child
2443         process has not started, it will put the message in a queue and send it when the process
2444         is finished launching.  This was necessary because the UserContentController is now connected
2445         to the process sooner, so there were some API tests that would try to send messages between
2446         initiating a process launch and finishing a process launch, and this change preserves the
2447         existing behavior in those cases.
2448
2449         * Shared/WebPageCreationParameters.cpp:
2450         (WebKit::WebPageCreationParameters::encode):
2451         (WebKit::WebPageCreationParameters::decode):
2452         * Shared/WebPageCreationParameters.h:
2453         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2454         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
2455         (WebKit::DatabaseProcessProxy::didFinishLaunching):
2456         * UIProcess/Downloads/DownloadProxy.cpp:
2457         (WebKit::DownloadProxy::cancel):
2458         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
2459         (WebKit::DownloadProxy::willSendRequest):
2460         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2461         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2462         (WebKit::WebUserContentControllerProxy::addProcess):
2463         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
2464         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
2465         (WebKit::WebUserContentControllerProxy::addUserScript):
2466         (WebKit::WebUserContentControllerProxy::removeUserScript):
2467         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2468         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2469         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2470         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2471         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
2472         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
2473         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
2474         (WebKit::WebUserContentControllerProxy::addContentExtension):
2475         (WebKit::WebUserContentControllerProxy::removeContentExtension):
2476         (WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
2477         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2478         * UIProcess/VisitedLinkStore.cpp:
2479         (WebKit::VisitedLinkStore::removeAll):
2480         (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
2481         (WebKit::VisitedLinkStore::sendTable):
2482         * UIProcess/WebPageProxy.cpp:
2483         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
2484         (WebKit::WebPageProxy::creationParameters):
2485         * UIProcess/WebProcessProxy.cpp:
2486         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
2487         * UIProcess/WebProcessProxy.h:
2488         * WebProcess/UserContent/WebUserContentController.h:
2489         * WebProcess/WebPage/WebPage.cpp:
2490         (WebKit::m_backgroundCPULimit):
2491
2492 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2493
2494         Add API to get available content extension identifiers in a WKContentExtensionStore
2495         https://bugs.webkit.org/show_bug.cgi?id=170093
2496
2497         Reviewed by Geoffrey Garen.
2498
2499         * UIProcess/API/APIContentExtensionStore.cpp:
2500         (API::constructedPathPrefix):
2501         (API::constructedPathFilter):
2502         (API::constructedPath):
2503         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):
2504         * UIProcess/API/APIContentExtensionStore.h:
2505         * UIProcess/API/Cocoa/WKContentExtensionStore.h:
2506         * UIProcess/API/Cocoa/WKContentExtensionStore.mm:
2507         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]):
2508         (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]):
2509         (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]):
2510         (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
2511
2512 2017-04-10  Jeremy Jones  <jeremyj@apple.com>
2513
2514         Add CoreAudioCaptureSource.
2515         https://bugs.webkit.org/show_bug.cgi?id=170112
2516         rdar://problem/30293338
2517
2518         Reviewed by Tim Horton.
2519
2520         Add UseAVFoundationAudioCapture preference to switch back from the new default of CoreAudio.
2521
2522         * Shared/WebPreferencesDefinitions.h:
2523         * UIProcess/API/C/WKPreferences.cpp:
2524         (WKPreferencesSetUseAVFoundationAudioCapture):
2525         (WKPreferencesGetUseAVFoundationAudioCapture):
2526         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2527         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2528         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2529         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2530         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
2531         * WebProcess/WebPage/WebPage.cpp:
2532         (WebKit::WebPage::updatePreferences):
2533
2534 2017-04-10  Brent Fulgham  <bfulgham@apple.com>
2535
2536         [WK2][macOS] Block access to Apple Events before launch.
2537         https://bugs.webkit.org/show_bug.cgi?id=170626
2538         <rdar://problem/16079334>
2539
2540         Reviewed by Alexey Proskuryakov.
2541
2542         Clear the environment of the AppleEvent server name before initializing
2543         AppKit so we never bother connecting.
2544
2545         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2546         (main):
2547
2548 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
2549
2550         [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()
2551         https://bugs.webkit.org/show_bug.cgi?id=170553
2552
2553         Reviewed by Michael Catanzaro.
2554
2555         Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or
2556         newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids
2557         using functions which were deprecated starting at that GTK+ release.
2558
2559         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2560         (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a
2561         pointer event that can be passed to it.
2562         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2563         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates
2564         of the control passed as reference rectangle. Some conditional code is needed because with newer
2565         GTK+ versions a relative offset instead of an absolute position is needed.
2566
2567 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
2568
2569         [GTK] Opening a popup menu does not pre-select the active item
2570         https://bugs.webkit.org/show_bug.cgi?id=170680
2571
2572         Reviewed by Michael Catanzaro.
2573
2574         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2575         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to
2576         ensure that the active item appears selected right after popping up the menu.
2577
2578 2017-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2579
2580         [GTK] Enable DOM timer throttling and CSS animations suspension
2581         https://bugs.webkit.org/show_bug.cgi?id=170669
2582
2583         Reviewed by Žan Doberšek.
2584
2585         * Shared/WebPreferencesDefinitions.h:
2586
2587 2017-04-10  Chris Dumez  <cdumez@apple.com>
2588
2589         Drop Timer::startOneShot() overload taking a double
2590         https://bugs.webkit.org/show_bug.cgi?id=170659
2591
2592         Reviewed by Yusuke Suzuki.
2593
2594         Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
2595
2596         * NetworkProcess/PingLoad.h:
2597         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2598         (WebKit::NetworkDataTaskSoup::startTimeout):
2599         * Platform/IPC/Connection.h:
2600         * Platform/IPC/mac/ConnectionMac.mm:
2601         (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
2602         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2603         (IPC::Connection::terminateSoon):
2604         * PluginProcess/PluginProcess.cpp:
2605         (WebKit::PluginProcess::setMinimumLifetime):
2606         * PluginProcess/PluginProcess.h:
2607         * Shared/ChildProcess.cpp:
2608         (WebKit::ChildProcess::ChildProcess):
2609         * Shared/ChildProcess.h:
2610         (WebKit::ChildProcess::setTerminationTimeout):
2611         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2612         (WebKit::CompositingRunLoop::startUpdateTimer):
2613         * Shared/Plugins/PluginProcessCreationParameters.h:
2614         * Shared/WebMemorySampler.cpp:
2615         (WebKit::WebMemorySampler::initializeTimers):
2616         * Shared/WebProcessCreationParameters.h:
2617         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
2618         (API::SharedJSContext::ensureContext):
2619         * UIProcess/ChildProcessProxy.cpp:
2620         (WebKit::ChildProcessProxy::shutDownProcess):
2621         * UIProcess/Cocoa/NavigationState.mm:
2622         (WebKit::NavigationState::didChangeIsLoading):
2623         * UIProcess/Cocoa/ViewGestureController.cpp:
2624         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
2625         * UIProcess/Cocoa/ViewGestureController.h:
2626         * UIProcess/DrawingAreaProxyImpl.cpp:
2627         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
2628         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
2629         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
2630         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2631         * UIProcess/Plugins/PluginProcessProxy.cpp:
2632         * UIProcess/ProcessThrottler.cpp:
2633         * UIProcess/ResponsivenessTimer.cpp:
2634         * UIProcess/WebProcessPool.cpp:
2635         (WebKit::WebProcessPool::createNewWebProcess):
2636         * UIProcess/gtk/GestureController.cpp:
2637         (WebKit::GestureController::DragGesture::begin):
2638         * UIProcess/mac/WebInspectorProxyMac.mm:
2639         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2640         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
2641         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2642         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
2643         * WebProcess/WebPage/WebPage.cpp:
2644         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2645         * WebProcess/WebProcess.cpp:
2646
2647 2017-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2648
2649         [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
2650         https://bugs.webkit.org/show_bug.cgi?id=170658
2651         <rdar://problem/31431450>
2652
2653         Reviewed by Tim Horton.
2654
2655         Introduces doAfterPositionInformationUpdate:forRequest:, which WKContentView can use internally to perform
2656         an action requiring InteractionInformationAtPosition asynchronously. See below for additional details.
2657
2658         New API unit test: DataInteractionTests.UnresponsivePageDoesNotHangUI.
2659
2660         * UIProcess/ios/WKContentViewInteraction.h:
2661         * UIProcess/ios/WKContentViewInteraction.mm:
2662         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2663         (-[WKContentView _actionForLongPress]):
2664         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2665
2666         If current position information satisfies the request, then perform the given block immediately; otherwise, we
2667         save the block and request as a pair in a list of pending position information handlers, and then make a new
2668         request to the web process for position information if the currently outgoing request does not already satisfy
2669         the given request.
2670
2671         (-[WKContentView ensurePositionInformationIsUpToDate:]):
2672
2673         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
2674
2675         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
2676         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
2677         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
2678
2679         Pulled out common logic for managing InteractionInformationRequests into separate helper methods.
2680
2681         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
2682         (-[WKContentView gestureRecognizerShouldBegin:]):
2683
2684         Refactored to use ensurePositionInformationIsUpToDate:. There is no behavior change here, but it makes sure that
2685         this particular request will also any valid pending position information handlers.
2686
2687         (-[WKContentView _positionInformationDidChange:]):
2688
2689         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
2690
2691         (-[WKContentView pointIsInDataInteractionContent:]): Deleted.
2692
2693         We should no longer use this method, since it makes a synchronous request to the web process -- see
2694         positionInformationMayStartDataInteraction.
2695
2696 2017-04-09  Chris Dumez  <cdumez@apple.com>
2697
2698         Drop Timer::startRepeating() overload taking a double
2699         https://bugs.webkit.org/show_bug.cgi?id=170656
2700
2701         Reviewed by Yusuke Suzuki.
2702
2703         Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.
2704
2705         * Shared/WebMemorySampler.cpp:
2706         (WebKit::WebMemorySampler::initializeTimers):
2707         * UIProcess/Cocoa/ViewGestureController.cpp:
2708         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
2709         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
2710         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2711         (WebKit::NetscapePlugin::Timer::start):
2712         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2713         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2714         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
2715
2716 2017-04-09  Jon Lee  <jonlee@apple.com>
2717
2718         [WK2][iOS] Add CoreMedia entitlement for WebProcess
2719         https://bugs.webkit.org/show_bug.cgi?id=170623
2720         rdar://problem/30020073
2721
2722         Reviewed by Youenn Fablet.
2723
2724         * Configurations/WebContent-iOS.entitlements: Update entitlement to an array of strings instead of bool.
2725
2726 2017-04-09  Chris Dumez  <cdumez@apple.com>
2727
2728         Start dropping Timer API dealing with double
2729         https://bugs.webkit.org/show_bug.cgi?id=170649
2730
2731         Reviewed by Yusuke Suzuki.
2732
2733         Start dropping Timer API dealing with double as people should use Seconds now.
2734
2735         * NetworkProcess/NetworkDataTask.cpp:
2736         (WebKit::NetworkDataTask::scheduleFailure):
2737         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2738         (WebKit::NetworkDataTaskCocoa::resume):
2739         * PluginProcess/PluginControllerProxy.cpp:
2740         (WebKit::PluginControllerProxy::destroy):
2741         (WebKit::PluginControllerProxy::startPaintTimer):
2742         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2743         (webkitWebViewBaseScheduleUpdateActivityState):
2744         * UIProcess/DrawingAreaProxy.cpp:
2745         (WebKit::DrawingAreaProxy::setViewExposedRect):
2746         * UIProcess/DrawingAreaProxyImpl.cpp:
2747         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
2748         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2749         (WebKit::PluginInfoCache::updatePluginInfo):
2750         * UIProcess/VisitedLinkStore.cpp:
2751         (WebKit::VisitedLinkStore::addVisitedLinkHash):
2752         * UIProcess/WebProcessPool.cpp:
2753         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
2754         * UIProcess/gtk/GestureController.cpp:
2755         (WebKit::GestureController::ZoomGesture::scaleChanged):
2756         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2757         (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback):
2758         * WebProcess/Network/WebLoaderStrategy.cpp:
2759         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
2760         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2761         (WebKit::NPRuntimeObjectMap::addToInvalidationQueue):
2762         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2763         (WebKit::NetscapePluginStream::deliverDataToPlugin):
2764         * WebProcess/Plugins/PluginView.cpp:
2765         (WebKit::PluginView::pendingURLRequestsTimerFired):
2766         (WebKit::PluginView::loadURL):
2767         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2768         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon):
2769         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2770         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
2771         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2772         (WebKit::DrawingAreaImpl::scheduleDisplay):
2773         * WebProcess/WebPage/WebPage.cpp:
2774         (WebKit::WebPage::updateIsInWindow):
2775         (WebKit::WebPage::addPluginView):
2776         (WebKit::WebPage::setMayStartMediaWhenInWindow):
2777         (WebKit::WebPage::didFinishLoad):
2778         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2779         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
2780
2781 2017-04-08  Chris Dumez  <cdumez@apple.com>
2782
2783         Drop std::chrono support from Timer class
2784         https://bugs.webkit.org/show_bug.cgi?id=170645
2785
2786         Reviewed by Sam Weinig.
2787
2788         Drop std::chrono support from Timer class now that we prefer using Seconds type.
2789
2790         * NetworkProcess/NetworkLoad.cpp:
2791         (WebKit::NetworkLoad::Throttle::Throttle):
2792         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2793         * NetworkProcess/NetworkProcess.h:
2794         (WebKit::NetworkProcess::loadThrottleLatency):
2795         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2796         * NetworkProcess/NetworkProcessCreationParameters.h:
2797         * NetworkProcess/NetworkResourceLoadParameters.h:
2798         * NetworkProcess/NetworkResourceLoader.cpp:
2799         (WebKit::NetworkResourceLoader::startNetworkLoad):
2800         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2801         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2802         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2803         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2804         (WebKit::NetworkCache::Storage::store):
2805         * Shared/CacheModel.cpp:
2806         (WebKit::calculateMemoryCacheSizes):
2807         * Shared/CacheModel.h:
2808         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
2809         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2810         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2811         * WebProcess/Network/WebLoaderStrategy.cpp:
2812         (WebKit::maximumBufferingTime):
2813         * WebProcess/Plugins/PluginView.cpp:
2814         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2815         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
2816         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2817         * WebProcess/WebProcess.cpp:
2818         (WebKit::m_resourceLoadStatisticsStore):
2819         (WebKit::WebProcess::setCacheModel):
2820
2821 2017-04-08  Chris Dumez  <cdumez@apple.com>
2822
2823         Unreviewed attempt to fix GTK build after r215138.
2824
2825         * UIProcess/API/gtk/WebKitUIClient.cpp:
2826
2827 2017-04-08  Youenn Fablet  <youenn@apple.com>
2828
2829         WebRTC tests gardening
2830         https://bugs.webkit.org/show_bug.cgi?id=170508
2831
2832         Reviewed by Eric Carlson.
2833
2834         * Configurations/FeatureDefines.xcconfig:
2835
2836 2017-04-08  Chris Dumez  <cdumez@apple.com>
2837
2838         Timer's nextFireInterval() / repeatInterval() should return Seconds
2839         https://bugs.webkit.org/show_bug.cgi?id=170639
2840
2841         Reviewed by Simon Fraser.
2842
2843         Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
2844
2845         * WebProcess/WebPage/WebPage.cpp:
2846         (WebKit::WebPage::layerVolatilityTimerFired):
2847         (WebKit::WebPage::markLayersVolatile):
2848
2849 2017-04-07  Alex Christensen  <achristensen@webkit.org>
2850
2851         Modernize WebPage.h
2852         https://bugs.webkit.org/show_bug.cgi?id=170633
2853
2854         Reviewed by Joseph Pecoraro.
2855
2856         * UIProcess/API/APIUIClient.h:
2857         (API::UIClient::createNewPage):
2858         * UIProcess/API/C/WKPage.cpp:
2859         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
2860         (WebKit::RunJavaScriptAlertResultListener::create):
2861         (WebKit::RunJavaScriptConfirmResultListener::create):
2862         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
2863         (WebKit::RunJavaScriptPromptResultListener::create):
2864         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
2865         (WKPageSetPageUIClient):
2866         * UIProcess/Cocoa/UIDelegate.h:
2867         * UIProcess/Cocoa/UIDelegate.mm:
2868         (WebKit::UIDelegate::UIClient::createNewPage):
2869         * WebProcess/WebPage/WebPage.cpp:
2870         (WebKit::WebPage::loadDataImpl):
2871         (WebKit::WebPage::loadStringImpl):
2872         (WebKit::WebPage::loadData):
2873         (WebKit::WebPage::scaledSnapshotWithOptions):
2874         (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
2875         (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
2876         * WebProcess/WebPage/WebPage.h:
2877
2878 2017-04-07  Alex Christensen  <achristensen@webkit.org>
2879
2880         Use audit_token_t instead of pid_t for checking sandbox of other processes
2881         https://bugs.webkit.org/show_bug.cgi?id=170616
2882         <rdar://problem/31158189>
2883
2884         Reviewed by Daniel Bates.
2885
2886         pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed.
2887         Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the
2888         old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process.
2889
2890         * PluginProcess/mac/PluginProcessMac.mm:
2891         (WebKit::PluginProcess::initializeSandbox):
2892         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2893         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
2894         * Shared/mac/SandboxUtilities.h:
2895         * Shared/mac/SandboxUtilities.mm:
2896         (WebKit::currentProcessIsSandboxed):
2897         (WebKit::connectedProcessIsSandboxed):
2898         (WebKit::processIsSandboxed): Deleted.
2899         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2900         (WebKit::WebProcessProxy::platformIsBeingDebugged):
2901         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2902         (WebKit::PluginInfoStore::shouldUsePlugin):
2903         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2904         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
2905
2906 2017-04-07  Brent Fulgham  <bfulgham@apple.com>
2907
2908         [WK2][iOS] Add CoreMedia entitlement for WebProcess
2909         https://bugs.webkit.org/show_bug.cgi?id=170623
2910         <rdar://problem/30020073>
2911
2912         Reviewed by Youenn Fablet.
2913
2914         Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia
2915         to work properly in WebRTC.
2916
2917         * Configurations/WebContent-iOS.entitlements:
2918
2919 2017-04-07  Alex Christensen  <achristensen@webkit.org>
2920
2921         Private browsing sessions should not look in keychain for client certificates
2922         https://bugs.webkit.org/show_bug.cgi?id=170618
2923         <rdar://problem/18457427>
2924
2925         Reviewed by Dan Bernstein.
2926
2927         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2928         (WebKit::configurationForSessionID):
2929
2930 2017-04-07  Chris Dumez  <cdumez@apple.com>
2931
2932         We should log how much CPU a background process was using when killing it due to CPU limiting
2933         https://bugs.webkit.org/show_bug.cgi?id=170619
2934
2935         Reviewed by Andreas Kling.
2936
2937         * WebProcess/cocoa/WebProcessCocoa.mm:
2938         (WebKit::WebProcess::updateBackgroundCPUMonitorState):
2939
2940 2017-04-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2941
2942         Missing conversion from window to content coordinates when adjusting unobscured content rects for input view
2943         https://bugs.webkit.org/show_bug.cgi?id=170603
2944
2945         Reviewed by Simon Fraser.
2946
2947         Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]
2948         to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds.
2949         Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html.
2950
2951         * UIProcess/ios/WKContentView.mm:
2952         (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
2953
2954 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2955
2956         [GTK] Various build errors when plugin support is disabled
2957         https://bugs.webkit.org/show_bug.cgi?id=170015
2958
2959         Reviewed by Carlos Garcia Campos.
2960
2961         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
2962         * UIProcess/API/gtk/WebKitWebsiteData.cpp:
2963         (recordContainsSupportedDataTypes):
2964         (toWebKitWebsiteDataTypes):
2965         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
2966         (toWebsiteDataTypes):
2967
2968 2017-04-07  John Wilander  <wilander@apple.com>
2969
2970         WebSocket streams should have network usage attributed to correct process
2971         https://bugs.webkit.org/show_bug.cgi?id=170322
2972         <rdar://problem/26413551>
2973
2974         Reviewed by Alex Christensen.
2975
2976         Changes here are due to the added WebCore::SourceApplicationAuditToken parameter
2977         in WebCore::SocketStreamHandleImpl::create().
2978         WebKit::NetworkSocketStream takes it and passes it on.
2979
2980         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2981         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
2982         * NetworkProcess/NetworkSocketStream.cpp:
2983         (WebKit::NetworkSocketStream::create):
2984         (WebKit::NetworkSocketStream::NetworkSocketStream):
2985         * NetworkProcess/NetworkSocketStream.h:
2986
2987 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2988
2989         Unreviewed, fix missing return value warning
2990
2991         * UIProcess/WebProcessProxy.cpp:
2992         (WebKit::diagnosticLoggingKeyForSimulatedCrashReason):
2993
2994 2017-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2995
2996         [GTK] Update the priorities used in glib main loop sources
2997         https://bugs.webkit.org/show_bug.cgi?id=170457
2998
2999         Reviewed by Žan Doberšek.
3000
3001         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3002         (WebKit::CompositingRunLoop::CompositingRunLoop):
3003         * UIProcess/DrawingAreaProxyImpl.cpp:
3004         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
3005         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
3006         * UIProcess/gtk/WaylandCompositor.cpp:
3007         (WebKit::createWaylandLoopSource):
3008         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3009         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
3010         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3011         (WebKit::CompositingCoordinator::CompositingCoordinator):
3012         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3013         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3014         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
3015         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3016         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
3017
3018 2017-04-06  Alex Christensen  <achristensen@webkit.org>
3019
3020         Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h
3021         https://bugs.webkit.org/show_bug.cgi?id=170533
3022
3023         Reviewed by Daniel Bates.
3024
3025         * Shared/API/Cocoa/WebKit.h:
3026         In r213696 I added two public headers.  All public headers in WebKit are included with
3027         #import <WebKit/WebKit.h>
3028
3029 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
3030
3031         Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics
3032         https://bugs.webkit.org/show_bug.cgi?id=170575
3033
3034         Rubber-stamped by Brian Burg.
3035
3036         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3037         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted.
3038         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
3039         m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here.
3040
3041 2017-04-06  Commit Queue  <commit-queue@webkit.org>
3042
3043         Unreviewed, rolling out r214973.
3044         https://bugs.webkit.org/show_bug.cgi?id=170578
3045
3046         Causes issues in Safari (Requested by bradee-oh on #webkit).
3047
3048         Reverted changeset:
3049
3050         "Refactor so WebsiteDataStores always have a StorageManager."
3051         https://bugs.webkit.org/show_bug.cgi?id=170521
3052         http://trac.webkit.org/changeset/214973
3053
3054 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
3055
3056         Unreviewed, rolling out r215046.
3057
3058         This change broke internal builds.
3059
3060         Reverted changeset:
3061
3062         "WebRTC tests gardening"
3063         https://bugs.webkit.org/show_bug.cgi?id=170508
3064         http://trac.webkit.org/changeset/215046
3065
3066 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
3067
3068         Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
3069         https://bugs.webkit.org/show_bug.cgi?id=170525
3070
3071         Reviewed by Youenn Fablet.
3072
3073         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3074         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3075         Only collect extra metrics if the WebProcess this load is for has enabled
3076         collecting extra metrics.
3077
3078         * WebProcess/Network/WebLoaderStrategy.cpp:
3079         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
3080         * WebProcess/Network/WebLoaderStrategy.h:
3081         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3082         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
3083         * NetworkProcess/NetworkConnectionToWebProcess.h:
3084         (WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled):
3085         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3086         New bool state toggled through the loader policy.
3087
3088         * NetworkProcess/NetworkDataTask.cpp:
3089         (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics):
3090         * NetworkProcess/NetworkDataTask.h:
3091         (WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics):
3092         * NetworkProcess/NetworkLoad.cpp:
3093         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics):
3094         * NetworkProcess/NetworkLoad.h:
3095         * NetworkProcess/NetworkLoadClient.h:
3096         (WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics):
3097         * NetworkProcess/NetworkResourceLoader.cpp:
3098         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics):
3099         * NetworkProcess/NetworkResourceLoader.h:
3100         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3101         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics):
3102         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
3103         Default handling for network loads is to not include extra data. Thread
3104         client messages back from the NetworkLoads / SpeculativeLoads to check
3105         the NetworkConnectionToWebProcess state on whether or not we should collect
3106         extra metrics.
3107
3108 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
3109
3110         Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
3111         https://bugs.webkit.org/show_bug.cgi?id=16531
3112         <rdar://problem/5712895>
3113
3114         Reviewed by Timothy Hatcher.
3115
3116         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3117         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3118         Include a complete list of the request headers sent for this load.
3119         There may be headers that WebCore did not know about and developer
3120         tools should be informed of.
3121
3122 2017-04-06  Anders Carlsson  <andersca@apple.com>
3123
3124         OptionSet options need to be powers of two
3125         https://bugs.webkit.org/show_bug.cgi?id=170565
3126
3127         Reviewed by Chris Dumez.
3128
3129         Change Cache::Option to be powers of two.
3130
3131         * NetworkProcess/cache/NetworkCache.h:
3132
3133 2017-04-06  Youenn Fablet  <youenn@apple.com>
3134
3135         WebRTC tests gardening
3136         https://bugs.webkit.org/show_bug.cgi?id=170508
3137
3138         Reviewed by Eric Carlson.
3139
3140         * Configurations/FeatureDefines.xcconfig:
3141
3142 2017-04-06  Antti Koivisto  <antti@apple.com>
3143
3144         Implement testing mode for disk cache
3145         https://bugs.webkit.org/show_bug.cgi?id=170547
3146
3147         Reviewed by Andreas Kling.
3148
3149         Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness.
3150
3151         Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk.
3152
3153         This is enabled by the existing WKContextUseTestingNetworkSession SPI.
3154
3155         * NetworkProcess/cache/NetworkCache.cpp:
3156         (WebKit::NetworkCache::Cache::initialize):
3157         * NetworkProcess/cache/NetworkCache.h:
3158         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3159         (WebKit::NetworkCache::Storage::open):
3160         (WebKit::NetworkCache::Storage::Storage):
3161         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3162         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
3163         * NetworkProcess/cache/NetworkCacheStorage.h:
3164         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3165         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3166
3167 2017-04-06  Chris Dumez  <cdumez@apple.com>
3168
3169         [WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
3170         https://bugs.webkit.org/show_bug.cgi?id=170524
3171         <rdar://problem/31461472>
3172
3173         Reviewed by Eric Carlson.
3174
3175         Add C private API to toggle invisibleAutoplayNotPermitted setting.
3176
3177         * UIProcess/API/C/WKPreferences.cpp:
3178         (WKPreferencesSetInvisibleMediaAutoplayPermitted):
3179         (WKPreferencesGetInvisibleMediaAutoplayPermitted):
3180         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3181
3182 2017-04-06  Adrian Perez de Castro  <aperez@igalia.com>
3183
3184         [GTK] Fix build with MEDIA_CAPTURE enabled
3185         https://bugs.webkit.org/show_bug.cgi?id=170539
3186
3187         Reviewed by Carlos Garcia Campos.
3188
3189         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
3190         (webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone.
3191
3192 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
3193
3194         [WK2][iOS] Remove access to features not present on iOS 
3195         https://bugs.webkit.org/show_bug.cgi?id=170531
3196         <rdar://problem/31352258>
3197
3198         Reviewed by Alexey Proskuryakov.
3199
3200         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3201
3202 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
3203
3204         [MediaStream] Host application should be able to mute and unmute media streams
3205         https://bugs.webkit.org/show_bug.cgi?id=170519
3206         <rdar://problem/31174326>
3207
3208         Reviewed by Youenn Fablet.
3209
3210         * UIProcess/API/C/WKPage.cpp:
3211         (WKPageGetMediaState): Support new media stream state flags.
3212         * UIProcess/API/C/WKPagePrivate.h:
3213         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto.
3214         * UIProcess/Cocoa/UIDelegate.mm: Ditto.
3215
3216 2017-04-05  Brady Eidson  <beidson@apple.com>
3217
3218         Refactor so WebsiteDataStores always have a StorageManager.
3219         https://bugs.webkit.org/show_bug.cgi?id=170521
3220
3221         Reviewed by Geoff Garen.
3222
3223         This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker,
3224         since there will never be ephemeral bits on disk to track.
3225         
3226         * UIProcess/Storage/StorageManager.cpp:
3227         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
3228         (WebKit::StorageManager::createEphemeral):
3229         (WebKit::StorageManager::StorageManager):
3230         (WebKit::StorageManager::getLocalStorageOrigins):
3231         (WebKit::StorageManager::getLocalStorageOriginDetails):
3232         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
3233         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3234         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
3235         * UIProcess/Storage/StorageManager.h:
3236         
3237         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3238         (WebKit::WebsiteDataStore::WebsiteDataStore):
3239
3240 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
3241
3242         [WK2][iOS] Add entitlements to enable audio/video capture in WebProcess
3243         https://bugs.webkit.org/show_bug.cgi?id=170507
3244         <rdar://problem/31121248>
3245
3246         Reviewed by Youenn Fablet.
3247
3248         Add two entitlements that are required to access audio/video capture on iOS.
3249
3250         * Configurations/WebContent-iOS.entitlements:
3251
3252 2017-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3253
3254         Show a log message when an invalid message is received in non cocoa ports
3255         https://bugs.webkit.org/show_bug.cgi?id=170506
3256
3257         Reviewed by Michael Catanzaro.
3258
3259         We just crash, but without knowing the details about the message it's impossible to debug.
3260
3261         * Shared/ChildProcess.cpp:
3262         (WebKit::ChildProcess::didReceiveInvalidMessage):
3263
3264 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3265
3266         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
3267         https://bugs.webkit.org/show_bug.cgi?id=156974
3268
3269         Reviewed by Sam Weinig.
3270
3271         WebErrors are not only used by the frame loader client in the web process, but also by the network process. So,
3272         move them to Shared make most of the implementation cross-platform.
3273
3274         * CMakeLists.txt: Add new files to compilation.
3275         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3276         (WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed.
3277         (WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto.
3278         (WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto.
3279         (WebKit::NetworkDataTaskSoup::didFail): Ditto.
3280         * PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp
3281         * PlatformMac.cmake:
3282         * Shared/API/APIError.cpp: Add error domains used by glib based ports.
3283         (API::Error::webKitNetworkErrorDomain):
3284         (API::Error::webKitPolicyErrorDomain):
3285         (API::Error::webKitPluginErrorDomain):
3286         (API::Error::webKitDownloadErrorDomain):
3287         (API::Error::webKitPrintErrorDomain):
3288         * Shared/API/APIError.h:
3289         * Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
3290         (WebKit::createNSError):
3291         (WebKit::cancelledError):
3292         (WebKit::fileDoesNotExistError):
3293         * Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
3294         (WebKit::blockedError):
3295         (WebKit::blockedByContentBlockerError):
3296         (WebKit::cannotShowURLError):
3297         (WebKit::interruptedForPolicyChangeError):
3298         (WebKit::blockedByContentFilterError):
3299         (WebKit::cannotShowMIMETypeError):
3300         (WebKit::pluginWillHandleLoadError):
3301         (WebKit::internalError):
3302         * Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
3303         * Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
3304         (WebKit::cancelledError):
3305         (WebKit::fileDoesNotExistError):
3306         * Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
3307         (WebKit::printError):
3308         (WebKit::printerNotFoundError):
3309         (WebKit::invalidPageRangeToPrint):
3310         * Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
3311         (WebKit::downloadNetworkError):
3312         (WebKit::downloadCancelledByUserError):
3313         (WebKit::downloadDestinationError):
3314         * UIProcess/API/gtk/WebKitDownload.cpp:
3315         * UIProcess/API/gtk/WebKitError.cpp:
3316         (webkit_network_error_quark):
3317         (webkit_policy_error_quark):
3318         (webkit_plugin_error_quark):
3319         (webkit_download_error_quark):
3320         (webkit_print_error_quark):
3321         * UIProcess/API/gtk/WebKitPrivate.cpp:
3322         (toWebKitError):
3323         (toWebCoreError):
3324         * WebKit2.xcodeproj/project.pbxproj:
3325         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed.
3326         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
3327
3328 2017-04-04  Youenn Fablet  <youenn@apple.com>
3329
3330         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
3331         https://bugs.webkit.org/show_bug.cgi?id=170482
3332
3333         Reviewed by Eric Carlson.
3334
3335         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3336         (WebKit::UserMediaCaptureManager::Source::setStorage):
3337
3338 2017-04-04  Tim Horton  <timothy_horton@apple.com>
3339
3340         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
3341         https://bugs.webkit.org/show_bug.cgi?id=165801
3342         <rdar://problem/29649535>
3343
3344         Reviewed by Wenson Hsieh.
3345
3346         Previously, when doing an incremental find that wrapped, we would 
3347         say that it did not, leading NSTextFinder to not provide its usual
3348         wrapping UI, and other clients of the NSTextFinderClient protocol to
3349         get confused by the lack of wrapping.
3350
3351         * UIProcess/WebPageProxy.cpp:
3352         (WebKit::WebPageProxy::didFindString):
3353         * UIProcess/WebPageProxy.h:
3354         * UIProcess/WebPageProxy.messages.in:
3355         * UIProcess/API/APIFindClient.h:
3356         (API::FindClient::didFindString):
3357         * UIProcess/API/C/WKPage.cpp:
3358         (WKPageSetPageFindClient):
3359         * UIProcess/Cocoa/FindClient.h:
3360         * UIProcess/Cocoa/FindClient.mm:
3361         (WebKit::FindClient::didFindString):
3362         * WebProcess/WebPage/FindController.cpp:
3363         (WebKit::FindController::updateFindUIAfterPageScroll):
3364         (WebKit::FindController::findString):
3365         * WebProcess/WebPage/FindController.h:
3366         Plumb DidWrap from FindController's call to findString back through
3367         the DidFindString message.
3368
3369         * UIProcess/mac/WKTextFinderClient.mm:
3370         (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
3371         (-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted.
3372         Make use of the new DidWrap information to stop lying to NSTextFinder
3373         about whether a wrap actually occurred.
3374
3375 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3376
3377         Data interaction should register type identifiers in order of priority
3378         https://bugs.webkit.org/show_bug.cgi?id=170428
3379         <rdar://problem/30633296>
3380
3381         Reviewed by Tim Horton.
3382
3383         Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog
3384         for more details.
3385
3386         * Shared/WebCoreArgumentCoders.cpp:
3387         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
3388         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
3389         * UIProcess/API/Cocoa/WKWebView.mm:
3390
3391 2017-04-03  Joseph Pecoraro  <pecoraro@apple.com>
3392
3393         Remove no longer needed forward declarations
3394         https://bugs.webkit.org/show_bug.cgi?id=170415
3395
3396         Reviewed by Dan Bernstein.
3397
3398         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3399
3400 2017-04-03  Anders Carlsson  <andersca@apple.com>
3401
3402         Tweak ApplePaySession API
3403         https://bugs.webkit.org/show_bug.cgi?id=170409
3404         rdar://problem/31405459
3405
3406         Reviewed by Tim Horton.
3407
3408         Update for WebCore changes.
3409
3410         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3411         (WebKit::toNSError):
3412
3413 2017-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3414
3415         [SOUP] URI Fragment is lost after redirect
3416         https://bugs.webkit.org/show_bug.cgi?id=170058
3417
3418         Reviewed by Michael Catanzaro.
3419
3420         In case of redirection check if the current request has a fragment identifier and apply it to the redirection
3421         only when it doesn't have a fragment identifier yet.
3422
3423         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3424         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3425         (WebKit::NetworkDataTaskSoup::createRequest):
3426         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3427         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3428
3429 2017-04-03  Antti Koivisto  <antti@apple.com>
3430
3431         Mutex may be freed too late in NetworkCache::Storage::traverse
3432         https://bugs.webkit.org/show_bug.cgi?id=170400
3433         <rdar://problem/30515865>
3434
3435         Reviewed by Carlos Garcia Campos and Andreas Kling.
3436
3437         Fix a race.
3438
3439         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3440         (WebKit::NetworkCache::Storage::traverse):
3441
3442             Ensure the mutex is not accessed after we dispatch to the main thread.
3443             The main thread call deletes the owning TraverseOperation.
3444
3445 2017-04-01  Dan Bernstein  <mitz@apple.com>
3446
3447         [iOS] <input type=file> label should be specified using plural rules
3448         https://bugs.webkit.org/show_bug.cgi?id=170388
3449
3450         Reviewed by Alexey Proskuryakov.
3451
3452         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3453         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
3454           Instead of calling -_displayStringForPhotos:videos:, use
3455           +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and
3456           %lu video(s)" for which there are plural rules.
3457         (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted.
3458
3459 2017-04-01  Dan Bernstein  <mitz@apple.com>
3460
3461         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
3462         https://bugs.webkit.org/show_bug.cgi?id=170385
3463
3464         Reviewed by Tim Horton.
3465
3466         * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s
3467           not going to be in the shared cache, even if its install name implies that it might be.
3468
3469 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
3470
3471         Remove a logging statement left in by mistake.
3472
3473         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3474         (WebKit::WebFrameLoaderClient::restoreViewState):
3475
3476 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3477
3478         Address post-review feedback after r214692
3479         https://bugs.webkit.org/show_bug.cgi?id=170328
3480
3481         Reviewed by Dan Bernstein.
3482
3483         Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule
3484         that should be applied when using a text interaction assistant, not just when using character granularity
3485         for selecting text.
3486
3487         * UIProcess/ios/WKContentViewInteraction.mm:
3488         (-[WKContentView setSelectedTextRange:]):
3489
3490 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3491
3492         [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity
3493         https://bugs.webkit.org/show_bug.cgi?id=170328
3494         <rdar://problem/30904558>
3495
3496         Reviewed by Tim Horton.
3497
3498         When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the
3499         WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use
3500         this as a cue to notify the web process that the selection is being cleared out.
3501
3502         -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what
3503         the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange.
3504         However, in the case of character granularity selections, tapping away to clear the selection is handled by
3505         UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the
3506         selection should be cleared out.
3507
3508         Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html.
3509
3510         * UIProcess/ios/WKContentViewInteraction.mm:
3511         (-[WKContentView setSelectedTextRange:]):
3512
3513 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3514
3515         [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret
3516         https://bugs.webkit.org/show_bug.cgi?id=170327
3517         <rdar://problem/31363816>
3518
3519         Reviewed by Tim Horton.
3520
3521         Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures
3522         when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as
3523         single taps, from changing the selection when they should be allowed to.
3524
3525         Hooks into new UIKit SPI to make this tweak.
3526         Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html.
3527
3528         * UIProcess/ios/WKContentViewInteraction.mm:
3529         (-[WKContentView pointIsInAssistedNode:]):
3530         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3531
3532 2017-03-31  Tim Horton  <timothy_horton@apple.com>
3533
3534         Mail can get stuck underneath FindController::findStringMatches after searching in a long message
3535         https://bugs.webkit.org/show_bug.cgi?id=170326
3536         <rdar://problem/30330395>
3537
3538         Reviewed by Simon Fraser.
3539
3540         * UIProcess/mac/WKTextFinderClient.mm:
3541         (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
3542         Cap the number of find matches at 1000, the same maximum that Safari uses.
3543
3544 2017-03-31  Brady Eidson  <beidson@apple.com>
3545
3546         Clean up the "StorageType" enum.
3547         https://bugs.webkit.org/show_bug.cgi?id=170349
3548
3549         Reviewed by Tim Horton.
3550
3551         * WebProcess/Storage/StorageAreaMap.cpp:
3552         (WebKit::StorageAreaMap::StorageAreaMap):
3553         (WebKit::StorageAreaMap::dispatchStorageEvent):
3554         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3555         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3556         
3557         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3558         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
3559         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
3560         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
3561
3562 2017-03-31  Tim Horton  <timothy_horton@apple.com>
3563
3564         Remove bundle checks for attachmentElementEnabled
3565         https://bugs.webkit.org/show_bug.cgi?id=170329
3566         <rdar://problem/25135244>
3567
3568         Reviewed by Simon Fraser.
3569
3570         * UIProcess/API/Cocoa/WKWebView.mm:
3571         (-[WKWebView _initializeWithConfiguration:]):
3572         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3573         (-[WKWebViewConfiguration init]):
3574         Remove bundle checks.
3575
3576 2017-03-29  Anders Carlsson  <andersca@apple.com>
3577
3578         Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication
3579         https://bugs.webkit.org/show_bug.cgi?id=170257
3580         rdar://problem/31289764
3581
3582         Reviewed by Beth Dakin.
3583
3584         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3585         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
3586
3587 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
3588
3589         Mac cmake buildfix after r214403
3590         https://bugs.webkit.org/show_bug.cgi?id=170346
3591
3592         Unreviewed speculative buildfix.
3593
3594         * UIProcess/API/Cocoa/WKWebView.mm:
3595
3596 2017-03-31  Brady Eidson  <beidson@apple.com>
3597
3598         Remove erroneously committed changes from r214078
3599
3600         Unreviewed.
3601
3602         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3603         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops!
3604
3605 2017-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3606
3607         Modern media controls should never be enabled in non cocoa ports
3608         https://bugs.webkit.org/show_bug.cgi?id=170338
3609
3610         Reviewed by Michael Catanzaro.
3611
3612         It's currently enabled, because it uses the default value for all other runtime features, but modern media
3613         controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html
3614         started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it,
3615         though.
3616
3617         * Shared/WebPreferencesDefinitions.h:
3618
3619 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
3620
3621         Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the
3622         two WebKit2 dependency libraries to avoid WTF directiories being
3623         listed for inclusion before WebCore directories at compile-time.
3624
3625         * CMakeLists.txt:
3626
3627 2017-03-30  Megan Gardner  <megan_gardner@apple.com>
3628
3629         Allow for extended color in snapshots
3630         https://bugs.webkit.org/show_bug.cgi?id=170314
3631         <rdar://problem/28676092> WKImageCreateCGImage should support WideGamut in WebKit2 on macOS
3632
3633         Reviewed by Simon Fraser.
3634
3635         Piping options through snapshots to allow for wide gamut support.
3636
3637         * Shared/API/c/WKImage.h:
3638         * Shared/API/c/WKSharedAPICast.h:
3639         (WebKit::snapshotOptionsFromImageOptions):
3640         * Shared/ImageOptions.h:
3641         (WebKit::snapshotOptionsToImageOptions):
3642         * Shared/WebImage.cpp:
3643         (WebKit::WebImage::create):
3644
3645 2017-03-30  Sam Weinig  <sam@webkit.org>
3646
3647         Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI
3648         <rdar://problem/31350588>
3649         https://bugs.webkit.org/show_bug.cgi?id=170315
3650
3651         Reviewed by Simon Fraser.
3652
3653         * UIProcess/API/Cocoa/WKWebView.mm:
3654         (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
3655         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3656         Copy SPI to WKWebView. Remove 'with' prefix to match conventions.
3657
3658 2017-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3659
3660         [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active
3661         https://bugs.webkit.org/show_bug.cgi?id=170291
3662         <rdar://problem/31301388>
3663
3664         Reviewed by Tim Horton.
3665
3666         Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data
3667         interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when
3668         the view is not an active data interaction source.
3669
3670         New API test: DataInteractionTests.CustomActionSheetPopover.
3671
3672         * UIProcess/ios/WKContentViewInteraction.mm:
3673         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
3674
3675 2017-03-30  Youenn Fablet  <youenn@apple.com>
3676
3677         NetworkConnectionToWebProcess should stop web sockets when being destroyed
3678         https://bugs.webkit.org/show_bug.cgi?id=170286
3679
3680         Reviewed by Brady Eidson.
3681
3682         * NetworkProcess/NetworkSocketStream.cpp:
3683         (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already.
3684         * NetworkProcess/NetworkSocketStream.h:
3685
3686 2017-03-29  Tim Horton  <timothy_horton@apple.com>
3687
3688         Remove unused PageClient::removeNavigationGestureSnapshot
3689         https://bugs.webkit.org/show_bug.cgi?id=170249
3690
3691         Reviewed by Beth Dakin.
3692
3693         * UIProcess/PageClient.h:
3694         * UIProcess/WebPageProxy.cpp:
3695         (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted.
3696         * UIProcess/WebPageProxy.h:
3697         * UIProcess/mac/PageClientImpl.h:
3698         * UIProcess/mac/PageClientImpl.mm:
3699         (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted.
3700
3701 2017-03-29  Antti Koivisto  <antti@apple.com>
3702
3703         Increment the last stable network cache version on Mac
3704         https://bugs.webkit.org/show_bug.cgi?id=170248
3705         <rdar://problem/31326040>
3706
3707         Reviewed by Chris Dumez.
3708
3709         Bump to the latest release.
3710
3711         * NetworkProcess/cache/NetworkCacheStorage.h:
3712
3713 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
3714
3715         Stop overriding scroll view inset defaults
3716         https://bugs.webkit.org/show_bug.cgi?id=170221
3717         <rdar://problem/31260325>
3718
3719         Reviewed by Simon Fraser.
3720
3721         * Platform/spi/ios/UIKitSPI.h:
3722         * UIProcess/API/Cocoa/WKWebView.mm:
3723         (-[WKWebView _initializeWithConfiguration:]):
3724         The default behavior is sufficient for us.
3725
3726 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
3727
3728         Safari crashes when attempting to close tab that is displaying PDF
3729         https://bugs.webkit.org/show_bug.cgi?id=170201
3730         <rdar://problem/31242019>
3731
3732         Reviewed by Wenson Hsieh.
3733
3734         * UIProcess/API/Cocoa/WKWebView.mm:
3735         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
3736         Adopt BlockPtr to fix a leak.
3737
3738         (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
3739         dispatch_async in the doAfterNextPresentationUpdate callback; since this
3740         recursively calls itself, in cases where doAfterNextPresentationUpdate
3741         returns synchronously (e.g. if the Web Process is missing), we would
3742         recurse infinitely.
3743
3744 2017-03-27  Youenn Fablet  <youenn@apple.com>
3745
3746         Remove WebPage::m_shouldDoICECandidateFiltering
3747         https://bugs.webkit.org/show_bug.cgi?id=170150
3748
3749         Reviewed by Sam Weinig.
3750
3751         It is redundant with RTCController::m_shouldFilterICECandidates.
3752         Manually tested on webrtc test samples.
3753         This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt.
3754         Additional testing will be added as a follow-up patch.
3755
3756         * WebProcess/WebPage/WebPage.cpp:
3757         (WebKit::WebPage::disableICECandidateFiltering):
3758         (WebKit::WebPage::enableICECandidateFiltering):
3759         * WebProcess/WebPage/WebPage.h:
3760
3761 2017-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3762
3763         [WK2] UIKit assertion when rotating device after dismissing popover
3764         https://bugs.webkit.org/show_bug.cgi?id=170159
3765         <rdar://problem/31283829>
3766
3767         Reviewed by Tim Horton.
3768
3769         Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center.
3770
3771         * UIProcess/ios/WKActionSheet.mm:
3772         (-[WKActionSheet dealloc]):
3773         (-[WKActionSheet _cleanup]):
3774         (-[WKActionSheet doneWithSheet:]):
3775
3776 2017-03-27  Andy Estes  <aestes@apple.com>
3777
3778         [iOS] Suppress page count recalc when setting a snapshot paper rect
3779         https://bugs.webkit.org/show_bug.cgi?id=170156
3780         <rdar://problem/30787872>
3781
3782         Reviewed by Tim Horton.
3783
3784         When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper
3785         rect, which triggers UIKit to ask for the page count again while we're in the middle of
3786         printing, putting us in a bad state.
3787
3788         Suppress page count recalc while setting the new paper rect, since we know this will not
3789         cause it to change.
3790
3791         * UIProcess/_WKWebViewPrintFormatter.mm:
3792         (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set
3793         _suppressPageCountRecalc to YES before updating the paper rect.
3794         (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if
3795         _suppressPageCountRecalc is NO.
3796         * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc.
3797
3798 2017-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3799
3800         [WK2] Callout Bar should be dismissed during data interaction
3801         https://bugs.webkit.org/show_bug.cgi?id=170109
3802         <rdar://problem/31171570>
3803
3804         Reviewed by Tim Horton.
3805
3806         Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2.
3807
3808         * Platform/spi/ios/UIKitSPI.h:
3809
3810 2017-03-27  Keith Rollin  <krollin@apple.com>
3811
3812         Update NetworkResourceLoader logging statement
3813         https://bugs.webkit.org/show_bug.cgi?id=170126
3814
3815         Reviewed by Alex Christensen.
3816
3817         NetworkResourceLoader contains a logging statement that prints, in
3818         part: "start: Retrieving resource from cache". This is misleading,
3819         since it's not necessarily the case that the resource will be loaded
3820         from the cache. What is actually happening at the point where that is
3821         logged is that the cache is being checked for the resource. It still
3822         remains to be seen if the resource will be found in it. To address
3823         this, change the logging to say "start: Checking cache for resource".
3824
3825         * NetworkProcess/NetworkResourceLoader.cpp:
3826         (WebKit::NetworkResourceLoader::start):
3827
3828 2017-03-27  Joseph Pecoraro  <pecoraro@apple.com>
3829
3830         Web Inspector: Saving files should not suggest the top level directory
3831         https://bugs.webkit.org/show_bug.cgi?id=170085
3832         <rdar://problem/30197794>
3833
3834         Reviewed by Matt Baker.
3835
3836         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3837         (WebKit::RemoteWebInspectorProxy::platformSave):
3838         * UIProcess/mac/WebInspectorProxyMac.mm:
3839         (WebKit::WebInspectorProxy::platformSave):
3840         Don't set panel.directoryURL unless we have a good suggestion.
3841
3842 2017-03-27  Yongjun Zhang  <yongjun_zhang@apple.com>
3843
3844         Add delegate method to let an WebKit client provide a custom image preview controller.
3845         https://bugs.webkit.org/show_bug.cgi?id=170076
3846         rdar://problem/31153051
3847
3848         Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to
3849         WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image
3850         has alternated URL or custom image info.
3851
3852         Reviewed by Beth Dakin.
3853
3854         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:.
3855         * UIProcess/ios/WKContentViewInteraction.mm:
3856         (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided
3857             preview view controller. Otherwise, use the default WKImagePreviewViewController.
3858
3859 2017-03-27  Anders Carlsson  <andersca@apple.com>
3860
3861         Fix uses of deprecated API
3862         https://bugs.webkit.org/show_bug.cgi?id=170138
3863         rdar://problem/28882449
3864
3865         Reviewed by Tim Horton.
3866
3867         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3868         (WebKit::toPKContactFields):
3869         (WebKit::toPKAddressField):
3870         (WebKit::toPKPaymentRequest):
3871         Don't use deprecated APIs.
3872
3873         (WebKit::toNSError):
3874         Don't try to insert nil in a dictionary.
3875
3876 2017-03-27  Alex Christensen  <achristensen@webkit.org>
3877
3878         Make WebSockets work in network process
3879         https://bugs.webkit.org/show_bug.cgi?id=169930
3880
3881         Reviewed by Youenn Fablet.
3882
3883         This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous 
3884         messages to a NetworkSocketStream in the NetworkProcess.  WebKit1 uses a SocketStreamHandleImpl
3885         still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the 
3886         NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back
3887         to the WebProcess.  WebSocketStream's implementation of SocketStreamHandle::platformSend is special
3888         because it stores the completion handler in a map and asynchronously reports to the caller whether
3889         it succeeded or not.  If the network processes crashes before the completion handlers are called,
3890         then they are called indicating failure and an error is reported, but that never happens, right?
3891
3892         * CMakeLists.txt:
3893         * DerivedSources.make:
3894         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3895         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
3896         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
3897         (WebKit::NetworkConnectionToWebProcess::destroySocketStream):
3898         * NetworkProcess/NetworkConnectionToWebProcess.h:
3899         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3900         * NetworkProcess/NetworkProcess.cpp:
3901         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
3902         * NetworkProcess/NetworkProcess.h:
3903         * NetworkProcess/NetworkProcess.messages.in:
3904         * NetworkProcess/NetworkSocketStream.cpp: Added.
3905         (WebKit::NetworkSocketStream::create):
3906         (WebKit::NetworkSocketStream::NetworkSocketStream):
3907         (WebKit::NetworkSocketStream::sendData):
3908         (WebKit::NetworkSocketStream::close):
3909         (WebKit::NetworkSocketStream::didOpenSocketStream):
3910         (WebKit::NetworkSocketStream::didCloseSocketStream):
3911         (WebKit::NetworkSocketStream::didReceiveSocketStreamData):
3912         (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData):
3913         (WebKit::NetworkSocketStream::didUpdateBufferedAmount):
3914         (WebKit::NetworkSocketStream::didFailSocketStream):
3915         (WebKit::NetworkSocketStream::messageSenderConnection):
3916         (WebKit::NetworkSocketStream::messageSenderDestinationID):
3917         * NetworkProcess/NetworkSocketStream.h: Added.
3918         * NetworkProcess/NetworkSocketStream.messages.in: Added.
3919         * UIProcess/API/C/WKContext.cpp:
3920         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
3921         (WKContextTerminateNetworkProcess):
3922         * UIProcess/API/C/WKContextPrivate.h:
3923         * UIProcess/WebProcessPool.cpp:
3924         (WebKit::WebProcessPool::sendSyncToNetworkingProcess):
3925         (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket):
3926         (WebKit::WebProcessPool::terminateNetworkProcess):
3927         * UIProcess/WebProcessPool.h:
3928         * WebKit2.xcodeproj/project.pbxproj:
3929         * WebProcess/Network/NetworkProcessConnection.cpp:
3930         (WebKit::NetworkProcessConnection::didReceiveMessage):
3931         * WebProcess/Network/WebSocketProvider.cpp:
3932         (WebKit::WebSocketProvider::createSocketStreamHandle):
3933         * WebProcess/Network/WebSocketStream.cpp: Added.
3934         (WebKit::globalWebSocketStreamMap):
3935         (WebKit::WebSocketStream::streamWithIdentifier):
3936         (WebKit::WebSocketStream::networkProcessCrashed):
3937         (WebKit::WebSocketStream::create):
3938         (WebKit::WebSocketStream::WebSocketStream):
3939         (WebKit::WebSocketStream::~WebSocketStream):
3940         (WebKit::WebSocketStream::messageSenderConnection):
3941         (WebKit::WebSocketStream::messageSenderDestinationID):
3942         (WebKit::WebSocketStream::platformSend):
3943         (WebKit::WebSocketStream::didSendData):
3944         (WebKit::WebSocketStream::platformClose):
3945         (WebKit::WebSocketStream::bufferedAmount):
3946         (WebKit::WebSocketStream::didOpenSocketStream):
3947         (WebKit::WebSocketStream::didCloseSocketStream):
3948         (WebKit::WebSocketStream::didReceiveSocketStreamData):
3949         (WebKit::WebSocketStream::didFailToReceiveSocketStreamData):
3950         (WebKit::WebSocketStream::didUpdateBufferedAmount):
3951         (WebKit::WebSocketStream::didFailSocketStream):
3952         * WebProcess/Network/WebSocketStream.h: Added.
3953         * WebProcess/Network/WebSocketStream.messages.in: Added.
3954         * WebProcess/WebProcess.cpp:
3955         (WebKit::WebProcess::networkProcessConnectionClosed):
3956
3957 2017-03-27  Adrian Perez de Castro  <aperez@igalia.com>
3958
3959         [GTK] NetscapePluginX11::m_windowID is unused/unneeded
3960         https://bugs.webkit.org/show_bug.cgi?id=170115
3961
3962         Reviewed by Michael Catanzaro.
3963
3964         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3965         (WebKit::NetscapePluginX11::NetscapePluginX11):
3966         Remove the unneeded NetscapePluginX11::m_windowID member.
3967         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
3968         Remove the unneeded NetscapePluginX11::m_windowID member.
3969
3970 2017-03-25  Andy Estes  <aestes@apple.com>
3971
3972         [iOS] Use snapshotting instead of printing to draw single-page PDFs
3973         https://bugs.webkit.org/show_bug.cgi?id=170103
3974         <rdar://problem/30542960>
3975
3976         Reviewed by Tim Horton.
3977
3978         * WebProcess/WebPage/WebPage.cpp:
3979         (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here.
3980         (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the
3981         WebImage's graphics context.
3982         (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to
3983         paintSnapshotAtSize(), and returned the context's data.
3984         * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed
3985         their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize().
3986         * WebProcess/WebPage/ios/WebPageIOS.mm:
3987         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page,
3988         returned a page count of 1 and created a PDF using pdfSnapshotAtSize().
3989
3990 2017-03-25  John Wilander  <wilander@apple.com>
3991
3992         Re-enable the web process' keychain access to fix client certificate authentication
3993         https://bugs.webkit.org/show_bug.cgi?id=170074
3994         <rdar://problem/31095987>
3995
3996         Reviewed by Brent Fulgham.
3997
3998         This is a follow-up patch to
3999         https://trac.webkit.org/changeset/214389/webkit
4000         since according to Alexey Proskuryakov, resource
4001         loading has always required identical sandbox
4002         rules in WebContent and Networking processes.
4003
4004         * WebProcess/com.apple.WebProcess.sb.in:
4005             Reverted remaining change from
4006             https://trac.webkit.org/changeset/208702/webkit and
4007             https://trac.webkit.org/changeset/208707/webkit.
4008
4009 2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>
4010
4011         [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
4012         https://bugs.webkit.org/show_bug.cgi?id=169168
4013         <rdar://problem/30688374>
4014
4015         Reviewed by Tim Horton.
4016
4017         Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate
4018         that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the
4019         DragData sent over to the web process, where they update DragController's view of the allowed destination actions.
4020
4021         Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad,
4022         though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate
4023         any compatibility risk.
4024
4025         * Shared/API/Cocoa/WKDragDestinationAction.h:
4026
4027         Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags.
4028
4029         * Shared/WebCoreArgumentCoders.cpp:
4030         (IPC::ArgumentCoder<DragData>::encode):
4031         (IPC::ArgumentCoder<DragData>::decode):
4032
4033         Serialize DragData's destination actions when sending DragData over IPC.
4034
4035         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
4036         * UIProcess/API/Cocoa/WKWebView.mm:
4037         (-[WKWebView _web_dragDestinationActionForDraggingInfo:]):
4038
4039         For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate).
4040
4041         * UIProcess/API/mac/WKView.mm:
4042         (-[WKView _web_dragDestinationActionForDraggingInfo:]):
4043
4044         For WKView, allow all types of drag destination actions.
4045
4046         * UIProcess/Cocoa/VersionChecks.h:
4047         * UIProcess/Cocoa/WebViewImpl.h:
4048         * UIProcess/Cocoa/WebViewImpl.mm:
4049         (WebKit::WebViewImpl::draggingEntered):
4050         (WebKit::WebViewImpl::draggingUpdated):
4051         * WebKit2.xcodeproj/project.pbxproj:
4052         * WebProcess/WebCoreSupport/WebDragClient.cpp:
4053         (WebKit::WebDragClient::actionMaskForDrag):
4054         * WebProcess/WebCoreSupport/WebDragClient.h:
4055
4056 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
4057
4058         [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates
4059         https://bugs.webkit.org/show_bug.cgi?id=170091
4060         rdar://problem/30682584
4061
4062         Reviewed by Tim Horton.
4063         
4064         [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another