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