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