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