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