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