Unreviewed, rolling out r227437.
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-01-23  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r227437.
4         https://bugs.webkit.org/show_bug.cgi?id=182011
5
6         broke build (Requested by alexchristensen on #webkit).
7
8         Reverted changeset:
9
10         "Remove unused QTKit preference"
11         https://bugs.webkit.org/show_bug.cgi?id=181968
12         https://trac.webkit.org/changeset/227437
13
14 2018-01-23  Alex Christensen  <achristensen@webkit.org>
15
16         Remove compile guard around beacon API
17         https://bugs.webkit.org/show_bug.cgi?id=182002
18
19         Reviewed by Sam Weinig.
20
21         It's enabled everywhere now.
22
23         * Shared/WebPreferences.yaml:
24         * UIProcess/API/C/WKPreferences.cpp:
25         (WKPreferencesSetBeaconAPIEnabled):
26         (WKPreferencesGetBeaconAPIEnabled):
27         * config.h:
28
29 2018-01-23  Alex Christensen  <achristensen@webkit.org>
30
31         Remove unused QTKit preference
32         https://bugs.webkit.org/show_bug.cgi?id=181968
33
34         Reviewed by Alexey Proskuryakov.
35
36         * Shared/API/c/WKDeprecatedFunctions.cpp:
37         (WKPreferencesSetQTKitEnabled):
38         (WKPreferencesGetQTKitEnabled):
39         * Shared/WebPreferences.yaml:
40         * UIProcess/API/C/WKPreferences.cpp:
41         (WKPreferencesSetQTKitEnabled): Deleted.
42         (WKPreferencesGetQTKitEnabled): Deleted.
43         * UIProcess/API/Cocoa/WKPreferences.mm:
44         (-[WKPreferences _setQTKitEnabled:]): Deleted.
45         (-[WKPreferences _qtKitEnabled]): Deleted.
46         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
47
48 2018-01-23  Brent Fulgham  <bfulgham@apple.com>
49
50         [macOS] WebProcess needs TCC entitlements for media capture
51         https://bugs.webkit.org/show_bug.cgi?id=181995
52         <rdar://problem/36674649>
53
54         Reviewed by Eric Carlson.
55
56         * Configurations/WebContent-OSX.entitlements: Add delegated services needed to support media
57         capture features.
58
59 2018-01-23  Dan Bernstein  <mitz@apple.com>
60
61         [Cocoa] Disable header postprocessing when building for macOS High Sierra
62         https://bugs.webkit.org/show_bug.cgi?id=181972
63
64         Reviewed by Anders Carlsson.
65
66         * Configurations/WebKit.xcconfig: Adopt macOSTargetConditionals.xcconfig helpers and disable postprocessing
67           when building for macOS 10.13.
68
69 2018-01-23  Joseph Pecoraro  <pecoraro@apple.com>
70
71         Web Inspector: Window resizing is broken after detaching to separate window
72         https://bugs.webkit.org/show_bug.cgi?id=181992
73         <rdar://problem/36714840>
74
75         Reviewed by Brian Burg.
76
77         * UIProcess/mac/WebInspectorProxyMac.mm:
78         (WebKit::WebInspectorProxy::platformDetach):
79         Restore the inspector view's autoresizingMask to the initial value
80         that works with a detached window. This gets changed when the view
81         gets attached to bottom/side, so we need to revert it on detaching.
82
83 2018-01-23  Brady Eidson  <beidson@apple.com>
84
85         Allow passing MessagePorts across processes (e.g. ServiceWorkers).
86         https://bugs.webkit.org/show_bug.cgi?id=181178
87
88         Reviewed by Andy Estes.
89
90         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
91         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
92         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
93         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
94         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
95
96         * StorageProcess/StorageProcess.cpp:
97         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
98         * StorageProcess/StorageProcess.h:
99         * StorageProcess/StorageProcess.messages.in:
100
101         * UIProcess/WebProcessProxy.cpp:
102         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
103         (WebKit::WebProcessProxy::postMessageToRemote):
104
105         * WebProcess/Storage/WebSWClientConnection.cpp:
106         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
107         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
108         * WebProcess/Storage/WebSWClientConnection.h:
109         * WebProcess/Storage/WebSWClientConnection.messages.in:
110
111         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
112         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
113         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
114         * WebProcess/Storage/WebSWContextManagerConnection.h:
115         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
116
117 2018-01-23  Commit Queue  <commit-queue@webkit.org>
118
119         Unreviewed, rolling out r227279 and r227373.
120         https://bugs.webkit.org/show_bug.cgi?id=181988
121
122         The LayoutTest crash fix introduced an API test failure.
123         (Requested by ryanhaddad on #webkit).
124
125         Reverted changesets:
126
127         "Resign NowPlaying status when no media element is eligible"
128         https://bugs.webkit.org/show_bug.cgi?id=181914
129         https://trac.webkit.org/changeset/227279
130
131         "Resign NowPlaying status when no media element is eligible"
132         https://bugs.webkit.org/show_bug.cgi?id=181914
133         https://trac.webkit.org/changeset/227373
134
135 2018-01-23  Youenn Fablet  <youenn@apple.com>
136
137         REGRESSION (r227348): ASSERT_NOT_REACHED in WebKit::ServiceWorkerClientFetch::didFinish()
138         https://bugs.webkit.org/show_bug.cgi?id=181956
139         <rdar://problem/36755492>
140
141         Reviewed by Chris Dumez.
142
143         Covered by test no longer crashing in Debug builds.
144         Reset m_redirectionStatus to None when starting an SW fetch.
145
146         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
147         (WebKit::ServiceWorkerClientFetch::start):
148         (WebKit::ServiceWorkerClientFetch::didFinish):
149
150 2018-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
151
152         [WPE] TestWebKitFindController asserts
153         https://bugs.webkit.org/show_bug.cgi?id=181472
154
155         Reviewed by Carlos Garcia Campos.
156
157         Let's fix this in two independent ways.
158
159         First, use a GRefPtr to hold ownership of the WebKitWebViewBackend. This way, we don't need
160         to change the order in which WebKitWebView destroys its priv struct members from what is
161         used in WebKitGTK+, which can lead to odd bugs.
162
163         Additionally, just for good measure, stop resetting the find client when disposing
164         WebKitFindController. This is unnecessary because it will never be destroyed before the
165         WebKitWebView.
166
167         * UIProcess/API/glib/WebKitFindController.cpp:
168         (webkit_find_controller_class_init):
169         (webkitFindControllerDispose): Deleted.
170         * UIProcess/API/glib/WebKitWebView.cpp:
171         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
172         (webkitWebViewSetProperty):
173         (webkitWebViewGetProperty):
174         (webkitWebViewCreatePage):
175         (webkit_web_view_get_backend):
176         * UIProcess/API/wpe/WebKitWebViewBackend.cpp:
177         (webkitWebViewBackendCreateDefault):
178         (WTF::refGPtr):
179         (WTF::derefGPtr):
180         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:
181
182 2018-01-22  Jon Lee  <jonlee@apple.com>
183
184         Update title label size
185         https://bugs.webkit.org/show_bug.cgi?id=181962
186         rdar://problem/36754744
187
188         Reviewed by Simon Fraser.
189
190         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
191         (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into
192         createSubviews.
193         (-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons.
194         Refer to a const CGFloat for the font size.
195
196 2018-01-22  Megan Gardner  <megan_gardner@apple.com>
197
198         Temporarily restore block selection code conditionally
199         https://bugs.webkit.org/show_bug.cgi?id=181895
200         <rdar://problem/36567325>
201
202         Reviewed by Tim Horton.
203
204         We need to restore this code temporarily to avoid a crash.
205
206         * Platform/spi/ios/UIKitSPI.h:
207         * UIProcess/ios/WKContentViewInteraction.mm:
208         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
209
210 2018-01-22  Zach Li  <zacharyli323@gmail.com>
211
212         We should not try to link against the Safe Browsing framework on watchOS and tvOS.
213         https://bugs.webkit.org/show_bug.cgi?id=181965.
214
215         Reviewed by Tim Horton.
216
217         * Configurations/WebKit.xcconfig:
218
219 2018-01-22  Alex Christensen  <achristensen@webkit.org>
220
221         Remove pre-NetworkSession loading code
222         https://bugs.webkit.org/show_bug.cgi?id=181944
223
224         Reviewed by Tim Horton.
225
226         We were keeping it around for El Capitan.
227
228         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
229         (WebKit::LegacyCustomProtocolManager::registerProtocolClass):
230         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
231         (WebKit::LegacyCustomProtocolManager::initialize):
232         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
233         * NetworkProcess/Downloads/BlobDownloadClient.cpp: Removed.
234         * NetworkProcess/Downloads/BlobDownloadClient.h: Removed.
235         * NetworkProcess/Downloads/Download.cpp:
236         (WebKit::Download::~Download):
237         (WebKit::Download::cancel):
238         (WebKit::Download::didReceiveChallenge):
239         (WebKit::Download::didFinish):
240         (WebKit::Download::isAlwaysOnLoggingAllowed const):
241         (WebKit::Download::start): Deleted.
242         (WebKit::Download::startWithHandle): Deleted.
243         (WebKit::Download::didStart): Deleted.
244         (WebKit::Download::willSendRedirectedRequest): Deleted.
245         (WebKit::Download::didReceiveAuthenticationChallenge): Deleted.
246         (WebKit::Download::didReceiveResponse): Deleted.
247         (WebKit::Download::shouldDecodeSourceDataOfMIMEType): Deleted.
248         (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
249         (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): Deleted.
250         (WebKit::Download::didDecideDownloadDestination): Deleted.
251         (WebKit::Download::continueDidReceiveResponse): Deleted.
252         * NetworkProcess/Downloads/Download.h:
253         (WebKit::Download::setBlobFileReferences): Deleted.
254         (WebKit::Download::request const): Deleted.
255         * NetworkProcess/Downloads/DownloadManager.cpp:
256         (WebKit::DownloadManager::startDownload):
257         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
258         (WebKit::DownloadManager::convertNetworkLoadToDownload):
259         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
260         (WebKit::DownloadManager::resumeDownload):
261         (WebKit::DownloadManager::cancelDownload):
262         * NetworkProcess/Downloads/DownloadManager.h:
263         (WebKit::DownloadManager::startDownload):
264         * NetworkProcess/Downloads/PendingDownload.cpp:
265         * NetworkProcess/Downloads/PendingDownload.h:
266         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
267         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
268         * NetworkProcess/Downloads/mac/DownloadMac.mm: Removed.
269         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
270         * NetworkProcess/NetworkCORSPreflightChecker.h:
271         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
272         (WebKit::NetworkConnectionToWebProcess::loadPing):
273         * NetworkProcess/NetworkDataTask.cpp:
274         * NetworkProcess/NetworkDataTask.h:
275         * NetworkProcess/NetworkDataTaskBlob.cpp:
276         * NetworkProcess/NetworkDataTaskBlob.h:
277         * NetworkProcess/NetworkLoad.cpp:
278         (WebKit::NetworkLoad::~NetworkLoad):
279         (WebKit::NetworkLoad::setDefersLoading):
280         (WebKit::NetworkLoad::cancel):
281         (WebKit::NetworkLoad::continueWillSendRequest):
282         (WebKit::NetworkLoad::continueDidReceiveResponse):
283         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics const):
284         (WebKit::NetworkLoad::didReceiveResponseAsync): Deleted.
285         (WebKit::NetworkLoad::didReceiveBuffer): Deleted.
286         (WebKit::NetworkLoad::didFinishLoading): Deleted.
287         (WebKit::NetworkLoad::didFail): Deleted.
288         (WebKit::NetworkLoad::willSendRequestAsync): Deleted.
289         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
290         (WebKit::NetworkLoad::shouldUseCredentialStorage): Deleted.
291         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Deleted.
292         (WebKit::NetworkLoad::receivedCancellation): Deleted.
293         * NetworkProcess/NetworkLoad.h:
294         * NetworkProcess/NetworkLoadParameters.h:
295         * NetworkProcess/NetworkProcess.cpp:
296         (WebKit::NetworkProcess::initializeNetworkProcess):
297         (WebKit::NetworkProcess::clearCachedCredentials):
298         (WebKit::NetworkProcess::findPendingDownloadLocation):
299         * NetworkProcess/NetworkProcess.h:
300         * NetworkProcess/NetworkProcess.messages.in:
301         * NetworkProcess/NetworkResourceLoader.cpp:
302         (WebKit::NetworkResourceLoader::startNetworkLoad):
303         * NetworkProcess/NetworkSession.cpp:
304         * NetworkProcess/NetworkSession.h:
305         * NetworkProcess/PingLoad.cpp:
306         * NetworkProcess/PingLoad.h:
307         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
308         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
309         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
310         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
311         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
312         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
313         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
314         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
315         * NetworkProcess/mac/NetworkLoadMac.mm: Removed.
316         * NetworkProcess/mac/RemoteNetworkingContext.mm:
317         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
318         * Shared/Authentication/AuthenticationManager.cpp:
319         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
320         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
321         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
322         (WebKit::AuthenticationManager::cancelSingleChallenge):
323         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
324         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
325         * Shared/Authentication/AuthenticationManager.h:
326         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Removed.
327         * Shared/SessionTracker.cpp:
328         (WebKit::SessionTracker::setSession):
329         (WebKit::SessionTracker::destroySession):
330         * Shared/SessionTracker.h:
331         * Shared/mac/CookieStorageShim.h: Removed.
332         * Shared/mac/CookieStorageShim.mm: Removed.
333         * UIProcess/API/APIDownloadClient.h:
334         (API::DownloadClient::didReceiveData):
335         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
336         * UIProcess/API/C/WKContext.cpp:
337         (WKContextSetDownloadClient):
338         * UIProcess/Cocoa/DownloadClient.h:
339         * UIProcess/Cocoa/DownloadClient.mm:
340         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
341         * UIProcess/Downloads/DownloadProxy.cpp:
342         (WebKit::DownloadProxy::willSendRequest):
343         (WebKit::DownloadProxy::didReceiveResponse):
344         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): Deleted.
345         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Deleted.
346         * UIProcess/Downloads/DownloadProxy.h:
347         * UIProcess/Downloads/DownloadProxy.messages.in:
348         * WebKit.xcodeproj/project.pbxproj:
349         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
350         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
351         * WebProcess/WebProcess.cpp:
352         (WebKit::WebProcess::initializeWebProcess):
353         (WebKit::WebProcess::clearCachedCredentials):
354         * config.h:
355
356 2018-01-22  Youenn Fablet  <youenn@apple.com>
357
358         SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
359         https://bugs.webkit.org/show_bug.cgi?id=181942
360         <rdar://problem/35132091>
361
362         Reviewed by Chris Dumez.
363
364         Add ServiceWorkerRegistrations and DOMCache as persistent data to be cleared according ITP decisions.
365
366         * UIProcess/WebResourceLoadStatisticsStore.cpp:
367         (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
368
369 2018-01-22  Chris Dumez  <cdumez@apple.com>
370
371         Add release logging to help debug issues related to service workers
372         https://bugs.webkit.org/show_bug.cgi?id=181935
373         <rdar://problem/36735900>
374
375         Reviewed by Brady Eidson.
376
377         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
378         (WebKit::WebSWServerConnection::startFetch):
379         (WebKit::WebSWServerConnection::didFinishFetch):
380         (WebKit::WebSWServerConnection::didFailFetch):
381         (WebKit::WebSWServerConnection::didNotHandleFetch):
382
383 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
384
385         [iOS] REGRESSION (r225763): Allow access to power logging features
386         https://bugs.webkit.org/show_bug.cgi?id=181938
387         <rdar://problem/36442803>
388
389         Reviewed by Eric Carlson.
390
391         I denied access to the powerlog facility in r225763, not realizing that it
392         gets activated in certain logging scenarios. This patch reverts this change.
393
394         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
395
396 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
397
398         [macOS, iOS] Allow accss to AVFoundation preference
399         https://bugs.webkit.org/show_bug.cgi?id=181937
400         <rdar://problem/33137029>
401
402         Reviewed by Eric Carlson.
403
404         Grant access to the 'com.apple.avfoundation.frecents' preference.
405
406         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
407         * WebProcess/com.apple.WebProcess.sb.in:
408
409 2018-01-22  Brady Eidson  <beidson@apple.com>
410
411         In WebKit2, make the MessagePortChannelRegistry live in the UI process.
412         https://bugs.webkit.org/show_bug.cgi?id=181922
413
414         Reviewed by Andy Estes.
415
416         With all of the work that went into making MessagePorts be fully asynchronous
417         and to be process-aware, formally moving them out-of-process is just a matter
418         of adding WebKit IPC layers.
419         
420         The basic unit of asynchronicity is "MessagePortChannelProvider", and this patch
421         adds both a WebMessagePortChannelProvider and UIMessagePortChannelProvider for
422         each side of the process divide.
423         
424         * UIProcess/UIMessagePortChannelProvider.cpp: Added.
425         (WebKit::UIMessagePortChannelProvider::singleton):
426         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
427         (WebKit::UIMessagePortChannelProvider::~UIMessagePortChannelProvider):
428         (WebKit::UIMessagePortChannelProvider::createNewMessagePortChannel):
429         (WebKit::UIMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
430         (WebKit::UIMessagePortChannelProvider::messagePortDisentangled):
431         (WebKit::UIMessagePortChannelProvider::messagePortClosed):
432         (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
433         (WebKit::UIMessagePortChannelProvider::postMessageToRemote):
434         (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
435         (WebKit::UIMessagePortChannelProvider::checkProcessLocalPortForActivity):
436         * UIProcess/UIMessagePortChannelProvider.h: Added.
437         (WebKit::UIMessagePortChannelProvider::registry):
438
439         * UIProcess/WebPageProxy.cpp:
440         (WebKit::m_configurationPreferenceValues):
441
442         * UIProcess/WebProcessProxy.cpp:
443         (WebKit::WebProcessProxy::processForIdentifier):
444         (WebKit::m_userMediaCaptureManagerProxy):
445         (WebKit::WebProcessProxy::~WebProcessProxy):
446         (WebKit::WebProcessProxy::shutDown):
447         (WebKit::WebProcessProxy::createNewMessagePortChannel):
448         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
449         (WebKit::WebProcessProxy::messagePortDisentangled):
450         (WebKit::WebProcessProxy::messagePortClosed):
451         (WebKit::WebProcessProxy::takeAllMessagesForPort):
452         (WebKit::WebProcessProxy::didDeliverMessagePortMessages):
453         (WebKit::WebProcessProxy::postMessageToRemote):
454         (WebKit::WebProcessProxy::checkRemotePortForActivity):
455         (WebKit::WebProcessProxy::checkProcessLocalPortForActivity):
456         (WebKit::WebProcessProxy::didCheckProcessLocalPortForActivity):
457         * UIProcess/WebProcessProxy.h:
458         * UIProcess/WebProcessProxy.messages.in:
459
460         * WebKit.xcodeproj/project.pbxproj:
461
462         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: Added.
463         (WebKit::WebMessagePortChannelProvider::singleton):
464         (WebKit::WebMessagePortChannelProvider::WebMessagePortChannelProvider):
465         (WebKit::WebMessagePortChannelProvider::~WebMessagePortChannelProvider):
466         (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
467         (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
468         (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
469         (WebKit::WebMessagePortChannelProvider::messagePortClosed):
470         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
471         (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
472         (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
473         (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
474         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
475         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
476         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Added.
477
478         * WebProcess/WebProcess.cpp:
479         (WebKit::WebProcess::initializeProcess):
480         (WebKit::WebProcess::didTakeAllMessagesForPort):
481         (WebKit::WebProcess::checkProcessLocalPortForActivity):
482         (WebKit::WebProcess::didCheckRemotePortForActivity):
483         (WebKit::WebProcess::messagesAvailableForPort):
484         * WebProcess/WebProcess.h:
485         * WebProcess/WebProcess.messages.in:
486
487 2018-01-22  Youenn Fablet  <youenn@apple.com>
488
489         Bump default cache storage quota to 50MB
490         https://bugs.webkit.org/show_bug.cgi?id=181924
491
492         Reviewed by Chris Dumez.
493
494         Existing web sites use more than 20 MB.
495
496         * UIProcess/WebsiteData/WebsiteDataStore.h:
497
498 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
499
500         Unreviewed build fix after r227292. Fixing a bad copy-paste that broke
501         the GTK+ debug builds.
502
503         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
504         (WebKit::convertCairoSurfaceToShareableBitmap):
505
506 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
507
508         [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
509         https://bugs.webkit.org/show_bug.cgi?id=181930
510
511         Reviewed by Carlos Garcia Campos.
512
513         Call sites of the PlatformContextCairo::drawSurfaceToContext() method
514         are adjusted to now call Cairo::drawSurface() and properly pass the
515         PlatformContextCairo object to the function.
516
517         * Shared/cairo/ShareableBitmapCairo.cpp:
518         (WebKit::ShareableBitmap::paint):
519         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
520         (WebKit::convertCairoSurfaceToShareableBitmap):
521
522 2018-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
523
524         Unreviewed. Fix compile warning.
525
526         Use #include instead of #import in cross-platform code.
527
528         * Shared/WebPreferencesDefaultValues.cpp:
529
530 2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
531
532         Turning off custom pasteboard data doesn't actually turn it off in WK2
533         https://bugs.webkit.org/show_bug.cgi?id=181920
534         <rdar://problem/36686429>
535
536         Reviewed by Wenson Hsieh.
537
538         Moved the code to decide when to enable custom pasteboard data from WebCore
539         since we never enable this feature in WebKit1.
540
541         * Shared/WebPreferences.yaml:
542         * Shared/WebPreferencesDefaultValues.cpp:
543         (defaultCustomPasteboardDataEnabled): Added.
544         * Shared/WebPreferencesDefaultValues.h:
545
546 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
547
548         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
549         https://bugs.webkit.org/show_bug.cgi?id=181918
550
551         Reviewed by Tim Horton.
552
553         Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).
554
555         * Configurations/FeatureDefines.xcconfig:
556
557 2018-01-21  Eric Carlson  <eric.carlson@apple.com>
558
559         Resign NowPlaying status when no media element is eligible
560         https://bugs.webkit.org/show_bug.cgi?id=181914
561         <rdar://problem/35294116>
562
563         Reviewed by Jer Noble.
564
565         * UIProcess/API/Cocoa/WKWebView.mm:
566         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
567         status.
568         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
569
570         * UIProcess/WebPageProxy.cpp:
571         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
572         * UIProcess/WebPageProxy.h:
573         * UIProcess/WebPageProxy.messages.in:
574         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
575         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
576
577 2018-01-20  Andy Estes  <aestes@apple.com>
578
579         [Apple Pay] Stop eagerly loading PassKit.framework
580         https://bugs.webkit.org/show_bug.cgi?id=181911
581         <rdar://problem/36555369>
582
583         Reviewed by Tim Horton.
584
585         * Shared/WebPageCreationParameters.cpp:
586         (WebKit::WebPageCreationParameters::encode const):
587         (WebKit::WebPageCreationParameters::decode):
588         * Shared/WebPageCreationParameters.h:
589
590         Removed availablePaymentNetworks from WebPageCreationParameters.
591
592         * UIProcess/API/C/WKPreferences.cpp:
593         (WKPreferencesSetApplePayEnabled):
594         * UIProcess/API/Cocoa/WKWebView.mm:
595         (-[WKWebView _initializeWithConfiguration:]):
596
597         Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments().
598
599         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
600         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
601         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
602         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
603
604         Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment
605         networks.
606
607         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
608         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
609
610         Returned false if PassKitLibrary() fails.
611
612         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
613         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
614
615         Called completionHandler with false if PassKitLibrary() fails.
616
617         (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
618         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
619
620         Renamed availablePaymentNetworks to platformAvailablePaymentNetworks
621
622         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted.
623
624         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
625         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
626
627         Called completionHandler with false if PassKitLibrary() fails.
628
629         * UIProcess/WebPageProxy.cpp:
630         (WebKit::WebPageProxy::creationParameters):
631
632         Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks().
633
634         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
635         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
636         (WebKit::WebPaymentCoordinator::validatedPaymentNetwork):
637         * WebProcess/ApplePay/WebPaymentCoordinator.h:
638
639         Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks
640         starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync
641         message the first time it's accessed.
642
643         * WebProcess/WebPage/WebPage.cpp:
644         (WebKit::WebPage::WebPage):
645
646         Stopped setting PageConfiguration::availablePaymentNetworks.
647
648 2018-01-20  Jer Noble  <jer.noble@apple.com>
649
650         Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
651         https://bugs.webkit.org/show_bug.cgi?id=181840
652         <rdar://problem/36186214>
653
654         Reviewed by Simon Fraser.
655
656         Updating layout while the document is suspended or stopped is unsafe.
657
658         * WebProcess/cocoa/VideoFullscreenManager.mm:
659         (WebKit::inlineVideoFrame):
660
661 2018-01-20  Chris Dumez  <cdumez@apple.com>
662
663         DOMCache data sometimes not properly removed when clearing data for a given origin
664         https://bugs.webkit.org/show_bug.cgi?id=181887
665         <rdar://problem/36671239>
666
667         Reviewed by Youenn Fablet.
668
669         * NetworkProcess/cache/CacheStorageEngine.cpp:
670         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
671         This code was iterating through folders on disk, then reading the folder's origin
672         from the origin file on disk. Then, if the origin would match the one we want to
673         delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
674         I don't know how but on my machine, I was ended up in a state where the path
675         generated by cachesRootPath(*folderOrigin) differed from the actual folder path
676         we read the origin from (Likely a different salt?). To make the code more robust,
677         I updated the code to delete "folderPath", which is the path we read the origin
678         from.
679
680 2018-01-19  Zach Li  <zacharyli323@gmail.com>
681
682         Expose Safe Browsing SPI
683         https://bugs.webkit.org/show_bug.cgi?id=181804
684         <rdar://problem/36626946>
685
686         Reviewed by Dan Bernstein.
687
688         If client is using Apple internal SDK, then we can just import the header; if not,
689         then we declare necessary symbols that client will need.
690
691         * Configurations/WebKit.xcconfig:
692         Only link against SafariSafeBrowsing framework on macOS High Sierra
693         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
694         because it is not present on the Base system.
695
696         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
697
698         * WebKit.xcodeproj/project.pbxproj:
699         Added SafeBrowsingSPI.h.
700
701         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
702         Added.
703
704 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
705
706         Unreviewed build fix, removed unused lambda capture.
707
708         * UIProcess/WebResourceLoadStatisticsStore.cpp:
709         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
710
711 2018-01-19  John Wilander  <wilander@apple.com>
712
713         Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test
714         https://bugs.webkit.org/show_bug.cgi?id=181890
715         <rdar://problem/36674772>
716
717         Unreviewed API test fix.
718
719         * UIProcess/WebResourceLoadStatisticsStore.cpp:
720         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
721
722 2018-01-19  Youenn Fablet  <youenn@apple.com>
723
724         Do not go to the storage process when registering a service worker client if there is no service worker registered
725         https://bugs.webkit.org/show_bug.cgi?id=181740
726         <rdar://problem/36650400>
727
728         Reviewed by Chris Dumez.
729
730         UIProcess notifies all web processes to register their service worker clients when spinning the service worker process.
731         Add private API to set the number of web processes for testing purposes.
732
733         * UIProcess/API/Cocoa/WKProcessPool.mm:
734         (-[WKProcessPool _setMaximumNumberOfProcesses:]):
735         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
736         * UIProcess/WebProcessPool.cpp:
737         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
738         * WebProcess/WebProcess.cpp:
739         (WebKit::WebProcess::registerServiceWorkerClients):
740         * WebProcess/WebProcess.h:
741         * WebProcess/WebProcess.messages.in:
742
743 2018-01-19  Dean Jackson  <dino@apple.com>
744
745         REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
746         https://bugs.webkit.org/show_bug.cgi?id=181817
747         <rdar://problem/35274055>
748
749         Reviewed by Simon Fraser.
750
751         Add a linked-on-or-after check to set passive touch listeners on document in WebCore.
752
753         * CMakeLists.txt:
754         * Shared/WebPreferences.yaml:
755         * Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h.
756         (defaultPassiveTouchListenersAsDefaultOnDocument):
757         * Shared/WebPreferencesDefaultValues.h:
758         * UIProcess/Cocoa/VersionChecks.h:
759         * WebKit.xcodeproj/project.pbxproj:
760
761 2018-01-19  Joseph Pecoraro  <pecoraro@apple.com>
762
763         [Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
764         https://bugs.webkit.org/show_bug.cgi?id=181868
765
766         Reviewed by Dan Bernstein.
767
768         * Shared/API/Cocoa/_WKNSWindowExtras.h:
769
770 2018-01-19  John Wilander  <wilander@apple.com>
771
772         Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
773         https://bugs.webkit.org/show_bug.cgi?id=181870
774         <rdar://problem/36666750>
775
776         Unreviewed build fix.
777
778         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
779
780 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
781
782         Unreviewed, rolling out r227211.
783
784         Breaks iOS Simulator tests.
785
786         Reverted changeset:
787
788         "Expose Safe Browsing SPI"
789         https://bugs.webkit.org/show_bug.cgi?id=181804
790         https://trac.webkit.org/changeset/227211
791
792 2018-01-19  John Wilander  <wilander@apple.com>
793
794         Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics
795         https://bugs.webkit.org/show_bug.cgi?id=181822
796         https://bugs.webkit.org/show_bug.cgi?id=175263
797         https://bugs.webkit.org/show_bug.cgi?id=178536
798         https://bugs.webkit.org/show_bug.cgi?id=181223
799         https://bugs.webkit.org/show_bug.cgi?id=181482
800         <rdar://problem/33491222>
801         <rdar://problem/33805293>
802         <rdar://problem/36332683>
803         <rdar://problem/36549026>
804
805         Reviewed by Alex Christensen.
806
807         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
808         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
809         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
810         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
811         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
812             Calls the new API with no-op completion handler.
813         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]):
814             New API with completion handler.
815         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
816             Calls the new API with no-op completion handler.
817         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]):
818             New API with completion handler.
819         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
820         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
821         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
822         * UIProcess/WebResourceLoadStatisticsStore.cpp:
823         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
824         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
825         * UIProcess/WebResourceLoadStatisticsStore.h:
826         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
827         (WebKit::WebsiteDataStore::removeData):
828         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
829         * UIProcess/WebsiteData/WebsiteDataStore.h:
830
831 2018-01-19  Daniel Bates  <dabates@apple.com>
832
833         REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
834         https://bugs.webkit.org/show_bug.cgi?id=181863
835         <rdar://problem/36662452>
836
837         Reviewed by Chris Dumez.
838
839         More fix ups following r223149. When notifying all pages of a process state change we need to
840         take care to ref all the pages before iterating over them and notifying them of the change.
841         Notifying a page of such a state change may ultimately delegate to the embedding client. And
842         the embedding client can do anything, including deallocating one or more pages.
843
844         * UIProcess/WebProcessProxy.cpp:
845         (WebKit::WebProcessProxy::didBecomeUnresponsive):
846         (WebKit::WebProcessProxy::didBecomeResponsive):
847         (WebKit::WebProcessProxy::willChangeIsResponsive):
848         (WebKit::WebProcessProxy::didChangeIsResponsive):
849         (WebKit::WebProcessProxy::requestTermination):
850
851 2018-01-19  Chris Dumez  <cdumez@apple.com>
852
853         The WebContent process should not process incoming IPC while waiting for a sync IPC reply
854         https://bugs.webkit.org/show_bug.cgi?id=181560
855
856         Reviewed by Ryosuke Niwa.
857
858         The WebContent process should not process incoming IPC while waiting for a sync IPC reply.
859         This is causing hard-to-debug crashes because developers often assume the state does not
860         change during a sendSync() call.
861
862         * Platform/IPC/Connection.cpp:
863         (IPC::Connection::waitForSyncReply):
864         * Platform/IPC/Connection.h:
865         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply):
866         * UIProcess/WebProcessProxy.cpp:
867         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
868         * UIProcess/WebProcessProxy.h:
869         * UIProcess/WebProcessProxy.messages.in:
870         * WebProcess/Network/NetworkProcessConnection.cpp:
871         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
872         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
873         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
874         * WebProcess/WebConnectionToUIProcess.cpp:
875         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
876         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
877         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
878         * WebProcess/WebCoreSupport/WebChromeClient.h:
879         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
880         (WebKit::WebEditorClient::undo):
881         (WebKit::WebEditorClient::redo):
882         * WebProcess/WebProcess.cpp:
883         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
884         * WebProcess/WebProcess.h:
885         * WebProcess/WebProcess.messages.in:
886
887 2018-01-19  Keith Miller  <keith_miller@apple.com>
888
889         HaveInternalSDK includes should be "#include?"
890         https://bugs.webkit.org/show_bug.cgi?id=179670
891
892         Reviewed by Dan Bernstein.
893
894         * Configurations/Base.xcconfig:
895
896 2018-01-19  Daniel Bates  <dabates@apple.com>
897
898         Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
899
900         * WebProcess/Plugins/PDF/PDFPlugin.h:
901         * WebProcess/Plugins/PDF/PDFPlugin.mm:
902         (WebKit::PDFPlugin::willDetachRenderer):
903         (WebKit::PDFPlugin::willDetatchRenderer): Deleted.
904         * WebProcess/Plugins/Plugin.h:
905         (WebKit::Plugin::willDetachRenderer):
906         (WebKit::Plugin::willDetatchRenderer): Deleted.
907         * WebProcess/Plugins/PluginView.cpp:
908         (WebKit::PluginView::willDetachRenderer):
909         (WebKit::PluginView::willDetatchRenderer): Deleted.
910         * WebProcess/Plugins/PluginView.h:
911
912 2018-01-19  Zach Li  <zacharyli323@gmail.com>
913
914         Expose Safe Browsing SPI
915         https://bugs.webkit.org/show_bug.cgi?id=181804
916         <rdar://problem/36626946>
917
918         Reviewed by Alex Christensen.
919
920         If client is using Apple internal SDK, then we can just import the header; if not,
921         then we declare necessary symbols that client will need.
922
923         * Configurations/WebKit.xcconfig:
924         Only link against SafariSafeBrowsing framework on macOS High Sierra
925         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
926         because it is not present on the Base system.
927
928         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
929
930         * WebKit.xcodeproj/project.pbxproj:
931         Added SafeBrowsingSPI.h.
932
933         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
934         Added.
935
936 2018-01-18  Chris Dumez  <cdumez@apple.com>
937
938         We should be able to terminate service workers that are unresponsive
939         https://bugs.webkit.org/show_bug.cgi?id=181563
940         <rdar://problem/35280031>
941
942         Reviewed by Alex Christensen.
943
944         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
945         (WebKit::WebSWContextManagerConnection::terminateWorker):
946         Use a 10 second timeout for forcefully exiting the service worker process when
947         the service worker in question fails to terminate.
948
949         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
950         Use a 100ms timeout for forcefully exiting the service worker process when
951         the service worker in question fails to terminate. This method is only called
952         from the layout tests, which is why we use a very short timeout.
953
954 2018-01-18  Ryan Haddad  <ryanhaddad@apple.com>
955
956         Unreviewed, suppress deprecation warnings to fix the build with a newer SDK.
957
958         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
959         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
960
961 2018-01-18  Youenn Fablet  <youenn@apple.com>
962
963         Do not go to the storage process when loading a main resource if there is no service worker registered
964         https://bugs.webkit.org/show_bug.cgi?id=181395
965
966         Reviewed by Chris Dumez.
967
968         Add a new web process creation parameter to know whether there is any service worker registered at web process creation time.
969         If there is none, the web process will then start to load HTTP resources from the network.
970         The connection to the storage process is then executed when receiving the first bytes of the main resource.
971         This connection is needed as other web processes may create service workers at any given time.
972         If there is one registered service worker, the web process will wait for its connection to the storage process to be active.
973
974         * Shared/WebProcessCreationParameters.cpp:
975         (WebKit::WebProcessCreationParameters::encode const):
976         (WebKit::WebProcessCreationParameters::decode):
977         * Shared/WebProcessCreationParameters.h:
978         * UIProcess/ServiceWorkerProcessProxy.cpp:
979         (WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers):
980         * UIProcess/ServiceWorkerProcessProxy.h:
981         * UIProcess/WebProcessPool.cpp:
982         (WebKit::WebProcessPool::initializeNewWebProcess):
983         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
984         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
985         * WebProcess/Storage/WebServiceWorkerProvider.h:
986         * WebProcess/Storage/WebToStorageProcessConnection.h:
987         (WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession):
988         * WebProcess/WebProcess.cpp:
989         (WebKit::WebProcess::initializeWebProcess):
990
991 2018-01-18  Chris Dumez  <cdumez@apple.com>
992
993         Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
994         https://bugs.webkit.org/show_bug.cgi?id=181771
995         <rdar://problem/36566237>
996
997         Reviewed by Brady Eidson.
998
999         * UIProcess/WebProcessProxy.cpp:
1000         (WebKit::WebProcessProxy::didClose):
1001         Use copyToVectorOf<RefPtr<WebPageProxy>>() to maintain pre-r223149 behavior
1002         and ref the pages.
1003
1004 2018-01-18  Dan Bernstein  <mitz@apple.com>
1005
1006         [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
1007         https://bugs.webkit.org/show_bug.cgi?id=181803
1008
1009         Reviewed by Tim Horton.
1010
1011         * Configurations/Base.xcconfig: Updated.
1012         * Configurations/DebugRelease.xcconfig: Ditto.
1013         * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
1014         * Configurations/Version.xcconfig: Updated.
1015         * Configurations/macOSTargetConditionals.xcconfig: Added.  Defines helper build settings
1016           useful for defining settings that depend on the target macOS version.
1017
1018 2018-01-18  Chris Dumez  <cdumez@apple.com>
1019
1020         Service Workers restored from persistent storage have 'redundant' state
1021         https://bugs.webkit.org/show_bug.cgi?id=181749
1022         <rdar://problem/36556486>
1023
1024         Reviewed by Youenn Fablet.
1025
1026         Allow service workers to intercept custom protocol loads as this is useful for
1027         API testing.
1028
1029         * WebProcess/Network/WebLoaderStrategy.cpp:
1030         (WebKit::WebLoaderStrategy::scheduleLoad):
1031         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
1032         * WebProcess/Network/WebLoaderStrategy.h:
1033
1034 2018-01-18  Brent Fulgham  <bfulgham@apple.com>
1035
1036         REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
1037         https://bugs.webkit.org/show_bug.cgi?id=181797
1038         <rdar://problem/36546412>
1039
1040         Reviewed by Eric Carlson.
1041
1042         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
1043         'com.apple.lookup.shared' to support DataDetectors.
1044
1045 2018-01-17  John Wilander  <wilander@apple.com>
1046
1047         Resource Load Statistics: Block cookies for prevalent resources without user interaction
1048         https://bugs.webkit.org/show_bug.cgi?id=177394
1049         <rdar://problem/34613960>
1050
1051         Reviewed by Alex Christensen.
1052
1053         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1054             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
1055             cookie blocking.
1056         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1057         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
1058             Returns singleton empty, deny-all cookie storage for cookie blocking.
1059             The ugly pragma instructions for clang are because the NSString
1060             parameter for _initWithIdentifier was not marked nullable pre-Sierra.
1061         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
1062             Instead of just decision making, this now applies the policy.
1063         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
1064             New method.
1065         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1066             Now blocks cookies for domains where cookies will be purged anyway.
1067         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1068             Now blocks cookies for domains where cookies will be purged anyway.
1069         (WebKit::shouldChangePartition): Deleted.
1070         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1071         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1072             Now downgrades for blocked cookies instead of partitioned cookies.
1073         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1074             Now downgrades for blocked cookies instead of partitioned cookies.
1075
1076
1077 2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>
1078
1079         [Curl] Use ResourceRequest::encodeWithPlatformData()
1080         https://bugs.webkit.org/show_bug.cgi?id=181768
1081
1082         Reviewed by Alex Christensen.
1083
1084         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1085         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1086         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1087
1088 2018-01-17  Matt Lewis  <jlewis3@apple.com>
1089
1090         Unreviewed, rolling out r227076.
1091
1092         This breaks internal builds
1093
1094         Reverted changeset:
1095
1096         "Resource Load Statistics: Block cookies for prevalent
1097         resources without user interaction"
1098         https://bugs.webkit.org/show_bug.cgi?id=177394
1099         https://trac.webkit.org/changeset/227076
1100
1101 2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1102
1103         WEBKIT_FRAMEWORK should not modify file-global include directories
1104         https://bugs.webkit.org/show_bug.cgi?id=181656
1105
1106         Reviewed by Konstantin Tokarev.
1107
1108         * PlatformGTK.cmake:
1109         * PlatformWPE.cmake:
1110
1111 2018-01-17  Youenn Fablet  <youenn@apple.com>
1112
1113         Put fetch request keepAlive behind a runtime flag
1114         https://bugs.webkit.org/show_bug.cgi?id=181592
1115
1116         Reviewed by Chris Dumez.
1117
1118         * Shared/WebPreferences.yaml:
1119         * UIProcess/API/C/WKPreferences.cpp:
1120         (WKPreferencesSetFetchAPIKeepAliveEnabled):
1121         (WKPreferencesGetFetchAPIKeepAliveEnabled):
1122         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1123
1124 2018-01-17  John Wilander  <wilander@apple.com>
1125
1126         Resource Load Statistics: Block cookies for prevalent resources without user interaction
1127         https://bugs.webkit.org/show_bug.cgi?id=177394
1128         <rdar://problem/34613960>
1129
1130         Reviewed by Alex Christensen.
1131
1132         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1133             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
1134             cookie blocking.
1135         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1136         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
1137             Returns singleton empty, deny-all cookie storage for cookie blocking.
1138         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
1139             Instead of just decision making, this now applies the policy.
1140         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
1141             New method.
1142         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1143             Now blocks cookies for domains where cookies will be purged anyway.
1144         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1145             Now blocks cookies for domains where cookies will be purged anyway.
1146         (WebKit::shouldChangePartition): Deleted.
1147         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1148         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1149             Now downgrades for blocked cookies instead of partitioned cookies.
1150         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1151             Now downgrades for blocked cookies instead of partitioned cookies.
1152
1153 2018-01-17  Daniel Bates  <dabates@apple.com>
1154
1155         REGRESSION (r222795): Cardiogram never signs in
1156         https://bugs.webkit.org/show_bug.cgi?id=181693
1157         <rdar://problem/36286293>
1158
1159         Reviewed by Ryosuke Niwa.
1160
1161         Exempt Cardiogram from the XHR header restrictions in r222795.
1162
1163         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
1164         However Cardiogram also depends on such functionality.
1165
1166         * Shared/WebPreferences.yaml:
1167         * UIProcess/API/Cocoa/WKWebView.mm:
1168         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
1169         (-[WKWebView _initializeWithConfiguration:]):
1170         * UIProcess/Cocoa/VersionChecks.h:
1171
1172 2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1173
1174         Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
1175         https://bugs.webkit.org/show_bug.cgi?id=181637
1176         <rdar://problem/36508471>
1177
1178         Reviewed by Tim Horton.
1179
1180         Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
1181         represent an archive resource, given the resource's data and MIME type.
1182
1183         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
1184         (API::InjectedBundle::EditorClient::replacementURLForResource):
1185         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
1186         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
1187
1188         Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.
1189
1190         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1191         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
1192         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
1193         (WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
1194         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
1195         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1196         (WebKit::WebEditorClient::replacementURLForResource):
1197         * WebProcess/WebCoreSupport/WebEditorClient.h:
1198
1199 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
1200
1201         [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
1202         https://bugs.webkit.org/show_bug.cgi?id=181725
1203
1204         Reviewed by Carlos Garcia Campos.
1205
1206         * Shared/cairo/ShareableBitmapCairo.cpp:
1207         (WebKit::ShareableBitmap::paint):
1208         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
1209         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1210         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
1211
1212 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1213
1214         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.
1215
1216         * gtk/NEWS: Add release notes for 2.19.6.
1217
1218 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1219
1220         [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
1221         https://bugs.webkit.org/show_bug.cgi?id=179914
1222
1223         Reviewed by Žan Doberšek.
1224
1225         Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.
1226
1227         * webkitglib-symbols.map:
1228
1229 2018-01-17  Youenn Fablet  <youenn@apple.com>
1230
1231         Clear Caches volatile storage as a memory optimization.
1232         https://bugs.webkit.org/show_bug.cgi?id=181643
1233
1234         Reviewed by Chris Dumez.
1235
1236         clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage.
1237         Clearing m_volatileStorage allows releasing some memory.
1238
1239         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1240         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
1241
1242 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
1243
1244         [Cairo] Use one-time ShadowBlur objects when performing shadowing
1245         https://bugs.webkit.org/show_bug.cgi?id=181720
1246
1247         Reviewed by Carlos Garcia Campos.
1248
1249         * Shared/cairo/ShareableBitmapCairo.cpp:
1250         (WebKit::ShareableBitmap::paint):
1251         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
1252         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1253         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
1254
1255 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
1256
1257         [CMake] Remove WebCoreDerivedSources library target
1258         https://bugs.webkit.org/show_bug.cgi?id=181664
1259
1260         Reviewed by Carlos Garcia Campos.
1261
1262         * CMakeLists.txt: Do not link WebCoreDerivedSources.
1263         * PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES.
1264         * PlatformWin.cmake: Ditto.
1265
1266 2018-01-16  Alex Christensen  <achristensen@webkit.org>
1267
1268         Merge sync and async code paths for getting context menus
1269         https://bugs.webkit.org/show_bug.cgi?id=181423
1270
1271         Reviewed by Joseph Pecoraro.
1272
1273         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
1274         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
1275         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
1276         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
1277
1278         * UIProcess/API/APIContextMenuClient.h:
1279         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1280         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
1281         * UIProcess/API/C/WKPage.cpp:
1282         (WKPageSetPageContextMenuClient):
1283         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
1284         * UIProcess/WebContextMenuProxy.h:
1285         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1286         (WebKit::WebContextMenuProxyGtk::show):
1287         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
1288         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1289         * UIProcess/mac/WebContextMenuProxyMac.h:
1290         * UIProcess/mac/WebContextMenuProxyMac.mm:
1291         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1292         (WebKit::WebContextMenuProxyMac::showContextMenu):
1293         * UIProcess/wpe/WebContextMenuProxyWPE.h:
1294
1295 2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1296
1297         Don't link WebKit target directly to JavaScriptCore
1298         https://bugs.webkit.org/show_bug.cgi?id=181688
1299
1300         Reviewed by Alex Christensen.
1301
1302         It's safer if we only link to the next lower-layered lib in the stack, so let's just link
1303         directly to WebCore instead.
1304
1305         And WPE doesn't need to specify it twice.
1306
1307         * CMakeLists.txt:
1308         * PlatformMac.cmake:
1309         * PlatformWPE.cmake:
1310
1311 2018-01-16  Eric Carlson  <eric.carlson@apple.com>
1312
1313         AVSampleBufferDisplayLayer should be flushed when application activates
1314         https://bugs.webkit.org/show_bug.cgi?id=181623
1315         <rdar://problem/36487738>
1316
1317         Reviewed by Darin Adler.
1318
1319         * WebProcess/WebPage/ios/WebPageIOS.mm:
1320         (WebKit::WebPage::applicationWillResignActive): Call page.
1321         (WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider.
1322         (WebKit::WebPage::applicationWillEnterForeground): Call page.
1323         (WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider.
1324
1325 2018-01-16  Zach Li  <zachli@apple.com>
1326
1327         Add pop-up policy support in website policies.
1328         https://bugs.webkit.org/show_bug.cgi?id=181544.
1329         rdar://problem/30521400.
1330
1331         Reviewed by Alex Christensen.
1332
1333         * Shared/WebsitePoliciesData.cpp: Encode and decode
1334         pop-up policy.
1335         (WebKit::WebsitePoliciesData::encode const):
1336         (WebKit::WebsitePoliciesData::decode):
1337         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1338         Apply the pop-up policy from website policies to the
1339         document loader.
1340
1341         * Shared/WebsitePoliciesData.h:
1342
1343         * Shared/WebsitePopUpPolicy.h:
1344         Added for declaring enum WebsitePopUpPolicy.
1345
1346         * UIProcess/API/APIWforebsitePolicies.cpp:
1347         Include pop-up policy in website policies.
1348         (API::WebsitePolicies::WebsitePolicies):
1349         (API::WebsitePolicies::data):
1350         * UIProcess/API/APIWebsitePolicies.h:
1351
1352         * UIProcess/API/C/WKWebsitePolicies.cpp:
1353         Added C API to get and set pop-up policy on
1354         website policies.
1355         (WKWebsitePoliciesGetPopUpPolicy):
1356         (WKWebsitePoliciesSetPopUpPolicy):
1357         * UIProcess/API/C/WKWebsitePolicies.h:
1358
1359         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1360         Added Obj-C API to get and set pop-up policy
1361         on website policies.
1362         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1363         (-[_WKWebsitePolicies setPopUpPolicy:]):
1364         (-[_WKWebsitePolicies popUpPolicy]):
1365
1366         * WebKit.xcodeproj/project.pbxproj:
1367         Added WebsitePopUpPolicy.h.
1368
1369 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
1370
1371         [CMake][Mac] Fix the build errors
1372         https://bugs.webkit.org/show_bug.cgi?id=181665
1373
1374         Reviewed by Alex Christensen.
1375
1376         * CMakeLists.txt: Added TouchBarMenuData.cpp and TouchBarMenuItemData.cpp to compile.
1377         * PlatformMac.cmake: Added _WKApplicationManifest.mm, WKInspectorWKWebView.mm and WKInspectorWindow.mm to compile.
1378         * UIProcess/API/Cocoa/WKProcessPool.mm:
1379         (-[WKProcessPool _webPageContentProcessCount]): Call WebProcessPool::serviceWorkerProxy() only if ENABLE(SERVICE_WORKER).
1380
1381 2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1382
1383         [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
1384         https://bugs.webkit.org/show_bug.cgi?id=181638
1385         <rdar://problem/36508702>
1386
1387         Reviewed by Dan Bernstein.
1388
1389         Add a `source` parameter to the `didInsertAttachment` codepath for notifying WebKit2 clients when attachment
1390         elements are inserted into the document.
1391
1392         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1393         * UIProcess/API/Cocoa/WKWebView.mm:
1394         (-[WKWebView _didInsertAttachment:withSource:]):
1395         (-[WKWebView _didInsertAttachment:]): Deleted.
1396         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1397         * UIProcess/Cocoa/PageClientImplCocoa.h:
1398         * UIProcess/Cocoa/PageClientImplCocoa.mm:
1399         (WebKit::PageClientImplCocoa::didInsertAttachment):
1400         * UIProcess/PageClient.h:
1401         (WebKit::PageClient::didInsertAttachment):
1402         * UIProcess/WebPageProxy.cpp:
1403         (WebKit::WebPageProxy::didInsertAttachment):
1404         * UIProcess/WebPageProxy.h:
1405         * UIProcess/WebPageProxy.messages.in:
1406         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1407         (WebKit::WebEditorClient::didInsertAttachment):
1408         * WebProcess/WebCoreSupport/WebEditorClient.h:
1409
1410 2018-01-15  Youenn Fablet  <youenn@apple.com>
1411
1412         ASSERTION FAILED: m_ptr under WebKit::CacheStorage::Caches::writeRecord
1413         https://bugs.webkit.org/show_bug.cgi?id=181401
1414         <rdar://problem/36379022>
1415
1416         Reviewed by Darin Adler.
1417
1418         m_isInitialized is true but m_storage is set to nullptr when calling writeRecord.
1419         The only case seems to be if:
1420         - We are doing persistent storage
1421         - We are traversing the storage to do the initialization. At that point m_storage is set to a correct value.
1422         - clearMemoryRepresentation is called, thus setting m_storage to nullptr and m_isInitialized to false.
1423         We fix this by making clearMemoryRepresentation a no-op if we are initializing the caches.
1424         clearMemoryRepresentation is about cleaning the in-memory information of the caches and the memory representation is empty at init time.
1425         Nullifying m_storage is a memory consumption optimization.
1426
1427         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1428         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
1429
1430 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1431
1432         Unreviewed, speculative build fix after r226899.
1433
1434         Add an empty implementation for PageClient::startDrag.
1435
1436         * UIProcess/PageClient.h:
1437         (WebKit::PageClient::startDrag):
1438
1439 2018-01-12  Brent Fulgham  <bfulgham@apple.com>
1440
1441         [iOS] Remove unneeded accessibility-related sandbox rules
1442         https://bugs.webkit.org/show_bug.cgi?id=181619
1443         <rdar://problem/36485356>
1444
1445         Reviewed by Eric Carlson.
1446
1447         Remove a number of sandbox exceptions that were in place for accessibility support. These are
1448         not needed in the WebContent process, since Safari (not WebKit) handles the accessibility
1449         interactions.
1450
1451         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1452
1453 2018-01-12  Keith Rollin  <krollin@apple.com>
1454
1455         Logged JSON should escape "'s and \'s in strings.
1456         https://bugs.webkit.org/show_bug.cgi?id=181608
1457
1458         Reviewed by Brent Fulgham.
1459
1460         * NetworkProcess/NetworkResourceLoader.cpp:
1461         (WebKit::NetworkResourceLoader::logCookieInformation const):
1462
1463 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
1464
1465         Unreviewed, fixing error in UIKitSPI.h.
1466
1467         * Platform/spi/ios/UIKitSPI.h:
1468         
1469 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
1470
1471         Implement MultiDocument protocol for restoring focus to a WKWebView
1472         https://bugs.webkit.org/show_bug.cgi?id=181510
1473
1474         Reviewed by Dan Bernstein.
1475
1476         Support the UIKit protocol for restoring focus to a what previously had focus.
1477         WebKit already knows what node was previously being focused by the DOM, we merely
1478         need to be asked to turn the focus on again.
1479         Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds
1480
1481         * Platform/spi/ios/UIKitSPI.h:
1482         * UIProcess/ios/WKContentViewInteraction.h:
1483         * UIProcess/ios/WKContentViewInteraction.mm:
1484         (-[WKContentView _restoreFocusWithToken:]):
1485         (-[WKContentView _preserveFocusWithToken:destructively:]):
1486
1487 2018-01-12  Youenn Fablet  <youenn@apple.com>
1488
1489         WebProcess should pass the registration identifier and not the worker identifier for fetch events
1490         https://bugs.webkit.org/show_bug.cgi?id=181591
1491
1492         Reviewed by Chris Dumez.
1493
1494         Use service worker registration identifier to compute the active service worker identifier responsible to handle the fetch event.
1495
1496         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1497         (WebKit::WebSWServerConnection::startFetch):
1498         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1499         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1500         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1501         (WebKit::ServiceWorkerClientFetch::start):
1502         * WebProcess/Storage/WebSWClientConnection.cpp:
1503         (WebKit::WebSWClientConnection::startFetch):
1504         * WebProcess/Storage/WebSWClientConnection.h:
1505         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1506         (WebKit::shouldHandleFetch):
1507
1508 2018-01-12  Ryan Haddad  <ryanhaddad@apple.com>
1509
1510         Unreviewed, rolling out r226826.
1511
1512         Breaks internal builds.
1513
1514         Reverted changeset:
1515
1516         "Implement MultiDocument protocol for restoring focus to a
1517         WKWebView"
1518         https://bugs.webkit.org/show_bug.cgi?id=181510
1519         https://trac.webkit.org/changeset/226826
1520
1521 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1522
1523         [WK2] Unify macOS and iOS codepaths in the UI process when starting a drag
1524         https://bugs.webkit.org/show_bug.cgi?id=181574
1525
1526         Reviewed by Tim Horton.
1527
1528         Rearrange some macOS drag start logic in the UI process so that it uses the same codepaths in WebPageProxy as
1529         iOS. Namely, startDrag should just forward the DragItem and drag image handle along to the appropriate views on
1530         each platform (WKContentView and WebViewImpl).
1531
1532         There should be no change in behavior.
1533
1534         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1535
1536         Both macOS and iOS now funnel through this method.
1537
1538         * UIProcess/Cocoa/WebViewImpl.h:
1539         * UIProcess/Cocoa/WebViewImpl.mm:
1540         (WebKit::WebViewImpl::startDrag):
1541         (WebKit::WebViewImpl::dragImageForView): Deleted.
1542
1543         Rename dragImageForView to startDrag. Move the call to didStartDrag() here, and call dragCancelled() in the
1544         case where we bailed from starting the drag (due to failing to create a drag image).
1545
1546         * UIProcess/PageClient.h:
1547         * UIProcess/ios/PageClientImplIOS.h:
1548         * UIProcess/ios/PageClientImplIOS.mm:
1549         (WebKit::PageClientImpl::setDragImage): Deleted.
1550
1551         Rename setDragImage to startDrag.
1552
1553         * UIProcess/mac/PageClientImplMac.h:
1554         * UIProcess/mac/PageClientImplMac.mm:
1555         (WebKit::PageClientImpl::startDrag):
1556         (WebKit::PageClientImpl::setDragImage): Deleted.
1557         * UIProcess/mac/WebPageProxyMac.mm:
1558         (WebKit::WebPageProxy::startDrag): Deleted.
1559
1560 2018-01-12  Antoine Quint  <graouts@apple.com>
1561
1562         Add support for the frames() timing function
1563         https://bugs.webkit.org/show_bug.cgi?id=181585
1564         <rdar://problem/36463317>
1565
1566         Reviewed by Dean.
1567
1568         Add the ability to endode and decode the frames() timing function.
1569
1570         * Shared/WebCoreArgumentCoders.cpp:
1571         (IPC::ArgumentCoder<FramesTimingFunction>::encode):
1572         (IPC::ArgumentCoder<FramesTimingFunction>::decode):
1573         * Shared/WebCoreArgumentCoders.h:
1574         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1575         (WebKit::PlatformCAAnimationRemote::Properties::encode const):
1576         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1577
1578 2018-01-11  Keith Miller  <keith_miller@apple.com>
1579
1580         Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
1581         https://bugs.webkit.org/show_bug.cgi?id=181573
1582
1583         Reviewed by Simon Fraser.
1584
1585         * Configurations/FeatureDefines.xcconfig:
1586
1587 2018-01-11  Brent Fulgham  <bfulgham@apple.com>
1588
1589         REGRESSION(r219530): ResourceLoadStatisticsPersistentStorage should be read-only in ephemeral sessions
1590         https://bugs.webkit.org/show_bug.cgi?id=181136
1591         <rdar://problem/36116604>
1592
1593         Reviewed by Chris Dumez.
1594
1595         Some uses of WebKit involve running a UIProcess as an ephemeral session for the life of the process. In this
1596         case, we do not initialize the data path for the set of load statistics triggering an assertion.
1597
1598         We actually intended ephemeral sessions to consume the existing resource load data (presumably captured during
1599         non-ephemeral browsing). This would be a read-only mode, where it would not add new entries to the load
1600         statistics, but would take advantage of existing observations. Currently that does not happen (for this type
1601         of WebKit embed), which forces each run as an ephemeral session to build up in-memory browsing data until it has
1602         enough observations to begin modifying loads.
1603
1604         We need to set the ResourceLoadStatisticsPersistentStorage object to a "read only" mode in this case, so
1605         that it read (but does not write) from this database.
1606
1607         Tested by ephemeral website data TestWebKitAPI tests.
1608
1609         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1610         (WebKit::ResourceLoadStatisticsPersistentStorage::create): Added to allow creation of the right style of
1611         Persistent Storage.
1612         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): Initialize the
1613         new data member.
1614         (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired): RELEASE_ASSERT that we never run
1615         this method when in "read only" mode.
1616         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): Ditto.
1617         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): Return early if asked to
1618         schedule a write operation for a "read only" persistent store.
1619         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): RELEASE_ASSERT if we
1620         ever shut down in "read only" mode with an active write timer.
1621         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
1622         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1623         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Pass a flag indicating whether the
1624         storage session is ephemeral or not.
1625         * UIProcess/WebResourceLoadStatisticsStore.h:
1626
1627 2018-01-11  Keith Rollin  <krollin@apple.com>
1628
1629         Add optional logging of ITP-related user interaction information
1630         https://bugs.webkit.org/show_bug.cgi?id=181556
1631
1632         Reviewed by Brent Fulgham.
1633
1634         In order to support the tracking of the efficacy of Intelligent
1635         Tracking Protection, add some logging indicating when the user
1636         interacts with a page in a way that affects cookie partitioning. This
1637         logging is off by default, and is enabled with `defaults write -g
1638         WebKitLogCookieInformation -bool true`.
1639
1640         * Shared/WebProcessCreationParameters.cpp:
1641         (WebKit::WebProcessCreationParameters::encode const):
1642         (WebKit::WebProcessCreationParameters::decode):
1643         * Shared/WebProcessCreationParameters.h:
1644         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1645         (WebKit::WebProcessPool::platformInitializeWebProcess):
1646         * WebProcess/WebProcess.cpp:
1647         (WebKit::WebProcess::initializeWebProcess):
1648
1649 2018-01-11  Megan Gardner  <megan_gardner@apple.com>
1650
1651         Implement MultiDocument protocol for restoring focus to a WKWebView
1652         https://bugs.webkit.org/show_bug.cgi?id=181510
1653
1654         Reviewed by Dan Bernstein.
1655
1656         Support the UIKit protocol for restoring focus to a what previously had focus.
1657         WebKit already has a method to silently remove and replace focus, without telling the
1658         web process about the unfocus and refocusing, so we're just using that.
1659
1660         * Platform/spi/ios/UIKitSPI.h:
1661         * UIProcess/ios/WKContentViewInteraction.h:
1662         * UIProcess/ios/WKContentViewInteraction.mm:
1663         (-[WKContentView _restoreFocusWithToken:]):
1664         (-[WKContentView _preserveFocusWithToken:destructively:]):
1665
1666
1667 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1668
1669         Don't load inline data when requesting info for an attachment element backed by a file path
1670         https://bugs.webkit.org/show_bug.cgi?id=181550
1671
1672         Reviewed by Tim Horton
1673
1674         See WebCore/ChangeLog for more information.
1675
1676         * UIProcess/API/Cocoa/_WKAttachment.mm:
1677         (-[_WKAttachmentInfo initWithInfo:]):
1678         (-[_WKAttachmentInfo fileLoadingError]):
1679         (-[_WKAttachment requestInfo:]):
1680
1681 2018-01-11  Commit Queue  <commit-queue@webkit.org>
1682
1683         Unreviewed, rolling out r226789 and r226794.
1684         https://bugs.webkit.org/show_bug.cgi?id=181564
1685
1686         broke API tests (Requested by alexchristensen on #webkit).
1687
1688         Reverted changesets:
1689
1690         "Merge sync and async code paths for getting context menus"
1691         https://bugs.webkit.org/show_bug.cgi?id=181423
1692         https://trac.webkit.org/changeset/226789
1693
1694         "Revert changes accidentally committed with r226789."
1695         https://bugs.webkit.org/show_bug.cgi?id=181423
1696         https://trac.webkit.org/changeset/226794
1697
1698 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1699
1700         Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
1701         https://bugs.webkit.org/show_bug.cgi?id=181497
1702
1703         Reviewed by Tim Horton.
1704
1705         Refactor drag and drop support for promised blob data, so that blob info is shipped across to the client layer
1706         via DragItem in the DragClient::startDrag codepath, rather than via a separate prepareToDragPromisedBlob client
1707         codepath that stages promised blob info.
1708
1709         * UIProcess/Cocoa/WebViewImpl.h:
1710         * UIProcess/Cocoa/WebViewImpl.mm:
1711         (WebKit::WebViewImpl::prepareToDragPromisedBlob): Deleted.
1712         * UIProcess/PageClient.h:
1713         (WebKit::PageClient::prepareToDragPromisedBlob): Deleted.
1714         * UIProcess/WebPageProxy.cpp:
1715         (WebKit::WebPageProxy::prepareToDragPromisedBlob): Deleted.
1716         * UIProcess/WebPageProxy.h:
1717         * UIProcess/WebPageProxy.messages.in:
1718         * UIProcess/ios/PageClientImplIOS.h:
1719         * UIProcess/ios/PageClientImplIOS.mm:
1720         (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
1721         * UIProcess/ios/WKContentViewInteraction.h:
1722         * UIProcess/ios/WKContentViewInteraction.mm:
1723         (-[WKContentView _startDrag:item:]):
1724         * UIProcess/mac/PageClientImplMac.h:
1725         * UIProcess/mac/PageClientImplMac.mm:
1726         (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
1727         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1728         (WebKit::WebDragClient::prepareToDragPromisedBlob): Deleted.
1729         * WebProcess/WebCoreSupport/WebDragClient.h:
1730         * WebProcess/WebPage/WebPage.cpp:
1731         (WebKit::WebPage::prepareToDragPromisedBlob): Deleted.
1732         * WebProcess/WebPage/WebPage.h:
1733
1734 2018-01-09  Per Arne Vollan  <pvollan@apple.com>
1735
1736         VoiceOver does not work when the WebContent process is using NSRunLoop.
1737         https://bugs.webkit.org/show_bug.cgi?id=181331
1738         <rdar://problem/36408004>
1739
1740         Reviewed by Brent Fulgham.
1741
1742         When the WebContent process is using NSRunLoop instead of the NSApplication run loop,
1743         accessibility must be initialized for VoiceOver to work. This patch also switches to
1744         using NSRunLoop in the WebContent process.
1745
1746         * Configurations/WebContentService.xcconfig:
1747         * Platform/IPC/mac/ConnectionMac.mm:
1748         (IPC::AccessibilityProcessSuspendedNotification): Remove unneccessary workaround.
1749         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Switch to NSRunLoop.
1750         * WebProcess/cocoa/WebProcessCocoa.mm:
1751         (WebKit::WebProcess::platformInitializeProcess): Initialize accessibility.
1752
1753 2018-01-11  Don Olmstead  <don.olmstead@sony.com>
1754
1755         WebContextMenuListenerProxy.cpp not including config on first line
1756         https://bugs.webkit.org/show_bug.cgi?id=181552
1757
1758         Reviewed by Alex Christensen.
1759
1760         * UIProcess/WebContextMenuListenerProxy.cpp:
1761
1762 2018-01-11  Youenn Fablet  <youenn@apple.com>
1763
1764         Redirected iframe loading with Request.redirect=follow should fail
1765         https://bugs.webkit.org/show_bug.cgi?id=181491
1766
1767         Reviewed by Alex Christensen.
1768
1769         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1770         (WebKit::ServiceWorkerClientFetch::validateResponse):
1771
1772 2018-01-11  Youenn Fablet  <youenn@apple.com>
1773
1774         Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
1775         https://bugs.webkit.org/show_bug.cgi?id=181480
1776
1777         Reviewed by Eric Carlson.
1778
1779         Renaming preference to WebRTCLegacyAPIEnabled for simplification and removing it from experimental feature.
1780         Set it to off by default.
1781
1782         * Shared/WebPreferences.yaml:
1783         * UIProcess/API/C/WKPreferences.cpp:
1784         (WKPreferencesSetWebRTCLegacyAPIEnabled):
1785         (WKPreferencesGetWebRTCLegacyAPIEnabled):
1786         * UIProcess/API/Cocoa/WKPreferences.mm:
1787         (-[WKPreferences _webRTCLegacyAPIEnabled]):
1788         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
1789         * UIProcess/WebProcessPool.cpp:
1790         (WebKit::WebProcessPool::ensureNetworkProcess):
1791         * WebProcess/WebPage/WebPage.cpp:
1792         (WebKit::WebPage::updatePreferences):
1793
1794 2018-01-11  Alex Christensen  <achristensen@webkit.org>
1795
1796         Merge sync and async code paths for getting context menus
1797         https://bugs.webkit.org/show_bug.cgi?id=181423
1798
1799         Reviewed by Joseph Pecoraro.
1800
1801         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
1802         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
1803         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
1804         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
1805
1806         * UIProcess/API/APIContextMenuClient.h:
1807         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1808         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
1809         * UIProcess/API/C/WKPage.cpp:
1810         (WKPageSetPageContextMenuClient):
1811         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
1812         * UIProcess/WebContextMenuProxy.h:
1813         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1814         (WebKit::WebContextMenuProxyGtk::show):
1815         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
1816         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1817         * UIProcess/mac/WebContextMenuProxyMac.h:
1818         * UIProcess/mac/WebContextMenuProxyMac.mm:
1819         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1820         (WebKit::WebContextMenuProxyMac::showContextMenu):
1821         * UIProcess/wpe/WebContextMenuProxyWPE.h:
1822
1823 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1824
1825         [Attachment Support] Support dragging attachment elements out as files on iOS
1826         https://bugs.webkit.org/show_bug.cgi?id=181199
1827         <rdar://problem/36299316>
1828
1829         Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.
1830
1831         Implement support for registering and beginning a drag with promised blob info. See below for more detail.
1832
1833         * UIProcess/ios/WKContentViewInteraction.mm:
1834         (-[WKDragSessionContext addTemporaryDirectory:]):
1835         (-[WKDragSessionContext cleanUpTemporaryDirectories]):
1836
1837         Introduce WKDragSessionContext, which represents the localContext of a UIDragSession initiated in WebKit. The
1838         blob promise dragging codepath uses this to register temporary directories when saving blob data to a location
1839         on disk; when all data transfers are finished, or if the drag interaction is being reset, we then use
1840         -cleanUpTemporaryDirectories to remove each temporary directory.
1841
1842         (existingLocalDragSessionContext):
1843         (ensureLocalDragSessionContext):
1844
1845         Helper methods to set the UIDragSession's localContext to a WKDragSessionContext and query for any existing
1846         context.
1847
1848         (-[WKContentView cleanupInteraction]):
1849
1850         Before the content view's UIDragInteraction goes away, clean up any temporary directories added to the
1851         UIDragSession.
1852
1853         (-[WKContentView _prepareToDragPromisedBlob:]):
1854
1855         When dragging with a promised blob, register a new item provider on the pasteboard representing the blob data,
1856         along with any additional metadata associated with the blob. For the promise callback, call out to the network
1857         process to write the blob data to a temporary path; when done, call the NSItemProvider's completion handler with
1858         the temporary blob data location.
1859
1860         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
1861         (-[WKContentView dragInteraction:sessionDidTransferItems:]):
1862
1863         Use this delegate hook as an opportunity to remove any temporary directories created when promised blob data is
1864         requested upon drop. Since we know the drag session that has finished transferring data, we simply ask its local
1865         context (a WKDragSessionContext) to remove any temporary filepaths it has created.
1866
1867 2018-01-10  Jeff Miller  <jeffm@apple.com>
1868
1869         -[WKWebView _web_gestureEventWasNotHandledByWebCore:] should call -_gestureEventWasNotHandledByWebCore:
1870         https://bugs.webkit.org/show_bug.cgi?id=181498
1871
1872         Reviewed by Alex Christensen.
1873
1874         WKView's API contract allows clients to override -_gestureEventWasNotHandledByWebCore:, and -[WKView
1875         _web_gestureEventWasNotHandledByWebCore:] calls -_gestureEventWasNotHandledByWebCore: instead of
1876         invoking WebViewImpl::gestureEventWasNotHandledByWebCoreFromViewOnly() directly. WKWebView should do
1877         the same thing.
1878
1879         * UIProcess/API/Cocoa/WKWebView.mm:
1880         (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]):
1881         Call -_gestureEventWasNotHandledByWebCore:, which will call gestureEventWasNotHandledByWebCoreFromViewOnly().
1882
1883 2018-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1884
1885         REGRESSION(r222507): Composition highlight doesn't render when using IME
1886         https://bugs.webkit.org/show_bug.cgi?id=181485
1887         <rdar://problem/35896516>
1888
1889         Reviewed by Ryosuke Niwa.
1890
1891         Add plumbing for a `suppressUnderline` argument when setting marked text.
1892
1893         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1894         (WKBundlePageSetComposition):
1895         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1896         * WebProcess/WebPage/WebPage.cpp:
1897         (WebKit::WebPage::setCompositionForTesting):
1898         * WebProcess/WebPage/WebPage.h:
1899
1900 2018-01-10  Tim Horton  <timothy_horton@apple.com>
1901
1902         REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
1903         https://bugs.webkit.org/show_bug.cgi?id=181269
1904         <rdar://problem/35110344>
1905
1906         Reviewed by Simon Fraser.
1907
1908         * UIProcess/API/Cocoa/WKWebView.mm:
1909         (-[WKWebView _processDidExit]):
1910         (-[WKWebView _didCommitLayerTree:]):
1911         When swiping to a page that set history.scrollRestoration = "manual",
1912         we will never restore the scroll position. We will still restore
1913         "state", but won't have a location. Currently, the code assumes that
1914         it should wait to remove the swipe snapshot until the scroll position
1915         is restored. Instead, wait until the "state" is restored, whether
1916         or not that includes a scroll position/center point restoration.
1917
1918         Do this by making _firstTransactionIDAfterPageRestore an optional,
1919         and reset it after it fires, so that we only run the restoration code
1920         in _didCommitLayerTree for the first commit after state restoration,
1921         not all subsequent commits. Then, tell ViewGestureController that
1922         the scroll position has been restored even if the page opted out.
1923
1924         The reason that this is specific to pushState is that normal,
1925         non-same-document loads bail from waiting for the scroll position
1926         restoration in VGC::didReachMainFrameLoadTerminalState() (see the long
1927         comment there for an explanation).
1928
1929         (-[WKWebView _beginBackSwipeForTesting]):
1930         (-[WKWebView _completeBackSwipeForTesting]):
1931         * Platform/spi/ios/UIKitSPI.h:
1932         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1933         * UIProcess/Cocoa/ViewGestureController.h:
1934         * UIProcess/ios/ViewGestureControllerIOS.mm:
1935         (-[WKSwipeTransitionController transitionForDirection:]):
1936         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
1937         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
1938         * UIProcess/mac/ViewGestureControllerMac.mm:
1939         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
1940         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
1941         Add a mechanism to forcefully test swipe back. Instead of simulating
1942         events like on Mac, we just talk to the UIKit internals and force
1943         the interaction to start, pause, and then complete when we want.
1944
1945 2018-01-10  Brent Fulgham  <bfulgham@apple.com>
1946
1947         Use protectedThis for the 'updatePrevalentDomainsToPartitionOrBlockCookies' lambda
1948         https://bugs.webkit.org/show_bug.cgi?id=181452
1949         <rdar://problem/36416912>
1950         
1951         Reviewed by Chris Dumez.
1952
1953         We forgot to use a 'protectedThis' back in r225006 for one of the lambdas used by
1954         the WebsiteDataStore for processing.
1955
1956         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1957         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1958
1959 2018-01-09  John Wilander  <wilander@apple.com>
1960
1961         Storage Access API: Turn feature on by default in WebPreferences.yaml
1962         https://bugs.webkit.org/show_bug.cgi?id=181458
1963
1964         Reviewed by Brent Fulgham.
1965
1966         * Shared/WebPreferences.yaml:
1967
1968 2018-01-09  Alex Christensen  <achristensen@webkit.org>
1969
1970         WKOpenPanelParameters SPI should return autoreleased objects
1971         https://bugs.webkit.org/show_bug.cgi?id=181457
1972         <rdar://problem/35884960>
1973
1974         Reviewed by Tim Horton.
1975
1976         In r226607 I made a mistake by returning an object that has been released.
1977         I instead follow a pattern of leaking and autoreleasing that we use elsewhere in the ObjC API.
1978
1979         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
1980         (-[WKOpenPanelParameters _acceptedMIMETypes]):
1981         (-[WKOpenPanelParameters _acceptedFileExtensions]):
1982
1983 2018-01-09  Dan Bernstein  <mitz@apple.com>
1984
1985         Removed some empty directories that were left behind
1986
1987         * WebProcess/Cookies/cf: Removed.
1988         * WebProcess/ios: Removed.
1989
1990 2018-01-09  Paul Knight  <pknight@apple.com>
1991
1992         Don't record dynamic spelling corrections while in an ephemeral browsing session
1993         https://bugs.webkit.org/show_bug.cgi?id=181417
1994         <rdar://problem/33309104>
1995
1996         Dynamic spelling correction responses are kept on disk. Avoid recording
1997         these responses when in an ephemeral session.
1998
1999         Reviewed by Tim Horton and Wenson Hsieh.
2000
2001         * UIProcess/mac/CorrectionPanel.h:
2002         * UIProcess/mac/CorrectionPanel.mm:
2003         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
2004             Add a WebViewImpl parameter so we can query the current session.
2005             Return early before recording the response if the session is
2006             ephemeral.
2007         (WebKit::CorrectionPanel::handleAcceptedReplacement):
2008             Update a caller to include the new parameter.
2009         * UIProcess/mac/PageClientImplMac.mm:
2010         (WebKit::PageClientImpl::recordAutocorrectionResponse):
2011             Ditto.
2012
2013 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2014
2015         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.5 release.
2016
2017         * gtk/NEWS: Add release notes for 2.19.5.
2018
2019 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2020
2021         [GTK] Missing symbols exported in 2.19.4
2022         https://bugs.webkit.org/show_bug.cgi?id=181433
2023
2024         Reviewed by Michael Catanzaro.
2025
2026         Add missing WEBKIT_API to webkit_dom_dom_window_webkit_message_handlers_post_message().
2027
2028         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
2029         * webkitglib-symbols.map: Remove webkit_media_player_debug from local.
2030
2031 2018-01-09  Youenn Fablet  <youenn@apple.com>
2032
2033         SWClientConnection should not keep references to service worker jobs
2034         https://bugs.webkit.org/show_bug.cgi?id=181381
2035
2036         Reviewed by Chris Dumez.
2037
2038         Updated IPC handling based on WebCore refactoring.
2039
2040         * Scripts/webkit/messages.py:
2041         (forward_declarations_and_headers):
2042         (headers_for_type):
2043         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2044         (WebKit::WebSWServerConnection::rejectJobInClient):
2045         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2046         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2047         (WebKit::WebSWServerConnection::startScriptFetchInClient):
2048         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2049         * WebProcess/Storage/WebSWClientConnection.messages.in:
2050
2051 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2052
2053         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.4 release.
2054
2055         * gtk/NEWS: Add release notes for 2.19.4.
2056
2057 2018-01-09  Ali Juma  <ajuma@chromium.org>
2058
2059         Implement VisualViewport API events
2060         https://bugs.webkit.org/show_bug.cgi?id=179386
2061
2062         Reviewed by Frédéric Wang.
2063
2064         Change the default value of the VisualViewportAPI experimental feature flag to
2065         DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. This patch completes the implementation
2066         of this feature as specified by https://wicg.github.io/visual-viewport/, so this
2067         feature is now ready for wider testing.
2068
2069         * Shared/WebPreferences.yaml:
2070
2071 2018-01-08  Alex Christensen  <achristensen@webkit.org>
2072
2073         Add WKNavigationDelegate SPI exposing WebProcess crash reason
2074         https://bugs.webkit.org/show_bug.cgi?id=181410
2075         <rdar://problem/36167199>
2076
2077         Reviewed by Wenson Hsieh.
2078
2079         We exposed it in the C SPI.
2080
2081         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2082         * UIProcess/Cocoa/NavigationState.h:
2083         * UIProcess/Cocoa/NavigationState.mm:
2084         (WebKit::NavigationState::setNavigationDelegate):
2085         (WebKit::toWKProcessTerminationReason):
2086         (WebKit::NavigationState::NavigationClient::processDidTerminate):
2087
2088 2018-01-08  Alex Christensen  <achristensen@webkit.org>
2089
2090         Make ObjC SPI equivalent to WKPageNavigationClient.decidePolicyForPluginLoad
2091         https://bugs.webkit.org/show_bug.cgi?id=181413
2092         <rdar://problem/36169005>
2093
2094         Reviewed by Wenson Hsieh.
2095
2096         * UIProcess/API/APINavigationClient.h:
2097         (API::NavigationClient::decidePolicyForPluginLoad):
2098         * UIProcess/API/C/WKPage.cpp:
2099         (WKPageSetPageNavigationClient):
2100         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2101         * UIProcess/Cocoa/NavigationState.h:
2102         * UIProcess/Cocoa/NavigationState.mm:
2103         (WebKit::NavigationState::setNavigationDelegate):
2104         (WebKit::toPluginModuleLoadPolicy):
2105         (WebKit::toWKPluginModuleLoadPolicy):
2106         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
2107         * UIProcess/WebPageProxy.cpp:
2108         (WebKit::WebPageProxy::findPlugin):
2109
2110 2018-01-08  Ryosuke Niwa  <rniwa@webkit.org>
2111
2112         iOS build fix attempt after r226602.
2113
2114         * UIProcess/API/C/WKContextMenuListener.cpp:
2115         (WKContextMenuListenerUseContextMenuItems):
2116
2117 2018-01-08  Alex Christensen  <achristensen@webkit.org>
2118
2119         Add SPI for WKOpenPanelParameters._acceptedMIMETypes and _acceptedFileExtensions
2120         https://bugs.webkit.org/show_bug.cgi?id=181408
2121         <rdar://problem/35884960>
2122
2123         Reviewed by Tim Horton.
2124
2125         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
2126         (-[WKOpenPanelParameters _acceptedMIMETypes]):
2127         (-[WKOpenPanelParameters _acceptedFileExtensions]):
2128         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
2129         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h: Added.
2130         * WebKit.xcodeproj/project.pbxproj:
2131
2132 2018-01-08  Commit Queue  <commit-queue@webkit.org>
2133
2134         Unreviewed, rolling out r226532 and r226540.
2135         https://bugs.webkit.org/show_bug.cgi?id=181422
2136
2137         jessie says basic browsing does not seem to work (Requested by
2138         alexchristensen on #webkit).
2139
2140         Reverted changesets:
2141
2142         "Add CSP support to service workers"
2143         https://bugs.webkit.org/show_bug.cgi?id=181385
2144         https://trac.webkit.org/changeset/226532
2145
2146         "SWClientConnection should not keep references to service
2147         worker jobs"
2148         https://bugs.webkit.org/show_bug.cgi?id=181381
2149         https://trac.webkit.org/changeset/226540
2150
2151 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2152
2153         [Attachment Support] Expose file name and content type of WKAttachment
2154         https://bugs.webkit.org/show_bug.cgi?id=181390
2155         <rdar://problem/36336837>
2156
2157         Reviewed by Tim Horton.
2158
2159         Add support for -[_WKAttachment requestInfo:], which fetches a snapshot of the attachment's state. This API is
2160         meant to be a replacement for -requestData: that provides additional metadata about the attachment.
2161
2162         * Scripts/webkit/messages.py:
2163         (headers_for_type):
2164         * Shared/WebCoreArgumentCoders.cpp:
2165         (IPC::ArgumentCoder<AttachmentInfo>::encode):
2166         (IPC::ArgumentCoder<AttachmentInfo>::decode):
2167         * Shared/WebCoreArgumentCoders.h:
2168
2169         Add IPC support for AttachmentInfo. Note that instead of using (encode|decode)SharedBuffer, we send and receive
2170         data references to the shared buffer.
2171
2172         * UIProcess/API/APIAttachment.cpp:
2173         (API::Attachment::requestInfo):
2174         (API::Attachment::requestData): Deleted.
2175         * UIProcess/API/APIAttachment.h:
2176
2177         Change requestData to requestInfo.
2178
2179         * UIProcess/API/Cocoa/_WKAttachment.h:
2180         * UIProcess/API/Cocoa/_WKAttachment.mm:
2181         (-[_WKAttachmentInfo initWithInfo:]):
2182         (-[_WKAttachmentInfo data]):
2183         (-[_WKAttachmentInfo name]):
2184         (-[_WKAttachmentInfo filePath]):
2185         (-[_WKAttachmentInfo contentType]):
2186         (-[_WKAttachment requestInfo:]):
2187         (-[_WKAttachment requestData:]):
2188
2189         Implement -requestInfo: by calling into APIAttachment, and reimplement -requestData: in terms of -requestInfo:.
2190
2191         * UIProcess/WebPageProxy.cpp:
2192         (WebKit::WebPageProxy::attachmentInfoCallback):
2193         (WebKit::WebPageProxy::requestAttachmentInfo):
2194         (WebKit::WebPageProxy::sharedBufferCallback): Deleted.
2195         (WebKit::WebPageProxy::requestAttachmentData): Deleted.
2196         * UIProcess/WebPageProxy.h:
2197         * UIProcess/WebPageProxy.messages.in:
2198
2199         Rename the SharedBufferCallback IPC message to AttachmentInfoCallback, and make it conditional on
2200         ATTACHMENT_ELEMENT. Rename requestAttachmentData to requestAttachmentInfo.
2201
2202         * WebProcess/WebPage/WebPage.cpp:
2203         (WebKit::WebPage::requestAttachmentInfo):
2204         (WebKit::WebPage::invokeSharedBufferCallback): Deleted.
2205         (WebKit::WebPage::requestAttachmentData): Deleted.
2206
2207         Rename requestAttachmentData to requestAttachmentInfo and adopt HTMLAttachmentElement::requestInfo.
2208
2209         * WebProcess/WebPage/WebPage.h:
2210         * WebProcess/WebPage/WebPage.messages.in:
2211
2212 2018-01-08  Alex Christensen  <achristensen@webkit.org>
2213
2214         Pass around Vector<Ref<WebContextMenuItem>> instead of WKArrayRef or Vector<WebContextMenuItemData>
2215         https://bugs.webkit.org/show_bug.cgi?id=181419
2216
2217         Reviewed by Tim Horton.
2218
2219         Passing a WKArrayRef to an API object is messy and was preventing me from moving things around and making ObjC SPI.
2220         No change in behavior.  Just using different layering abstractions for the same data.
2221
2222         * UIProcess/API/C/WKContextMenuListener.cpp:
2223         (WKContextMenuListenerUseContextMenuItems):
2224         * UIProcess/WebContextMenuListenerProxy.cpp:
2225         (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
2226         * UIProcess/WebContextMenuListenerProxy.h:
2227         * UIProcess/WebContextMenuProxy.h:
2228         * UIProcess/mac/WebContextMenuProxyMac.h:
2229         * UIProcess/mac/WebContextMenuProxyMac.mm:
2230         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
2231         (WebKit::WebContextMenuProxyMac::showContextMenu):
2232
2233 2018-01-08  John Wilander  <wilander@apple.com>
2234
2235         Storage Access API: Remove access for all frames under a page when the page is closed
2236         https://bugs.webkit.org/show_bug.cgi?id=181398
2237         <rdar://problem/36357879>
2238
2239         Reviewed by Alex Christensen.
2240
2241         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2242         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
2243         * NetworkProcess/NetworkConnectionToWebProcess.h:
2244         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2245         * WebProcess/WebPage/WebPage.cpp:
2246         (WebKit::WebPage::close):
2247
2248 2018-01-08  Youenn Fablet  <youenn@apple.com>
2249
2250         SWClientConnection should not keep references to service worker jobs
2251         https://bugs.webkit.org/show_bug.cgi?id=181381
2252
2253         Reviewed by Chris Dumez.
2254
2255         Updated IPC handling based on WebCore refactoring.
2256
2257         * Scripts/webkit/messages.py:
2258         (forward_declarations_and_headers):
2259         (headers_for_type):
2260         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2261         (WebKit::WebSWServerConnection::rejectJobInClient):
2262         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2263         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2264         (WebKit::WebSWServerConnection::startScriptFetchInClient):
2265         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2266         * WebProcess/Storage/WebSWClientConnection.messages.in:
2267
2268 2018-01-08  Joseph Pecoraro  <pecoraro@apple.com>
2269
2270         [Cocoa] Web Inspector: Provide a way for clients to check if an NSWindow is a Web Inspector window
2271         https://bugs.webkit.org/show_bug.cgi?id=181361
2272         <rdar://problem/36332865>
2273
2274         Reviewed by Darin Adler.
2275
2276         * WebKit.xcodeproj/project.pbxproj:
2277         New files.
2278
2279         * Shared/API/Cocoa/_WKNSWindowExtras.h: Added.
2280         * Shared/API/Cocoa/_WKNSWindowExtras.mm: Added.
2281         (-[NSWindow _web_isWebInspectorWindow]):
2282         Method to determing if a window is being used for Web Inspector content.
2283
2284         * UIProcess/mac/WKInspectorWindow.h: Added.
2285         * UIProcess/mac/WKInspectorWindow.mm: Added.
2286         Named subclass so we can use isKindOfClass.
2287
2288         * UIProcess/mac/WebInspectorProxyMac.mm:
2289         (WebKit::WebInspectorProxy::createFrontendWindow):
2290         Use the named subclass.
2291
2292 2018-01-08  Tim Horton  <timothy_horton@apple.com>
2293
2294         Build fix for WKPDFView
2295         https://bugs.webkit.org/show_bug.cgi?id=181399
2296         <rdar://problem/36311915>
2297
2298         Reviewed by Simon Fraser.
2299
2300         * UIProcess/ios/WKPDFView.mm:
2301         Disable deprecation warnings in this whole file.
2302
2303 2018-01-08  Youenn Fablet  <youenn@apple.com>
2304
2305         Caches::writeCachesToDisk should assert that it is initialized
2306         https://bugs.webkit.org/show_bug.cgi?id=181383
2307
2308         Reviewed by Alex Christensen.
2309
2310         Add assertion to ensure caches is initialized
2311
2312         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2313         (WebKit::CacheStorage::Caches::writeCachesToDisk):
2314
2315 2018-01-08  Youenn Fablet  <youenn@apple.com>
2316
2317         WebProcessPool::terminateServiceWorkerProcess should protect itself in debug builds
2318         https://bugs.webkit.org/show_bug.cgi?id=181384
2319
2320         Reviewed by Chris Dumez.
2321
2322         * UIProcess/WebProcessPool.cpp:
2323         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
2324
2325 2018-01-08  Frederic Wang  <fwang@igalia.com>
2326
2327         Unreviewed build fix after r226211.
2328
2329         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Use WK_IOS_TBA for iOS.
2330
2331 2018-01-08  Youenn Fablet  <youenn@apple.com>
2332
2333         navigator.onLine does not work inside service workers
2334         https://bugs.webkit.org/show_bug.cgi?id=181079
2335         <rdar://problem/36178606>
2336
2337         Reviewed by Darin Adler.
2338
2339         Added support for a callback called for each service worker proxy creation.
2340         Callback is used by WTR to inject a self.internals object used for testing.
2341
2342         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2343         (WKBundleSetServiceWorkerProxyCreationCallback):
2344         * WebProcess/InjectedBundle/API/c/WKBundle.h:
2345         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2346         (WebKit::InjectedBundle::setServiceWorkerProxyCreationCallback):
2347         * WebProcess/InjectedBundle/InjectedBundle.h:
2348
2349 2018-01-07  David Kilzer  <ddkilzer@apple.com>
2350
2351         Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects
2352         <https://webkit.org/b/181256>
2353         <rdar://problem/36281730>
2354
2355         Reviewed by Darin Adler.
2356
2357         * Configurations/Base.xcconfig:
2358         (WARNING_CFLAGS): Add -Wcast-qual.
2359         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
2360         (WTF::Persistence::encodeCertificateChain): Include
2361         TypeCastsCF.h from WTF, and use
2362         checked_cf_cast<SecCertificateRef>() to fix warning.
2363         * Platform/cocoa/WKCrashReporter.mm:
2364         (WebKit::setCrashReportApplicationSpecificInformation):
2365         - Move `oldMessage` check above nullptr check to fix a leak when
2366           passing in nullptr after previously setting the crash string.
2367         - Change C-style cast to const_cast<char*>() to fix warning.
2368         * PluginProcess/mac/PluginProcessShim.mm:
2369         (WebKit::shim_shmat): Change C-style cast to
2370         const_cast<void*>() to fix warning.
2371         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
2372         (WebKit::leafCertificate): Include TypeCastsCF.h from
2373         WTF, and use checked_cf_cast<SecCertificateRef>() to fix
2374         warning.
2375         * Shared/cf/ArgumentCodersCF.cpp:
2376         (IPC::encode): Use static_cast<>(const_cast<void*>() to
2377         fix warnings since the CFTypeID has already been
2378         checked.
2379         * Shared/mac/WebCoreArgumentCodersMac.mm:
2380         (IPC::decodeNSError): Use an `auto` variable to hold the
2381         CFMutableDictionaryRef, then WTFMove() to assign it back to
2382         `userInfo`.
2383         * UIProcess/Cocoa/WebViewImpl.mm:
2384         (WebKit::takeWindowSnapshot): Include TypeCastsCF.h from
2385         WTF, and use checked_cf_cast<CGImageRef>() to fix
2386         warning.
2387
2388 2018-01-07  Konstantin Tokarev  <annulen@yandex.ru>
2389
2390         [cmake] Unset CMAKE_REQUIRED_LIBRARIES after check_function_exists test
2391         https://bugs.webkit.org/show_bug.cgi?id=181371
2392
2393         Reviewed by Michael Catanzaro.
2394
2395         This variable is used by check_function_exists internally, its value
2396         should be never used for anything else.
2397
2398         * CMakeLists.txt:
2399
2400 2018-01-05  Dan Bernstein  <mitz@apple.com>
2401
2402         REGRESSION (r226218): iOS-only assets are installed on macOS
2403         https://bugs.webkit.org/show_bug.cgi?id=181362
2404
2405         Reviewed by Anders Carlsson.
2406
2407         * Configurations/WebKit.xcconfig: Exclude everything under Resources/ios when not targeting
2408           iOS.
2409
2410         * Resources/ios: Added.
2411         * Resources/ios/iOS.xcassets: Moved from Source/WebKit/WebKit.xcassets.
2412         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Set the
2413           svn:mime-type property.
2414         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Ditto.
2415
2416         * Resources/mac: Added.
2417         * Resources/mac/mediaIcon.pdf: Moved here…
2418         * Resources/mediaIcon.pdf: …from here.
2419
2420         * WebKit.xcassets: Moved under Resources/ios.
2421
2422         * WebKit.xcodeproj/project.pbxproj: Created an ios group under the Resources group, and
2423           cleaned up the mac group. Removed the Recovered References group.
2424
2425 2018-01-05  John Wilander  <wilander@apple.com>
2426
2427         Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
2428         https://bugs.webkit.org/show_bug.cgi?id=181357
2429         <rdar://problem/36331031>
2430
2431         Reviewed by Alex Christensen.
2432
2433         This change does the following:
2434         - Changes function and message names to reflect how this feature
2435           was eventually implemented, i.e. access per frame.
2436         - Makes it explicit that the UI process is only involved in
2437           granting storage access and not removing storage access.
2438           The latter is done directly by the web process.
2439         - Simplifies the network process' entry map since only needs to
2440           be able to give access to one domain in one frame at a time.
2441           Access goes away on frame navigation so there can only be one
2442           domain at a time per frame. Also, the map now uses pageIDs as
2443           main keys to prepare for efficient access removal for all
2444           frames under a page.
2445         - Fixes a bug in so that a cross-origin iframe with the same
2446           partition as the top frame correctly is handled as already
2447           having access.
2448
2449         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2450         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
2451         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess): Deleted.
2452         * NetworkProcess/NetworkConnectionToWebProcess.h:
2453         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2454         * NetworkProcess/NetworkProcess.cpp:
2455         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2456         (WebKit::NetworkProcess::grantStorageAccessForFrame):
2457         (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): Deleted.
2458         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Deleted.
2459         * NetworkProcess/NetworkProcess.h:
2460         * NetworkProcess/NetworkProcess.messages.in:
2461         * UIProcess/Network/NetworkProcessProxy.cpp:
2462         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
2463         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame):
2464         (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): Deleted.
2465         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Deleted.
2466         * UIProcess/Network/NetworkProcessProxy.h:
2467         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2468         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2469         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2470         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2471         * UIProcess/WebResourceLoadStatisticsStore.h:
2472         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2473         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
2474         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler):
2475         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2476         (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): Deleted.
2477         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Deleted.
2478         * UIProcess/WebsiteData/WebsiteDataStore.h:
2479         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2480         (WebKit::WebFrameLoaderClient::detachedFromParent2):
2481         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
2482
2483 2018-01-05  Youenn Fablet  <youenn@apple.com>
2484
2485         Implement Cache API partitioning based on ClientOrigin
2486         https://bugs.webkit.org/show_bug.cgi?id=181240
2487
2488         Reviewed by Alex Christensen.
2489
2490         open and retrieveCaches now take a ClientOrigin instead of a String.
2491         Updated cache filesystem path computation to take both client origin and top origin.
2492
2493         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
2494         Caches are added to the web site data of their client origin with their corresponding cache size.
2495         Caches are added to the web site data of their top origin with a size equal to 0.
2496
2497         Updated memory representation dumping used for test to include both top and client origins.
2498
2499         * NetworkProcess/NetworkProcess.cpp:
2500         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2501         * NetworkProcess/cache/CacheStorageEngine.cpp:
2502         (WebKit::CacheStorage::Engine::cachesRootPath):
2503         (WebKit::CacheStorage::Engine::open):
2504         (WebKit::CacheStorage::Engine::remove):
2505         (WebKit::CacheStorage::Engine::retrieveCaches):
2506         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2507         (WebKit::CacheStorage::Engine::removeCaches):
2508         (WebKit::CacheStorage::Engine::fetchEntries):
2509         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
2510         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2511         (WebKit::CacheStorage::Engine::representation):
2512         * NetworkProcess/cache/CacheStorageEngine.h:
2513         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2514         (WebKit::CacheStorage::Cache::Cache):
2515         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2516         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
2517         (WebKit::CacheStorage::Caches::Caches):
2518         (WebKit::CacheStorage::Caches::storeOrigin):
2519         (WebKit::CacheStorage::Caches::readOrigin):
2520         (WebKit::CacheStorage::Caches::open):
2521         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2522         (WebKit::CacheStorage::Caches::create):
2523         (WebKit::CacheStorage::Caches::origin const):
2524         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2525         (WebKit::CacheStorageEngineConnection::open):
2526         (WebKit::CacheStorageEngineConnection::caches):
2527         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2528         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2529         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2530         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2531         (WebKit::WebCacheStorageConnection::doOpen):
2532         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
2533         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2534         * WebProcess/Cache/WebCacheStorageConnection.h:
2535
2536 2018-01-05  Megan Gardner  <megan_gardner@apple.com>
2537
2538         Show Keyboard when re-launching WKWebView with a previously focused element
2539         https://bugs.webkit.org/show_bug.cgi?id=181353
2540
2541         Reviewed by Tim Horton.
2542
2543         When relaunching an app with a WKWebView, restore the keyboard if there was a previously
2544         focused element that was being assisted. The element was already being tracked, we just
2545         needed to not bail on showing the keyboard for instances where it was a state change that
2546         caused the element to be refocused.
2547
2548         * UIProcess/PageClient.h:
2549         * UIProcess/WebPageProxy.h:
2550         * UIProcess/WebPageProxy.messages.in:
2551         * UIProcess/ios/PageClientImplIOS.h:
2552         * UIProcess/ios/PageClientImplIOS.mm:
2553         (WebKit::PageClientImpl::startAssistingNode):
2554         * UIProcess/ios/WKContentView.h:
2555         * UIProcess/ios/WKContentViewInteraction.h:
2556         * UIProcess/ios/WKContentViewInteraction.mm:
2557         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2558         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Deleted.
2559         * UIProcess/ios/WebPageProxyIOS.mm:
2560         (WebKit::WebPageProxy::startAutoscrollAtPosition):
2561         (WebKit::WebPageProxy::startAssistingNode):
2562         * WebProcess/WebPage/WebPage.cpp:
2563         (WebKit::WebPage::setActivityState):
2564         (WebKit::WebPage::elementDidFocus):
2565         * WebProcess/WebPage/WebPage.h:
2566
2567 2018-01-05  Alex Christensen  <achristensen@webkit.org>
2568
2569         Restrict navigation-time WKWebsiteDataStore swapping to main frame navigations
2570         https://bugs.webkit.org/show_bug.cgi?id=181217
2571
2572         Reviewed by Tim Horton.
2573
2574         If we swap during an iframe navigation, then we get a page in a strange state.
2575         The intent of the main frame navigation WKWebsiteDataStore swap is that
2576         that is a time when we can change storages without a page in an inconsistent state.
2577
2578         * UIProcess/Cocoa/NavigationState.mm:
2579         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2580
2581 2018-01-05  Alex Christensen  <achristensen@webkit.org>
2582
2583         Add WKBundleFrameCreateFrameHandle
2584         https://bugs.webkit.org/show_bug.cgi?id=181232
2585         <rdar://problem/35926696>
2586
2587         Reviewed by Tim Horton.
2588
2589         InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function.
2590         Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef
2591         in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent
2592         of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle.
2593         We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the 
2594         existing C API, so let's add a way for clients to say "I want a _WKFrameHandle".
2595
2596         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2597         (WKBundleFrameCreateFrameHandle):
2598         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2599
2600 2018-01-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2601
2602         [Attachment Support] Add a way to write blob data to a file URL from the UI process
2603         https://bugs.webkit.org/show_bug.cgi?id=181236
2604
2605         Reviewed by Brady Eidson.
2606
2607         Add support for writing a blob to a designated file path. In WebKit, this is mainly plumbing writeBlobToFilePath
2608         through WebPageProxy to the network process.
2609
2610         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2611         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
2612
2613         Call out to the BlobRegistryImpl to write blobs to the file path. Additionally grant sandbox extensions for any
2614         file-backed blob parts corresponding to the given blob URL.
2615
2616         (WebKit::NetworkBlobRegistry::filesInBlob):
2617
2618         Introduce a version of filesInBlob that doesn't check against the NetworkConnectionToWebProcess. This is used
2619         when the UI process is the driver for writing a blob.
2620
2621         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2622         * NetworkProcess/NetworkProcess.cpp:
2623         (WebKit::NetworkProcess::writeBlobToFilePath):
2624
2625         Temporarily grant sandbox access to the given file path.
2626
2627         * NetworkProcess/NetworkProcess.h:
2628         * NetworkProcess/NetworkProcess.messages.in:
2629         * Shared/WebCoreArgumentCoders.cpp:
2630         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
2631         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
2632         (IPC::ArgumentCoder<PromisedBlobData>::encode): Deleted.
2633         (IPC::ArgumentCoder<PromisedBlobData>::decode): Deleted.
2634
2635         Remove PromisedBlobData (see WebCore/ChangeLog for more information).
2636
2637         * Shared/WebCoreArgumentCoders.h:
2638         * UIProcess/Network/NetworkProcessProxy.cpp:
2639         (WebKit::NetworkProcessProxy::didClose):
2640
2641         If the network process is terminated, flush any pending callbacks in m_writeBlobToFilePathCallbackMap, passing
2642         in a failure result (success := false) and clearing the callback map.
2643
2644         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
2645         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath):
2646         * UIProcess/Network/NetworkProcessProxy.h:
2647         * UIProcess/Network/NetworkProcessProxy.messages.in:
2648         * UIProcess/WebPageProxy.cpp:
2649         (WebKit::WebPageProxy::writeBlobToFilePath):
2650         * UIProcess/WebPageProxy.h:
2651
2652 2018-01-05  Dan Bernstein  <mitz@apple.com>
2653
2654         Add injected bundle equivalents of DOMHTMLDocument (DOMHTMLDocumentExtensions)
2655         https://bugs.webkit.org/show_bug.cgi?id=181345
2656
2657         Reviewed by Tim Horton.
2658
2659         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Declared new methods.
2660         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
2661         (-[WKDOMDocument createDocumentFragmentWithMarkupString:baseURL:]): Added. Calls WebCore’s
2662           createFragmentFromMarkup.
2663         (-[WKDOMDocument createDocumentFragmentWithText:]): Added. Calls WebCore’s
2664           createFragmentFromText.
2665
2666 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
2667
2668         [Curl] Add implementation stubs for Network Cache
2669         https://bugs.webkit.org/show_bug.cgi?id=181343
2670
2671         Reviewed by Alex Christensen.
2672
2673         * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Added.
2674         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
2675         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2676         * NetworkProcess/cache/NetworkCacheDataCurl.cpp: Added.
2677         (WebKit::NetworkCache::Data::Data):
2678         (WebKit::NetworkCache::Data::empty):
2679         (WebKit::NetworkCache::Data::data const):
2680         (WebKit::NetworkCache::Data::isNull const):
2681         (WebKit::NetworkCache::Data::apply const):
2682         (WebKit::NetworkCache::Data::subrange const):
2683         (WebKit::NetworkCache::concatenate):
2684         (WebKit::NetworkCache::Data::adoptMap):
2685         * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: Added.
2686         (WebKit::NetworkCache::IOChannel::IOChannel):
2687         (WebKit::NetworkCache::IOChannel::~IOChannel):
2688         (WebKit::NetworkCache::IOChannel::open):
2689         (WebKit::NetworkCache::IOChannel::read):
2690         (WebKit::NetworkCache::IOChannel::write):
2691         * PlatformWin.cmake:
2692
2693 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
2694
2695         [Curl] Update method declarations in WebKit
2696         https://bugs.webkit.org/show_bug.cgi?id=181342
2697
2698         Reviewed by Alex Christensen.
2699
2700         * NetworkProcess/Downloads/curl/DownloadCurl.cpp:
2701         (WebKit::Download::resume):
2702         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
2703         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
2704         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
2705
2706 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
2707
2708         WebFullScreenManager should compile when ENABLE(VIDEO) is off
2709         https://bugs.webkit.org/show_bug.cgi?id=181338
2710
2711         Reviewed by Alex Christensen.
2712
2713         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2714         (WebKit::WebFullScreenManager::didEnterFullScreen):
2715         (WebKit::WebFullScreenManager::willExitFullScreen):
2716         * WebProcess/FullScreen/WebFullScreenManager.h:
2717
2718 2018-01-05  Andy Estes  <aestes@apple.com>
2719
2720         [Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework
2721         https://bugs.webkit.org/show_bug.cgi?id=181335
2722         <rdar://problem/36311296>
2723
2724         Reviewed by Brady Eidson.
2725
2726         When Safari is running in the macOS Base System, PassKit.framework is not available.
2727         If we fail to dlopen PassKit, we should disable Apple Pay.
2728
2729         * UIProcess/API/C/WKPreferences.cpp:
2730         (WKPreferencesSetApplePayEnabled):
2731         * UIProcess/API/Cocoa/WKWebView.mm:
2732         (-[WKWebView _initializeWithConfiguration:]):
2733         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2734         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2735         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
2736         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments):
2737
2738 2018-01-05  Dan Bernstein  <mitz@apple.com>
2739
2740         Fixed the build following AppKit API deprecations in a recent SDKs
2741
2742         * UIProcess/mac/WKFullScreenWindowController.mm:
2743         (-[WKFullScreenWindowController enterFullScreen:]): Suppressed deprecation warnings.
2744         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
2745         (-[WKFullScreenWindowController exitFullScreen]): Ditto.
2746         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
2747         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Ditto.
2748         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Ditto.
2749         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
2750         * UIProcess/mac/WKPrintingView.mm:
2751         (-[WKPrintingView _setAutodisplay:]): Ditto.
2752
2753 2018-01-05  Matt Lewis  <jlewis3@apple.com>
2754
2755         Unreviewed, rolling out r226401.
2756
2757         This caused timeouts on multiple platforms.
2758
2759         Reverted changeset:
2760
2761         "Implement Cache API partitioning based on ClientOrigin"
2762         https://bugs.webkit.org/show_bug.cgi?id=181240
2763         https://trac.webkit.org/changeset/226401
2764
2765 2018-01-05  Joseph Pecoraro  <pecoraro@apple.com>
2766
2767         ServiceWorkers: Enable UserTiming / ResourceTiming
2768         https://bugs.webkit.org/show_bug.cgi?id=181297
2769         <rdar://problem/36307306>
2770
2771         Reviewed by Youenn Fablet.
2772
2773         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2774         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
2775         Enable Resource Timing / User Timing for the ServiceWorker process.
2776
2777 2018-01-04  Zan Dobersek  <zdobersek@igalia.com>
2778
2779         Unreviewed GTK+ build fix.
2780
2781         * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp:
2782         (webkit_user_media_permission_is_for_audio_device):
2783         Call UserMediaPermissionRequestProxy::requiresAudioCapture().
2784         (webkit_user_media_permission_is_for_video_device):
2785         Call UserMediaPermissionRequestProxy::requiresVideoCapture().
2786
2787 2018-01-04  Don Olmstead  <don.olmstead@sony.com>
2788
2789         [Curl] Fix compilation error in WebFrameNetworkingContext
2790         https://bugs.webkit.org/show_bug.cgi?id=181312
2791
2792         Reviewed by Alex Christensen.
2793
2794         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
2795         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2796
2797 2018-01-04  Tim Horton  <timothy_horton@apple.com>
2798
2799         WKWebView loses minimum layout size overrides that happen while the process is terminated
2800         https://bugs.webkit.org/show_bug.cgi?id=181306
2801         <rdar://problem/34398288>
2802
2803         Reviewed by Dan Bernstein.
2804
2805         * Shared/WebPageCreationParameters.cpp:
2806         (WebKit::WebPageCreationParameters::encode const):
2807         (WebKit::WebPageCreationParameters::decode):
2808         * Shared/WebPageCreationParameters.h:
2809         * UIProcess/API/Cocoa/WKWebView.mm:
2810         (-[WKWebView _didRelaunchProcess]): Deleted.
2811         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2812         * UIProcess/WebPageProxy.cpp:
2813         (WebKit::WebPageProxy::creationParameters):
2814         * UIProcess/WebPageProxy.h:
2815         * UIProcess/ios/PageClientImplIOS.mm:
2816         (WebKit::PageClientImpl::didRelaunchProcess):
2817         * UIProcess/ios/WebPageProxyIOS.mm:
2818         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
2819         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
2820         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
2821         * WebProcess/WebPage/WebPage.cpp:
2822         (WebKit::WebPage::WebPage):
2823         Pass the current viewport minimum layout size and maximum unobscured size
2824         in the WebPageCreationParameters instead of re-sending them in _didRelaunchProcess.
2825
2826         The previous approach was problematic when _dispatchSetMinimumLayoutSize:
2827         was changed to not re-send identical updates, because if the client calls 
2828         _overrideLayoutParametersWithMinimumLayoutSize before the Web Content process
2829         is re-launched (after terminating), we would cache the size, attempt to send it,
2830         fail silently (because the process is not launched), and then in _didRelaunchProcess
2831         we would choose not to re-send (after the process is successfully relaunched)
2832         because we think we already sent the new value.
2833
2834         Add isValid() checks to our message sends. Ideally send() would assert
2835         if the process is not alive to avoid problems like this, but it doesn't (yet).
2836
2837         Get rid of WKWebView's _didRelaunchProcess, because it does nothing now.
2838
2839 2018-01-04  Stephan Szabo  <stephan.szabo@sony.com>
2840
2841         NetworkProcess cache files use functions from unistd.h without explicitly including it
2842         https://bugs.webkit.org/show_bug.cgi?id=181261
2843
2844         Reviewed by Alex Christensen.
2845
2846         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2847         * NetworkProcess/cache/NetworkCacheData.cpp:
2848
2849 2018-01-04  Keith Rollin  <krollin@apple.com>
2850
2851         Add commas
2852         https://bugs.webkit.org/show_bug.cgi?id=181295
2853         <rdar://problem/35802295>
2854
2855         Reviewed by Brent Fulgham.
2856
2857         Fix a problem introduced in r226226 where the emitted JSON didn't
2858         include some required commas.
2859
2860         * NetworkProcess/NetworkResourceLoader.cpp:
2861         (WebKit::NetworkResourceLoader::logCookieInformation const):
2862
2863 2018-01-04  Eric Carlson  <eric.carlson@apple.com>
2864
2865         [MediaStream] Add Mock screen capture source
2866         https://bugs.webkit.org/show_bug.cgi?id=181291
2867         <rdar://problem/36298164>
2868
2869         Reviewed by Dean Jackson.
2870
2871         * Shared/WebCoreArgumentCoders.cpp:
2872         (IPC::ArgumentCoder<MediaConstraints>::decode):
2873         (IPC::ArgumentCoder<CaptureDevice>::encode): Deleted, moved to CaptureDevice.h
2874         (IPC::ArgumentCoder<CaptureDevice>::decode): Ditto.
2875         * Shared/WebCoreArgumentCoders.h:
2876
2877         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _WKCaptureDeviceDisplay.
2878         * UIProcess/Cocoa/UIDelegate.mm:
2879         (WebKit::requestUserMediaAuthorizationForDevices): Deal with display capture.
2880         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
2881
2882         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2883         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): requiresAudio -> requiresAudioCapture.
2884         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Never reuse
2885         a previously granted display capture request.
2886
2887         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2888         (WebKit::UserMediaPermissionRequestProxy::allow): Search the eligible devices instead of asking
2889         the source center to find devices.
2890         * UIProcess/UserMediaPermissionRequestProxy.h:
2891         (WebKit::UserMediaPermissionRequestProxy::requiresAudioCapture const): Renamed.
2892         (WebKit::UserMediaPermissionRequestProxy::requiresVideoCapture const): Ditto.
2893         (WebKit::UserMediaPermissionRequestProxy::requiresDisplayCapture const): New.
2894         (WebKit::UserMediaPermissionRequestProxy::requiresAudio const): Deleted.
2895         (WebKit::UserMediaPermissionRequestProxy::requiresVideo const): Deleted.
2896
2897 2018-01-04  Youenn Fablet  <youenn@apple.com>
2898
2899         FetchResponse should set its internal response text encoding name
2900         https://bugs.webkit.org/show_bug.cgi?id=181284
2901
2902         Reviewed by Alex Christensen.
2903
2904         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2905         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Set default encoding to UTF-8.
2906
2907 2018-01-04  Youenn Fablet  <youenn@apple.com>
2908
2909         Implement Cache API partitioning based on ClientOrigin
2910         https://bugs.webkit.org/show_bug.cgi?id=181240
2911
2912         Reviewed by Alex Christensen.
2913
2914         open and retrieveCaches now take a ClientOrigin instead of a String.
2915         Updated cache filesystem path computation to take both client origin and top origin.
2916
2917         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
2918         Caches are added to the web site data of their client origin with their corresponding cache size.
2919         Caches are added to the web site data of their top origin with a size equal to 0.
2920
2921         Updated memory representation dumping used for test to include both top and client origins.
2922
2923         * NetworkProcess/NetworkProcess.cpp:
2924         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2925         * NetworkProcess/cache/CacheStorageEngine.cpp:
2926         (WebKit::CacheStorage::Engine::cachesRootPath):
2927         (WebKit::CacheStorage::Engine::open):
2928         (WebKit::CacheStorage::Engine::remove):
2929         (WebKit::CacheStorage::Engine::retrieveCaches):
2930         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2931         (WebKit::CacheStorage::Engine::removeCaches):
2932         (WebKit::CacheStorage::Engine::fetchEntries):
2933         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
2934         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2935         (WebKit::CacheStorage::Engine::representation):
2936         * NetworkProcess/cache/CacheStorageEngine.h:
2937         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2938         (WebKit::CacheStorage::Cache::Cache):
2939         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2940         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
2941         (WebKit::CacheStorage::Caches::Caches):
2942         (WebKit::CacheStorage::Caches::storeOrigin):
2943         (WebKit::CacheStorage::Caches::readOrigin):
2944         (WebKit::CacheStorage::Caches::open):
2945         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2946         (WebKit::CacheStorage::Caches::create):
2947         (WebKit::CacheStorage::Caches::origin const):
2948         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2949         (WebKit::CacheStorageEngineConnection::open):
2950         (WebKit::CacheStorageEngineConnection::caches):
2951         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2952         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2953         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2954         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2955         (WebKit::WebCacheStorageConnection::doOpen):
2956         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
2957         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2958         * WebProcess/Cache/WebCacheStorageConnection.h:
2959
2960 2018-01-04  Youenn Fablet  <youenn@apple.com>
2961
2962         Service Worker should expose redirect mode for navigation loads as manual
2963         https://bugs.webkit.org/show_bug.cgi?id=181067
2964
2965         Reviewed by Alex Christensen.
2966
2967         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2968         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2969
2970 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2971
2972         [Attachment Support] Create attachment elements when dropping files on iOS
2973         https://bugs.webkit.org/show_bug.cgi?id=181192
2974         <rdar://problem/36280945>
2975
2976         Reviewed by Tim Horton.
2977
2978         Make some minor adjustments for changes to the pasteboard in WebCore. See WebCore/ChangeLog for more detail.
2979         Teaches WebPasteboardProxy et. al. to plumb PasteboardItemInfo from the UI process to the web process via the
2980         new `InformationForItemAtIndex` codepath.
2981
2982         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2983         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
2984         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): Deleted.
2985         * UIProcess/WebPasteboardProxy.h:
2986         * UIProcess/WebPasteboardProxy.messages.in:
2987         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2988         (WebKit::WebPlatformStrategies::informationForItemAtIndex):
2989         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): Deleted.
2990         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2991
2992 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
2993
2994         Replace hard-coded paths in shebangs with #!/usr/bin/env
2995         https://bugs.webkit.org/show_bug.cgi?id=181040
2996
2997         Reviewed by Alex Christensen.
2998
2999         * Scripts/generate-forwarding-headers.pl:
3000
3001 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3002
3003         [Attachment Support] Add plumbing for starting a drag with promised blob data
3004         https://bugs.webkit.org/show_bug.cgi?id=181201
3005
3006         Reviewed by Tim Horton.
3007
3008         Add boilerplate plumbing for PrepareToDragPromisedBlob, which delivers blob promises to the UI process when
3009         dragging, respectively.
3010
3011         * Scripts/webkit/messages.py:
3012         (headers_for_type):
3013         * Shared/WebCoreArgumentCoders.cpp:
3014         (IPC::encodeTypesAndData):
3015         (IPC::decodeTypesAndData):
3016         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
3017         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
3018         (IPC::ArgumentCoder<PasteboardImage>::encode):
3019         (IPC::ArgumentCoder<PasteboardImage>::decode):
3020         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
3021         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
3022
3023         Add IPC support PromisedBlobInfo's additionalTypes and additionalData.
3024
3025         (IPC::encodeClientTypesAndData): Deleted.
3026         (IPC::decodeClientTypesAndData): Deleted.
3027
3028         Rename these helper functions and move them to the top of the file.
3029
3030         * UIProcess/Cocoa/WebViewImpl.h:
3031         * UIProcess/Cocoa/WebViewImpl.mm:
3032         (WebKit::WebViewImpl::prepareToDragPromisedBlob):
3033         * UIProcess/PageClient.h:
3034         (WebKit::PageClient::prepareToDragPromisedBlob):
3035         * UIProcess/WebPageProxy.cpp:
3036         (WebKit::WebPageProxy::prepareToDragPromisedBlob):
3037         * UIProcess/WebPageProxy.h:
3038         * UIProcess/WebPageProxy.messages.in:
3039         * UIProcess/ios/PageClientImplIOS.h:
3040         * UIProcess/ios/PageClientImplIOS.mm:
3041         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
3042         * UIProcess/ios/WKContentViewInteraction.h:
3043         * UIProcess/ios/WKContentViewInteraction.mm:
3044         (-[WKContentView _prepareToDragPromisedBlob:]):
3045         * UIProcess/mac/PageClientImplMac.h:
3046         * UIProcess/mac/PageClientImplMac.mm:
3047         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
3048         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3049         (WebKit::WebDragClient::prepareToDragPromisedBlob):
3050         * WebProcess/WebCoreSupport/WebDragClient.h:
3051         * WebProcess/WebPage/WebPage.cpp:
3052         (WebKit::WebPage::prepareToDragPromisedBlob):
3053         * WebProcess/WebPage/WebPage.h:
3054
3055 2018-01-03  David Kilzer  <ddkilzer@apple.com>
3056
3057         REGRESSION (r212929): WKSnapshotConfiguration may leak an NSNumber when deallocated
3058         <https://webkit.org/b/181274>
3059
3060         Reviewed by Joseph Pecoraro.
3061
3062         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
3063         (-[WKSnapshotConfiguration dealloc]): Implement method and
3064         release _snapshotWidth.
3065
3066 2018-01-03  John Wilander  <wilander@apple.com>
3067
3068         Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
3069         https://bugs.webkit.org/show_bug.cgi?id=181270
3070         <rdar://problem/36289544>
3071
3072         Reviewed by Alex Christensen.
3073
3074         This change refactors how the web process tells the network process
3075         to remove storage access. Previously, this was done over the UI process
3076         just like requests for storage access. But since no further reasoning
3077         is needed, the message should go straight from the web process to the
3078         network process for performance reasons and to minimize the risk of a
3079         race.
3080
3081         As a consequence, the XPC code for storage access removal in the UI
3082         process is deleted.
3083
3084         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3085         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess):
3086         * NetworkProcess/NetworkConnectionToWebProcess.h:
3087         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3088         * NetworkProcess/NetworkProcess.cpp:
3089         (WebKit::NetworkProcess::removeStorageAccess): Deleted.
3090         * NetworkProcess/NetworkProcess.h:
3091         * NetworkProcess/NetworkProcess.messages.in:
3092         * UIProcess/Network/NetworkProcessProxy.cpp:
3093         (WebKit::NetworkProcessProxy::removeStorageAccess): Deleted.
3094         * UIProcess/Network/NetworkProcessProxy.h:
3095         * UIProcess/WebPageProxy.cpp:
3096         (WebKit::WebPageProxy::requestStorageAccess):
3097         (WebKit::WebPageProxy::removeStorageAccess): Deleted.
3098         * UIProcess/WebPageProxy.h:
3099         * UIProcess/WebPageProxy.messages.in:
3100         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3101         (WebKit::WebsiteDataStore::requestStorageAccess):
3102         (WebKit::WebsiteDataStore::removeStorageAccess): Deleted.
3103         * UIProcess/WebsiteData/WebsiteDataStore.h:
3104         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3105         (WebKit::WebFrameLoaderClient::detachedFromParent2):
3106         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
3107
3108 2018-01-03  David Kilzer  <ddkilzer@apple.com>
3109
3110         com.apple.WebKit.Networking crash in com.apple.Foundation: -[__NSOperationInternal _start:]
3111         <https://webkit.org/b/181272>
3112         <rdar://problem/35657310>
3113
3114         Reviewed by Alex Christensen.
3115
3116         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3117         (downgradeRequest): Remove unnecessary -autorelease.
3118
3119 2018-01-03  Brent Fulgham  <bfulgham@apple.com>
3120
3121         [macOS] Constant frame dropping during Flash video playback
3122         https://bugs.webkit.org/show_bug.cgi?id=181249
3123         <rdar://problem/34843448>
3124
3125         Reviewed by Eric Carlson.
3126
3127         Review of logs during jerky flash video playback shows a few IOKit properties are being blocked by the sandbox,
3128         which prevents some high-efficiency codecs from being used. Add 'AppleGVAKeyDoesNotExist', 'IODVDBundleName', and
3129         'IOGVA*Encode' to the whitelist.
3130
3131         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3132
3133 2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3134
3135         [GTK] Add web process API to detect when form is submitted via JavaScript
3136         https://bugs.webkit.org/show_bug.cgi?id=173915
3137
3138         Reviewed by Carlos Garcia Campos.
3139
3140         Epiphany relies on the DOM submit event to detect when a form has been submitted. However,
3141         for historical reasons, the submit event is not emitted when a form is submitted by
3142         JavaScript. It is therefore not currently possible for a web browser to reliably detect form
3143         submission and not possible to implement a robust password storage feature. In order to
3144         avoid this problem, this patch adds a new WebKitWebPage signal, will-submit-form, that
3145         browsers can use in preference to a DOM event listener.
3146
3147         Unfortunately, this signal is not available for WPE because it depends on the DOM API.
3148
3149         There are two submission events, WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT and
3150         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE. WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
3151         occurs earlier than WEBKIT_FORM_SUBMISSION_WILL_COMPLETE and can be used to retrieve form
3152         values before websites receive the DOM submit event. This is useful as some websites like
3153         to delete form values right before a submit would normally happen in order to attempt to
3154         defeat browser password managers. There are two tricks to note: JavaScript can cancel form
3155         submission immediately after this event occurs (by returning false in an onsubmit handler),
3156         and, for historical reasons, this event will not occur at all when form submission is
3157         triggered by JavaScript. WEBKIT_FORM_SUBMISSION_WILL_COMPLETE occurs next, and is more
3158         straightforward: it is always emitted when a form is about to be submitted, when it is too
3159         late to cancel.
3160
3161         The recommended way to reliably retrieve password form values would be to watch for both
3162         events, use the form value detected in WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
3163         if that event is emitted, and use the value detected later in
3164         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE otherwise.
3165
3166         Since one of the signal arguments is an enum, we now have to run glib-mkenums for the web
3167         process API. And that has resulted in this patch also adding GType goo for
3168         WebKitConsoleMessageLevel and WebKitConsoleMessageSource that was previously missing. Any
3169         applications that for some unlikely reason want to use these enums in properties or signals
3170         will be happy.
3171
3172         * PlatformGTK.cmake:
3173         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3174         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
3175         (webkit_web_page_class_init):
3176         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
3177         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.cpp.template: Added.
3178         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.h.template: Added.
3179
3180 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3181
3182         Unreviewed. Really fix plugin process after r226327.
3183
3184         * PluginProcess/unix/PluginProcessMainUnix.cpp:
3185
3186 2018-01-02  Brent Fulgham  <bfulgham@apple.com>
3187
3188         [macOS, iOS] Adopt new secure coding APIs in WebKit
3189         https://bugs.webkit.org/show_bug.cgi?id=181085
3190         <rdar://problem/34837397>
3191
3192         Reviewed by Tim Horton.
3193
3194         Update WebKit code to use NSSecureCoding when the underlying operating system supports it. Use new
3195         wrapper functions so the same code can be built on all supported OS releases, while enabling
3196         seure coding when possible.
3197
3198         Note that NSView-based classes cannot be migrated at present due to AppKit not supporting NSSecureCoding
3199         in its class hierarchy.
3200
3201         Tested by exising TestWebKitAPI tests for Coding and data transfer.
3202
3203         * Platform/ios/AccessibilityIOS.mm:
3204         (WebKit::newAccessibilityRemoteToken): Encode using NSSecureCoding.
3205         * UIProcess/API/Cocoa/WKPreferences.h:
3206         * UIProcess/API/Cocoa/WKPreferences.mm:
3207         (+[WKPreferences supportsSecureCoding]): Added to enable NSSecureCoding.
3208         * UIProcess/API/Cocoa/WKProcessPool.h:
3209         * UIProcess/API/Cocoa/WKProcessPool.mm:
3210         (+[WKProcessPool supportsSecureCoding]): Ditto.
3211         * UIProcess/API/Cocoa/WKUserContentController.h:
3212         * UIProcess/API/Cocoa/WKUserContentController.mm:
3213         (+[WKUserContentController supportsSecureCoding]): Ditto.
3214         * UIProcess/API/Cocoa/WKWebView.mm:
3215         (-[WKWebView initWithCoder:]): Use coding initialization that supports secure coding if
3216         it is available in the supplied class.
3217         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3218         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3219         (+[WKWebViewConfiguration supportsSecureCoding]): Added to enable NSSecureCoding.
3220         (-[WKWebViewConfiguration initWithCoder:]): Use secure coding when possible.
3221         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3222         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3223         (+[WKWebsiteDataStore supportsSecureCoding]): Added to enable NSSecureCoding.
3224         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
3225         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
3226         (+[_WKApplicationManifest supportsSecureCoding]): Added to enable NSSecureCoding.
3227         (-[_WKApplicationManifest initWithCoder:]): Use secure coding when possible.
3228
3229 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
3230
3231         Remove std::chrono completely
3232         https://bugs.webkit.org/show_bug.cgi?id=181186
3233
3234         Reviewed by Alex Christensen.
3235
3236         Use MonotonicTime, WallTime, and Seconds instead.
3237         Changes are mechanical ones.
3238
3239         * NetworkProcess/NetworkProcess.cpp:
3240         (WebKit::NetworkProcess::deleteWebsiteData):
3241         * NetworkProcess/NetworkProcess.h:
3242         * NetworkProcess/NetworkProcess.messages.in:
3243         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3244         (WebKit::CacheStorage::Caches::clear):
3245         * NetworkProcess/cache/NetworkCache.cpp:
3246         (WebKit::NetworkCache::responseHasExpired):
3247         (WebKit::NetworkCache::responseNeedsRevalidation):
3248         (WebKit::NetworkCache::makeStoreDecision):
3249         (WebKit::NetworkCache::Cache::clear):
3250         (WebKit::NetworkCache::Cache::storeData):
3251         * NetworkProcess/cache/NetworkCache.h:
3252         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3253         (WebKit::NetworkCache::Entry::Entry):
3254         (WebKit::NetworkCache::Entry::asJSON const):
3255         * NetworkProcess/cache/NetworkCacheEntry.h:
3256         (WebKit::NetworkCache::Entry::timeStamp const):
3257         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3258         (WebKit::NetworkCache::fileTimes):
3259         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
3260         * NetworkProcess/cache/NetworkCacheFileSystem.h:
3261         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3262         (WebKit::NetworkCache::IOChannel::IOChannel):
3263         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3264         (WebKit::NetworkCache::responseNeedsRevalidation):
3265         (WebKit::NetworkCache::canRevalidate):
3266         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3267         (WebKit::NetworkCache::Storage::readRecord):
3268         (WebKit::NetworkCache::Storage::clear):
3269         (WebKit::NetworkCache::computeRecordWorth):
3270         * NetworkProcess/cache/NetworkCacheStorage.h:
3271         Bump the cache version. We now change the data in persistent cache.
3272         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
3273         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
3274         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
3275         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
3276         (WebKit::NetworkCache::SubresourceInfo::lastSeen const):
3277         (WebKit::NetworkCache::SubresourceInfo::firstSeen const):
3278         (WebKit::NetworkCache::SubresourcesEntry::timeStamp const):
3279         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3280         (WebKit::NetworkProcess::clearHSTSCache):
3281         (WebKit::clearNSURLCache):
3282         (WebKit::NetworkProcess::clearDiskCache):
3283         * NetworkProcess/curl/NetworkProcessCurl.cpp:
3284         (WebKit::NetworkProcess::clearDiskCache):
3285         * NetworkProcess/mac/NetworkProcessMac.mm:
3286         (WebKit::NetworkProcess::clearCacheForAllOrigins):
3287         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3288         (WebKit::NetworkProcess::clearCacheForAllOrigins):
3289         (WebKit::NetworkProcess::clearDiskCache):
3290         * Platform/IPC/ArgumentCoders.cpp:
3291         (IPC::ArgumentCoder<WallTime>::encode):
3292         (IPC::ArgumentCoder<WallTime>::decode):
3293         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::encode): Deleted.
3294         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode): Deleted.
3295         * Platform/IPC/ArgumentCoders.h:
3296         * PluginProcess/PluginProcess.cpp:
3297         (WebKit::PluginProcess::deleteWebsiteData):
3298         * PluginProcess/PluginProcess.h:
3299         * PluginProcess/PluginProcess.messages.in:
3300         * Scripts/webkit/messages.py:
3301         (headers_for_type):
3302         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
3303         (WebKit::RemoteLayerBackingStore::lastDisplayTime const):
3304         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
3305         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
3306         (WebKit::RemoteLayerBackingStore::display):
3307         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
3308         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
3309         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile):
3310         (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
3311         * Shared/WebCoreArgumentCoders.cpp:
3312         (IPC::ArgumentCoder<RecentSearch>::decode):
3313         (IPC::ArgumentCoder<WallTime>::encode): Deleted.
3314         (IPC::ArgumentCoder<WallTime>::decode): Deleted.
3315         * Shared/WebCoreArgumentCoders.h:
3316         * StorageProcess/StorageProcess.cpp:
3317         (WebKit::StorageProcess::deleteWebsiteData):
3318         * StorageProcess/StorageProcess.h:
3319         * StorageProcess/StorageProcess.messages.in:
3320         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3321         (WKApplicationCacheManagerDeleteAllEntries):
3322         * UIProcess/API/C/WKCookieManager.cpp:
3323         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
3324         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
3325         (WKKeyValueStorageManagerDeleteAllEntries):
3326         * UIProcess/API/C/WKResourceCacheManager.cpp:
3327         (WKResourceCacheManagerClearCacheForAllOrigins):
3328         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3329         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
3330         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
3331         (WKWebsiteDataStoreRemoveAllFetchCaches):
3332         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
3333         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
3334         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3335         (toSystemClockTime):
3336         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
3337         * UIProcess/API/glib/WebKitWebContext.cpp:
3338         (webkit_web_context_clear_cache):
3339         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3340         (webkit_website_data_manager_clear):
3341         * UIProcess/DrawingAreaProxy.h:
3342         * UIProcess/Network/NetworkProcessProxy.cpp:
3343         (WebKit::NetworkProcessProxy::deleteWebsiteData):
3344         * UIProcess/Network/NetworkProcessProxy.h:
3345         * UIProcess/Plugins/PluginProcessManager.cpp:
3346         (WebKit::PluginProcessManager::deleteWebsiteData):
3347         * UIProcess/Plugins/PluginProcessManager.h:
3348         * UIProcess/Plugins/PluginProcessProxy.cpp:
3349         (WebKit::PluginProcessProxy::deleteWebsiteData):
3350         * UIProcess/Plugins/PluginProcessProxy.h:
3351         * UIProcess/Storage/StorageProcessProxy.cpp:
3352         (WebKit::StorageProcessProxy::deleteWebsiteData):
3353         * UIProcess/Storage/StorageProcessProxy.h:
3354         * UIProcess/WebCookieManagerProxy.cpp:
3355         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
3356         * UIProcess/WebCookieManagerProxy.h:
3357         * UIProcess/WebProcessProxy.cpp:
3358         (WebKit::WebProcessProxy::deleteWebsiteData):
3359         * UIProcess/WebProcessProxy.h:
3360         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3361         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3362         * UIProcess/WebResourceLoadStatisticsStore.h:
3363         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
3364         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
3365         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
3366         * UIProcess/WebStorage/StorageManager.cpp:
3367         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3368         * UIProcess/WebStorage/StorageManager.h:
3369         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3370         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
3371         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3372         (WebKit::WebsiteDataStore::removeData):
3373         (WebKit::WebsiteDataStore::removeMediaKeys):
3374         * UIProcess/WebsiteData/WebsiteDataStore.h:
3375         * UIProcess/gtk/WebPageProxyGtk.cpp:
3376         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
3377         * UIProcess/wpe/WebPageProxyWPE.cpp:
3378         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
3379         * WebProcess/Cookies/WebCookieManager.cpp:
3380         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3381         * WebProcess/Cookies/WebCookieManager.h:
3382         * WebProcess/Cookies/WebCookieManager.messages.in:
3383         * WebProcess/Plugins/PluginView.cpp:
3384         (WebKit::lastModifiedDateMS):
3385         * WebProcess/WebProcess.cpp:
3386         (WebKit::WebProcess::deleteWebsiteData):
3387         * WebProcess/WebProcess.h:
3388         * WebProcess/WebProcess.messages.in:
3389
3390 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3391
3392         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
3393         https://bugs.webkit.org/show_bug.cgi?id=181189
3394
3395         Reviewed by Tim Horton.
3396
3397         Add IPC support for PromisedBlobInfo and PromisedBlobData. See WebCore/ChangeLog for more detail.
3398
3399         * Shared/WebCoreArgumentCoders.cpp:
3400         (IPC::ArgumentCoder<PromisedBlobData>::encode):
3401         (IPC::ArgumentCoder<PromisedBlobData>::decode):
3402         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
3403         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
3404         * Shared/WebCoreArgumentCoders.h:
3405
3406 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
3407
3408         REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
3409         https://bugs.webkit.org/show_bug.cgi?id=181231
3410
3411         Reviewed by Alex Christensen.
3412
3413         Add new C API for use by WebKitTestRunner.
3414
3415         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3416         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
3417         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
3418         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3419
3420 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
3421
3422         Add a WebAuthentication runtime feature flag
3423         https://bugs.webkit.org/show_bug.cgi?id=181220
3424         <rdar://problem/36055305>
3425
3426         Reviewed by Brent Fulgham.
3427
3428         Renames the CredentialManagement runtime feature flag into WebAuthentication.
3429
3430         * Shared/WebPreferences.yaml:
3431         * UIProcess/API/C/WKPreferences.cpp:
3432         (WKPreferencesSetWebAuthenticationEnabled):
3433         (WKPreferencesGetWebAuthenticationEnabled):
3434         (WKPreferencesSetCredentialManagementEnabled): Deleted.
3435         (WKPreferencesGetCredentialManagementEnabled): Deleted.
3436         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3437         * WebProcess/WebPage/WebPage.cpp:
3438         (WebKit::WebPage::updatePreferences):
3439
3440 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
3441
3442         REGRESSION(r226327): [GTK] Plugin process is broken
3443         https://bugs.webkit.org/show_bug.cgi?id=181187
3444
3445         Unreviewed, fix PluginProcessMainUnix after r226327.
3446
3447         * PluginProcess/unix/PluginProcessMainUnix.cpp:
3448
3449 2018-01-02  Tim Horton  <timothy_horton@apple.com>
3450
3451         Fix the build on platforms where UICurrentUserInterfaceIdiomIsPad is defined to false
3452         https://bugs.webkit.org/show_bug.cgi?id=181218
3453
3454         Reviewed by Alex Christensen.
3455
3456         * Platform/spi/ios/UIKitSPI.h:
3457         (currentUserInterfaceIdiomIsPad):
3458         * UIProcess/ios/SmartMagnificationController.mm:
3459         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
3460         * UIProcess/ios/WKContentViewInteraction.mm:
3461         (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
3462         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
3463         (-[WKContentView _displayFormNodeInputView]):
3464         (-[WKContentView requiresAccessoryView]):
3465         (-[WKContentView _updateAccessory]):
3466         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3467         (-[WKAirPlayRoutePicker show:fromRect:]):
3468         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3469         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
3470         (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
3471         * UIProcess/ios/forms/WKFormInputControl.mm:
3472         (-[WKDateTimePicker initWithView:datePickerMode:]):
3473         (-[WKFormInputControl initWithView:]):
3474         * UIProcess/ios/forms/WKFormSelectControl.mm:
3475         (-[WKFormSelectControl initWithView:]):
3476         On platforms where UICurrentUserInterfaceIdiomIsPad is defined to false,
3477         blocks that conditionally execute based on its value are unreachable.
3478         This causes the compiler to complain. Hide it away inside an inline function
3479         and make use of that everywhere we used to use the macro.
3480
3481 2018-01-02  Alex Christensen  <achristensen@webkit.org>
3482