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