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