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