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