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