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