Process Swap on Navigation causes many webpages to hang due to attempted process...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-04-05  Brady Eidson  <beidson@apple.com>
2
3         Process Swap on Navigation causes many webpages to hang due to attempted process swap for iframe navigations.
4         <rdar://problem/39162236> and https://bugs.webkit.org/show_bug.cgi?id=184318
5
6         Reviewed by Andy Estes.
7
8         * UIProcess/WebPageProxy.cpp:
9         (WebKit::WebPageProxy::receivedPolicyDecision): Don't consider a swap if the navigation is not in the main frame.
10
11 2018-04-05  Ryosuke Niwa  <rniwa@webkit.org>
12
13         WebContent process sometimes hangs in WebProcess::ensureNetworkProcessConnection
14         https://bugs.webkit.org/show_bug.cgi?id=184326
15
16         Reviewed by Chris Dumez.
17
18         The hang was caused by UI process never sending the reply back to GetNetworkProcessConnection
19         due to m_pendingOutgoingMachMessage being set and the event handler for DISPATCH_MACH_SEND_POSSIBLE
20         never getting called. This is because the event handler registration happens asynchronously,
21         and may not have completed by the time we send the first IPC to the web content process
22         in which case it can timeout and we may never get the callback.
23
24         Fixed the hang by waiting for the event handler registration to be completed using
25         dispatch_source_set_registration_handler. To do this, this patch adds a new boolean instance variable,
26         m_isInitializingSendSource, to Connection which is set to true between the time mach port is created
27         and until the event handler registration has been completed. platformCanSendOutgoingMessages returns
28         false while m_isInitializingSendSource is set to prevent the attempt to send messages like we do when
29         m_pendingOutgoingMachMessage is set to true.
30
31         * Platform/IPC/Connection.h:
32         (IPC::Connection::m_isInitializingSendSource): Added.
33         * Platform/IPC/mac/ConnectionMac.mm:
34         (IPC::Connection::platformInvalidate): Set m_isInitializingSendSource to false.
35         (IPC::Connection::sendMessage): Assert that m_isInitializingSendSource is false.
36         (IPC::Connection::platformCanSendOutgoingMessages const): Return false if m_isInitializingSendSource
37         is set to true.
38         (IPC::Connection::sendOutgoingMessage): Assert that m_isInitializingSendSource is false.
39         (IPC::Connection::initializeSendSource): Set m_isInitializingSendSource to true temporarily until
40         dispatch_source_set_registration_handler's callback is called. Resume and send any pending outgoing
41         messages.
42         (IPC::Connection::resumeSendSource): Extracted from initializeSendSource.
43
44 2018-04-05  Youenn Fablet  <youenn@apple.com>
45
46         WebRTC data channel only applications require capture permissions for direct connections
47         https://bugs.webkit.org/show_bug.cgi?id=174500
48         <rdar://problem/34134281>
49
50         Unreviewed.
51         Changed the code to suppress: "error: unused variable 'error' [-Werror,-Wunused-variable]"
52         Added some logging to this error case as a side bonus.
53
54         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
55         (WebKit::NetworkMDNSRegister::registerMDNSName):
56
57 2018-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
58
59         REGRESSION(r229831): Test WebKit2.ProvisionalURLAfterWillSendRequestCallback times out since r229831
60         https://bugs.webkit.org/show_bug.cgi?id=184293
61
62         Reviewed by Alex Christensen.
63
64         The problem is that after willSendRequest callback changes the request, the load is cancelled while
65         transitioning to committed state. This happens because the load is not waiting for the response policy check, so
66         it continues and when transitioning to committed, FrameLoader::closeURL() invalidates the current policy check
67         that causes a load failure. The new request returned by the API doesn't have any requester, so it's no longer
68         considered a main resource load. In the network process the resource load task doesn't wait for the response
69         policy and continues the load, sending the data to the web process. Once the first data is received, the load
70         transitions to commit, but the response policy check is still ongoing. This can only happen when using the C API
71         (I don't know about the Cocoa API), but not with the GLib API because it doesn't allow to create a new request,
72         only to modify the passed in one. With the C API we loss other internal things of the request like the priority,
73         but I guess the most important one is the requester.
74
75         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
76         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
77
78 2018-04-04  Ryan Haddad  <ryanhaddad@apple.com>
79
80         Unreviewed, rolling out r230283.
81
82         Caused webkitpy test failures.
83
84         Reverted changeset:
85
86         "Use CompletionHandlers for DelayedReplies"
87         https://bugs.webkit.org/show_bug.cgi?id=182269
88         https://trac.webkit.org/changeset/230283
89
90 2018-04-04  Youenn Fablet  <youenn@apple.com>
91
92         webrtc/video-update-often.html is flakily crashing on iOS simulator Debug
93         https://bugs.webkit.org/show_bug.cgi?id=184022
94
95         Reviewed by Jer Noble.
96
97         Remove client context once the new context identifier is set.
98         Covered by test no longer crashing locally.
99
100         * WebProcess/cocoa/PlaybackSessionManager.mm:
101         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
102
103 2018-04-04  Youenn Fablet  <youenn@apple.com>
104
105         WebRTC data channel only applications require capture permissions for direct connections
106         https://bugs.webkit.org/show_bug.cgi?id=174500
107         <rdar://problem/34134281>
108
109         Reviewed by Eric Carlson.
110
111         Add support for MDNS registration and resolution by NetworkProcess.
112         WebProcess gives instruction to do the actual registrations/resolutions.
113
114         * CMakeLists.txt:
115         * DerivedSources.make:
116         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
117         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
118         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
119         * NetworkProcess/NetworkConnectionToWebProcess.h:
120         (WebKit::NetworkConnectionToWebProcess::mdnsRegister):
121         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Added.
122         (WebKit::NetworkMDNSRegister::NetworkMDNSRegister):
123         (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
124         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
125         (WebKit::PendingRegistrationRequest::PendingRegistrationRequest):
126         (WebKit::registerMDNSNameCallback):
127         (WebKit::NetworkMDNSRegister::registerMDNSName):
128         (WebKit::PendingResolutionRequest::PendingResolutionRequest):
129         (WebKit::PendingResolutionRequest::~PendingResolutionRequest):
130         (WebKit::PendingResolutionRequest::timeout):
131         (WebKit::resolveMDNSNameCallback):
132         (WebKit::NetworkMDNSRegister::resolveMDNSName):
133         * NetworkProcess/webrtc/NetworkMDNSRegister.h: Added.
134         * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: Added.
135         * Shared/WebPreferences.yaml:
136         * UIProcess/API/C/WKPreferences.cpp:
137         (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
138         (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
139         * UIProcess/API/C/WKPreferencesRef.h:
140         * WebKit.xcodeproj/project.pbxproj:
141         * WebProcess/InjectedBundle/InjectedBundle.cpp:
142         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
143         * WebProcess/Network/NetworkProcessConnection.cpp:
144         (WebKit::NetworkProcessConnection::didReceiveMessage):
145         * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
146         (WebKit::LibWebRTCNetwork::mdnsRegister):
147         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
148         (WebKit::LibWebRTCProvider::unregisterMDNSNames):
149         (WebKit::LibWebRTCProvider::registerMDNSName):
150         (WebKit::LibWebRTCProvider::resolveMDNSName):
151         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
152         * WebProcess/Network/webrtc/WebMDNSRegister.cpp: Added.
153         (WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
154         (WebKit::WebMDNSRegister::finishedResolvingMDNSName):
155         (WebKit::WebMDNSRegister::unregisterMDNSNames):
156         (WebKit::WebMDNSRegister::registerMDNSName):
157         (WebKit::WebMDNSRegister::resolveMDNSName):
158         * WebProcess/Network/webrtc/WebMDNSRegister.h: Added.
159         * WebProcess/Network/webrtc/WebMDNSRegister.messages.in: Added.
160
161 2018-04-04  Alex Christensen  <achristensen@webkit.org>
162
163         Use CompletionHandlers for DelayedReplies
164         https://bugs.webkit.org/show_bug.cgi?id=182269
165
166         Reviewed by Youenn Fablet.
167
168         DelayedReplies should be a noncopyable, non-refcountable type.  They should be
169         called once and only once.  This is what CompletionHandlers are for.
170
171         No change in behavior.  Just cleaner code.
172
173         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
174         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
175         * NetworkProcess/NetworkConnectionToWebProcess.h:
176         * NetworkProcess/NetworkResourceLoader.cpp:
177         (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
178         (WebKit::sendReplyToSynchronousRequest):
179         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
180         * NetworkProcess/NetworkResourceLoader.h:
181         * Platform/IPC/Connection.h:
182         * Platform/IPC/HandleMessage.h:
183         (IPC::callMemberFunctionImpl):
184         (IPC::callMemberFunction):
185         (IPC::handleMessageDelayed):
186         * PluginProcess/PluginControllerProxy.cpp:
187         (WebKit::PluginControllerProxy::setInitializationReply):
188         (WebKit::PluginControllerProxy::takeInitializationReply):
189         * PluginProcess/PluginControllerProxy.h:
190         * PluginProcess/WebProcessConnection.cpp:
191         (WebKit::WebProcessConnection::destroyPlugin):
192         (WebKit::WebProcessConnection::createPlugin):
193         (WebKit::WebProcessConnection::createPluginAsynchronously):
194         * PluginProcess/WebProcessConnection.h:
195         * Scripts/webkit/messages.py:
196         (message_to_struct_declaration):
197         (generate_message_handler):
198         * UIProcess/Network/NetworkProcessProxy.cpp:
199         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
200         (WebKit::NetworkProcessProxy::networkProcessCrashed):
201         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
202         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
203         * UIProcess/Network/NetworkProcessProxy.h:
204         * UIProcess/Plugins/PluginProcessManager.cpp:
205         (WebKit::PluginProcessManager::getPluginProcessConnection):
206         * UIProcess/Plugins/PluginProcessManager.h:
207         * UIProcess/Plugins/PluginProcessProxy.cpp:
208         (WebKit::PluginProcessProxy::getPluginProcessConnection):
209         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
210         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
211         * UIProcess/Plugins/PluginProcessProxy.h:
212         * UIProcess/Storage/StorageProcessProxy.cpp:
213         (WebKit::StorageProcessProxy::getStorageProcessConnection):
214         (WebKit::StorageProcessProxy::didClose):
215         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
216         * UIProcess/Storage/StorageProcessProxy.h:
217         * UIProcess/WebPageProxy.cpp:
218         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
219         (WebKit::WebPageProxy::createNewPage):
220         (WebKit::WebPageProxy::runJavaScriptAlert):
221         (WebKit::WebPageProxy::runJavaScriptConfirm):
222         (WebKit::WebPageProxy::runJavaScriptPrompt):
223         (WebKit::WebPageProxy::webGLPolicyForURL):
224         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
225         (WebKit::WebPageProxy::getToolbarsAreVisible):
226         (WebKit::WebPageProxy::getMenuBarIsVisible):
227         (WebKit::WebPageProxy::getStatusBarIsVisible):
228         (WebKit::WebPageProxy::getWindowFrame):
229         (WebKit::WebPageProxy::screenToRootView):
230         (WebKit::WebPageProxy::rootViewToScreen):
231         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
232         (WebKit::WebPageProxy::exceededDatabaseQuota):
233         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
234         * UIProcess/WebPageProxy.h:
235         * UIProcess/WebProcessPool.cpp:
236         (WebKit::WebProcessPool::networkProcessCrashed):
237         (WebKit::WebProcessPool::getNetworkProcessConnection):
238         (WebKit::WebProcessPool::getStorageProcessConnection):
239         * UIProcess/WebProcessPool.h:
240         * UIProcess/WebProcessProxy.cpp:
241         (WebKit::WebProcessProxy::getPluginProcessConnection):
242         (WebKit::WebProcessProxy::getNetworkProcessConnection):
243         (WebKit::WebProcessProxy::getStorageProcessConnection):
244         * UIProcess/WebProcessProxy.h:
245         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
246         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
247         * WebProcess/Storage/WebSWContextManagerConnection.h:
248         * WebProcess/WebPage/WebPage.h:
249         * WebProcess/WebPage/ios/WebPageIOS.mm:
250         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
251
252 2018-04-04  Alex Christensen  <achristensen@webkit.org>
253
254         Remove legacyCustomProtocolManager from NetworkSessionCreationParameters
255         https://bugs.webkit.org/show_bug.cgi?id=182178
256
257         Reviewed by Youenn Fablet.
258
259         Now that we only make NetworkSessions in the NetworkProcess, we don't need to pass this parameter around.
260
261         * NetworkProcess/NetworkProcess.cpp:
262         (WebKit::NetworkProcess::initializeNetworkProcess):
263         * NetworkProcess/NetworkSessionCreationParameters.h:
264         (WebKit::NetworkSessionCreationParameters::decode):
265         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
266         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
267         * NetworkProcess/mac/RemoteNetworkingContext.mm:
268         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
269         * Shared/WebsiteDataStoreParameters.cpp:
270         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
271         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
272         (WebKit::WebsiteDataStore::parameters):
273
274 2018-04-04  Alex Christensen  <achristensen@webkit.org>
275
276         Move PingHandle to WebKitLegacy
277         https://bugs.webkit.org/show_bug.cgi?id=184145
278
279         Reviewed by Youenn Fablet.
280
281         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
282
283 2018-04-04  Brent Fulgham  <bfulgham@apple.com>
284
285         Failures from mach port reference handling should be fatal
286         https://bugs.webkit.org/show_bug.cgi?id=184202
287         <rdar://problem/37771114>
288
289         Reviewed by Anders Carlsson.
290
291         Update for new location of MachSendRight.h. Switch to
292         #pragma once in a few places.
293
294         * Platform/IPC/mac/ConnectionMac.mm:
295         (IPC::Connection::platformInvalidate): Adopt new 'safe mach_port_t deallocation' function.
296         (IPC::Connection::initializeSendSource): Ditto.
297         (IPC::Connection::receiveSourceEventHandler): Ditto.
298         * Platform/SharedMemory.h:
299         * Platform/cocoa/SharedMemoryCocoa.cpp:
300         (WebKit::SharedMemory::Handle::clear): Ditto.
301         (WebKit::makeMemoryEntry): Ditto.
302         (WebKit::SharedMemory::createSendRight const): Ditto.
303         * Platform/mac/LayerHostingContext.h:
304         * Platform/mac/LayerHostingContext.mm:
305         * PluginProcess/PluginControllerProxy.h:
306         * PluginProcess/PluginProcess.h:
307         (WebKit::PluginProcess::compositingRenderServerPort const):
308         * Scripts/messages.py:
309         (headers_for_type): Update for new location of MachSendRight.
310         * Shared/Plugins/PluginProcessCreationParameters.h:
311         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
312         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
313         (WebKit::RemoteLayerBackingStore::encode const):
314         * Shared/WebCoreArgumentCoders.h:
315         * Shared/WebProcessCreationParameters.h:
316         * Shared/mac/WebCoreArgumentCodersMac.mm:
317         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
318         * UIProcess/DrawingAreaProxy.cpp:
319         * UIProcess/DrawingAreaProxy.h:
320         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
321         (WebKit::ProcessLauncher::launchProcess): Ditto. Remove uneeded mach_port_dealloc called after
322         xpc_dictionary_set_mach_send. While '..._set_mach_send' retains the send right, it gets automatically
323         released when the message is handled. We only want to manually deallocate the send right if
324         the message failed to send.
325         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
326         * UIProcess/WebPageProxy.cpp:
327         * UIProcess/WebPageProxy.h:
328         * UIProcess/WebPageProxy.messages.in:
329         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
330         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
331         * UIProcess/mac/WKViewLayoutStrategy.mm:
332         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
333         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
334         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
335         * WebProcess/Plugins/PluginController.h:
336         * WebProcess/Plugins/PluginView.h:
337         * WebProcess/WebPage/DrawingArea.h:
338         (WebKit::DrawingArea::addFence):
339         (WebKit::DrawingArea::updateGeometry):
340         * WebProcess/WebPage/DrawingArea.messages.in:
341         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
342         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
343         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
344         * WebProcess/WebPage/WebPage.cpp:
345         (WebKit::WebPage::setTopContentInsetFenced):
346         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
347         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
348         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
349         * WebProcess/WebProcess.h:
350         (WebKit::WebProcess::compositingRenderServerPort const):
351         * WebProcess/cocoa/VideoFullscreenManager.mm:
352         (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
353
354 2018-04-04  Beth Dakin  <bdakin@apple.com>
355
356         Fix the print formatter build
357         https://bugs.webkit.org/show_bug.cgi?id=184289
358         -and corresponding-
359         rdar://problem/39164641
360
361         Reviewed by Dan Bernstein.
362
363         * UIProcess/API/Cocoa/WKWebView.mm:
364         (-[WKWebView _webViewPrintFormatter]):
365         * UIProcess/API/Cocoa/WKWebViewInternal.h:
366         * UIProcess/_WKWebViewPrintFormatter.h:
367         * UIProcess/_WKWebViewPrintFormatter.mm:
368         * UIProcess/_WKWebViewPrintFormatterInternal.h:
369         * UIProcess/ios/WKContentView.mm:
370         * UIProcess/ios/WKPDFView.mm:
371
372 2018-04-04  Andy Estes  <aestes@apple.com>
373
374         [iOS] Rename WKPDFView to WKLegacyPDFView
375         https://bugs.webkit.org/show_bug.cgi?id=184286
376
377         Rubber-stamped by Wenson Hsieh.
378
379         A series of upcoming patches will implement a new WKPDFView based on PDFKit.
380
381         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
382         (-[WKWebViewContentProviderRegistry init]):
383         * UIProcess/ios/WKLegacyPDFView.h: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.h.
384         * UIProcess/ios/WKLegacyPDFView.mm: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.mm.
385         (-[WKLegacyPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
386         * WebKit.xcodeproj/project.pbxproj:
387
388 2018-04-04  Yousuke Kimoto  <yousuke.kimoto@sony.com> and Fujii Hironori  <Hironori.Fujii@sony.com>
389
390         [WinCairo] Add WebKit Shared/win files for wincairo webkit
391         https://bugs.webkit.org/show_bug.cgi?id=183044
392
393         Reviewed by Alex Christensen.
394
395         * Shared/win/ChildProcessMainWin.cpp: Added.
396
397 2018-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
398
399         [Extra zoom mode] Remove effective font size constraints when determining focus zoom scale
400         https://bugs.webkit.org/show_bug.cgi?id=184287
401         <rdar://problem/39063886>
402
403         Reviewed by Timothy Hatcher.
404
405         As it turns out, form controls on some important websites can be very wide, with a small font size, which
406         renders the approach taken in <https://trac.webkit.org/r230171> moot, since we'll just end up zooming to a scale
407         that is too large anyways. To mitigate this for now, remove the minimum font scaling threshold while we think of
408         more clever ways to account for this scenario.
409
410         * UIProcess/API/Cocoa/WKWebView.mm:
411         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
412
413 2018-04-04  Fujii Hironori  <Hironori.Fujii@sony.com>
414
415         [Win] WebFrameLoaderClient: 'getpid': identifier not found
416         https://bugs.webkit.org/show_bug.cgi?id=184291
417
418         Reviewed by Konstantin Tokarev.
419
420         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
421         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
422         Use WTF::getCurrentProcessID() instead of getpid().
423         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
424
425 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
426
427         ASSERTION FAILED: !m_mainFrame->coreFrame()->loader().frameHasLoaded() || !m_pendingNavigationID when reloading page while a page is loading
428         https://bugs.webkit.org/show_bug.cgi?id=153210
429
430         Reviewed by Alex Christensen.
431
432         The assert happens when WebPage::reload() is called twice and the first time the reload is ignored by
433         FrameLoader because the document URL is empty. In that case the pending navigation is not reset, because
434         FrameLoader::reload() returns before creating the document loader.
435
436         * WebProcess/WebPage/WebPage.cpp:
437         (WebKit::WebPage::reload): Check if the pending navigation has been reset after calling FrameLoader::reload()
438         and reset it otherwise.
439
440 2018-04-03  Youenn Fablet  <youenn@apple.com>
441
442         Make NetworkProcess get ContentBlocker information from UIProcess
443         https://bugs.webkit.org/show_bug.cgi?id=184205
444         <rdar://problem/39146551>
445
446         Unreviewed.
447         Updated decode/encode methods to not hit null identifier assertion.
448
449         * Shared/WebPageCreationParameters.cpp:
450         (WebKit::WebPageCreationParameters::encode const):
451         (WebKit::WebPageCreationParameters::decode):
452         * Shared/WebPageGroupData.cpp:
453         (WebKit::WebPageGroupData::encode const):
454         (WebKit::WebPageGroupData::decode):
455
456 2018-04-03  Andy Estes  <aestes@apple.com>
457
458         [iOS] WKWebView shouldn't know about WKPDFView
459         https://bugs.webkit.org/show_bug.cgi?id=184283
460
461         Reviewed by Timothy Hatcher.
462
463         WKWebView shouldn't be checking if _customContentView is a particular kind of
464         class (e.g., WKPDFView). Instead, it should interact with the _customContentView
465         using the WKWebViewContentProvider protocol.
466
467         Reimplement -_isBackground, -_isDisplayingPDF, -_dataForDisplayedPDF, and
468         -_suggestedFilenameForDisplayedPDF using new WKWebViewContentProvider protocol
469         methods that WKPDFView implements.
470
471         * UIProcess/API/Cocoa/WKWebView.mm:
472         (-[WKWebView _isBackground]):
473         (-[WKWebView _isDisplayingPDF]):
474         (-[WKWebView _dataForDisplayedPDF]):
475         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
476         * UIProcess/Cocoa/WKWebViewContentProvider.h:
477         * UIProcess/ios/WKPDFView.h:
478         * UIProcess/ios/WKPDFView.mm:
479         (-[WKPDFView web_dataRepresentation]):
480         (-[WKPDFView web_suggestedFilename]):
481         (-[WKPDFView web_isBackground]):
482         (-[WKPDFView suggestedFilename]): Deleted.
483         (-[WKPDFView pdfDocument]): Deleted.
484         (-[WKPDFView isBackground]): Deleted.
485
486 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
487
488         Guard against keychain/certificate access outside the network process
489         https://bugs.webkit.org/show_bug.cgi?id=184214
490         <rdar://problem/38734795>
491
492         Reviewed by Youenn Fablet.
493
494         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
495         a non-Networking process.
496
497         * Shared/cf/ArgumentCodersCF.cpp:
498         (IPC::encode): Assert if we access the keychain from a proces other than the Network or UI process.
499         (IPC::decode): Ditto.
500
501 2018-04-03  Youenn Fablet  <youenn@apple.com>
502
503         NetworkResourceLoader does not need to expose all redirect response headers
504         https://bugs.webkit.org/show_bug.cgi?id=184114
505         <rdar://problem/39010557>
506
507         Reviewed by Ryosuke Niwa.
508
509         WebProcess instructs NetworkProcess whether to sanitize response headers based on a runtime flag.
510         We sanitize redirection response headers in case this is not related to a navigation load.
511         Navigation loads may currently require the full response for content blockers.
512
513         * NetworkProcess/NetworkResourceLoadParameters.cpp:
514         (WebKit::NetworkResourceLoadParameters::encode const):
515         (WebKit::NetworkResourceLoadParameters::decode):
516         * NetworkProcess/NetworkResourceLoadParameters.h:
517         * NetworkProcess/NetworkResourceLoader.cpp:
518         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
519         (WebKit::NetworkResourceLoader::sanitizeRedirectResponseIfPossible):
520         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
521         * NetworkProcess/NetworkResourceLoader.h:
522         * Shared/WebPreferences.yaml:
523         * UIProcess/API/C/WKPreferences.cpp:
524         (WKPreferencesSetRestrictedHTTPResponseAccess):
525         (WKPreferencesGetRestrictedHTTPResponseAccess):
526         * UIProcess/API/C/WKPreferencesRef.h:
527         * WebProcess/Network/WebLoaderStrategy.cpp:
528         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
529         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
530         (WebKit::WebLoaderStrategy::startPingLoad):
531         (WebKit::WebLoaderStrategy::preconnectTo):
532
533 2018-04-03  Youenn Fablet  <youenn@apple.com>
534
535         Make NetworkProcess get ContentBlocker information from UIProcess
536         https://bugs.webkit.org/show_bug.cgi?id=184205
537
538         Reviewed by Alex Christensen.
539
540         Make NetworkProcess get content blockers from UIProcess directly.
541         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
542         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
543
544         This is both more efficient than passing them for each PingLoad and safer in the sense
545         that a compromised WebProcess will not be able to bypass any of these.
546         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
547
548         Covered by existing beacon+content blocker tests.
549
550         Did some refactoring to add a typed content blocker identifier.
551         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
552         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
553
554         * CMakeLists.txt:
555         * DerivedSources.make:
556         * NetworkProcess/NetworkLoadChecker.cpp:
557         (WebKit::NetworkLoadChecker::checkRequest):
558         (WebKit::NetworkLoadChecker::continueCheckingRequest):
559         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
560         * NetworkProcess/NetworkLoadChecker.h:
561         (WebKit::NetworkLoadChecker::setContentExtensionController):
562         * NetworkProcess/NetworkProcess.cpp:
563         (WebKit::NetworkProcess::didReceiveMessage):
564         * NetworkProcess/NetworkProcess.h:
565         (WebKit::NetworkProcess::networkUserContentController):
566         * NetworkProcess/NetworkResourceLoadParameters.cpp:
567         (WebKit::NetworkResourceLoadParameters::encode const):
568         (WebKit::NetworkResourceLoadParameters::decode):
569         * NetworkProcess/NetworkResourceLoadParameters.h:
570         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
571         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
572         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
573         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
574         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
575         (WebKit::NetworkContentRuleListManager::remove):
576         * NetworkProcess/NetworkContentRuleListManager.h: Added.
577         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
578         * NetworkProcess/PingLoad.cpp:
579         * Scripts/webkit/messages.py:
580         * Shared/UserContentControllerIdentifier.h: Added.
581         * Shared/WebPageCreationParameters.cpp:
582         (WebKit::WebPageCreationParameters::decode):
583         * Shared/WebPageCreationParameters.h:
584         * Shared/WebPageGroupData.cpp:
585         (WebKit::WebPageGroupData::decode):
586         * Shared/WebPageGroupData.h:
587         * UIProcess/Network/NetworkProcessProxy.cpp:
588         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
589         (WebKit::NetworkProcessProxy::contentExtensionRules):
590         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
591         * UIProcess/Network/NetworkProcessProxy.h:
592         * UIProcess/Network/NetworkProcessProxy.messages.in:
593         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
594         (WebKit::WebUserContentControllerProxy::get):
595         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
596         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
597         (WebKit::WebUserContentControllerProxy::addProcess):
598         (WebKit::WebUserContentControllerProxy::removeProcess):
599         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
600         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
601         (WebKit::WebUserContentControllerProxy::addUserScript):
602         (WebKit::WebUserContentControllerProxy::removeUserScript):
603         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
604         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
605         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
606         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
607         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
608         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
609         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
610         (WebKit::WebUserContentControllerProxy::addContentRuleList):
611         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
612         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
613         * UIProcess/UserContent/WebUserContentControllerProxy.h:
614         (WebKit::WebUserContentControllerProxy::create):
615         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
616         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
617         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
618         (WebKit::WebUserContentControllerProxy::identifier const):
619         * WebKit.xcodeproj/project.pbxproj:
620         * WebProcess/Network/WebLoaderStrategy.cpp:
621         (WebKit::WebLoaderStrategy::startPingLoad):
622         * WebProcess/UserContent/WebUserContentController.cpp:
623         (WebKit::WebUserContentController::getOrCreate):
624         (WebKit::WebUserContentController::WebUserContentController):
625         (WebKit::WebUserContentController::~WebUserContentController):
626         * WebProcess/UserContent/WebUserContentController.h:
627         * WebProcess/WebPage/WebPage.h:
628         (WebKit::WebPage::userContentControllerIdentifier const):
629
630 2018-04-03  Andy Estes  <aestes@apple.com>
631
632         [Mac] Prioritize file promises over filenames during drag and drop
633         https://bugs.webkit.org/show_bug.cgi?id=184237
634         <rdar://problem/38278076>
635
636         Reviewed by Wenson Hsieh.
637
638         * UIProcess/Cocoa/WebViewImpl.mm:
639         (WebKit::WebViewImpl::performDragOperation):
640
641 2018-04-03  Brady Eidson  <beidson@apple.com>
642
643         Make SessionStorage work with process swapping.
644         https://bugs.webkit.org/show_bug.cgi?id=184270
645
646         Reviewed by Andy Estes.
647
648         Due to a minor process accounting error, WebPageProxys weren't always being reconnected with their
649         WebsiteDataStore's StorageManager when doing process swaps.
650
651         Fix that error, and SessionStorage "just works."
652
653         * UIProcess/WebPageProxy.cpp:
654         (WebKit::WebPageProxy::webProcessWillShutDown):
655         (WebKit::WebPageProxy::processDidTerminate): For NavigationSwap termination, make sure to tell the 
656           process lifetime tracker that this page was removed.
657
658         * UIProcess/WebProcessLifetimeObserver.h:
659         (WebKit::WebProcessLifetimeObserver::webPageWasInvalidated): Renamed from "webPageWasRemoved"
660         (WebKit::WebProcessLifetimeObserver::webPageWasRemoved): Deleted.
661
662         * UIProcess/WebProcessLifetimeTracker.cpp:
663         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess): Renamed from "webProcessWillShutDown"
664         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
665         (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown): Deleted.
666         * UIProcess/WebProcessLifetimeTracker.h:
667
668         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
669         (WebKit::WebsiteDataStore::webPageWasInvalidated):
670         (WebKit::WebsiteDataStore::webPageWasRemoved): Deleted.
671         * UIProcess/WebsiteData/WebsiteDataStore.h:
672
673 2018-04-03  Commit Queue  <commit-queue@webkit.org>
674
675         Unreviewed, rolling out r230210.
676         https://bugs.webkit.org/show_bug.cgi?id=184277
677
678         it is breaking internal bots (Requested by youenn on #webkit).
679
680         Reverted changeset:
681
682         "Make NetworkProcess get ContentBlocker information from
683         UIProcess"
684         https://bugs.webkit.org/show_bug.cgi?id=184205
685         https://trac.webkit.org/changeset/230210
686
687 2018-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
688
689         [Extra zoom mode] Update time picker to use platform view controller
690         https://bugs.webkit.org/show_bug.cgi?id=184252
691         <rdar://problem/38804795>
692
693         Reviewed by Andy Estes.
694
695         Adjust for some small WKTimePickerViewController changes, and remove some files that we no longer need.
696
697         * UIProcess/ios/WKContentViewInteraction.mm:
698         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
699         (-[WKContentView textInputController:didCommitText:]): Deleted.
700         (-[WKContentView textInputController:didCommitText:withSuggestion:]): Deleted.
701         (-[WKContentView textInputControllerDidRequestDismissal:]): Deleted.
702         * UIProcess/ios/forms/WKTextFormControlViewController.h: Removed.
703         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Removed.
704         * UIProcess/ios/forms/WKTextSuggestionButton.h: Removed.
705         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Removed.
706         * WebKit.xcodeproj/project.pbxproj:
707
708 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
709
710         Xcode prepends line comments from WTF/Compiler.h to *.sb files
711         https://bugs.webkit.org/show_bug.cgi?id=184166
712
713         Reviewed by Brent Fulgham.
714
715         * DerivedSources.make:
716         Strip ;-comments from *.sb.in files before preprocessing so we can stop treating Platform.h/Compiler.h as C89.
717
718 2018-04-03  Chris Dumez  <cdumez@apple.com>
719
720         Drop MainFrame class
721         https://bugs.webkit.org/show_bug.cgi?id=184191
722
723         Reviewed by Darin Adler.
724
725         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
726         relationship between the Page and the MainFrame.
727
728         This is ground work for introducing LocalFrame / RemoteFrame concepts.
729
730         * Shared/WebRenderLayer.cpp:
731         * Shared/WebRenderObject.cpp:
732         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
733         (WebKit::WebPaymentCoordinator::paymentCoordinator):
734         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
735         * WebProcess/FullScreen/WebFullScreenManager.cpp:
736         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
737         (WKBundlePageInstallPageOverlay):
738         (WKBundlePageUninstallPageOverlay):
739         (WKBundlePageInstallPageOverlayWithAnimation):
740         (WKBundlePageUninstallPageOverlayWithAnimation):
741         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
742         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
743         * WebProcess/InjectedBundle/InjectedBundle.cpp:
744         * WebProcess/Plugins/PDF/PDFPlugin.mm:
745         * WebProcess/Plugins/PluginView.cpp:
746         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
747         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
748         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
749         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
750         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
751         (WebKit::WebInspectorClient::~WebInspectorClient):
752         (WebKit::WebInspectorClient::highlight):
753         (WebKit::WebInspectorClient::hideHighlight):
754         (WebKit::WebInspectorClient::showPaintRect):
755         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
756         * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
757         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
758         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
759         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
760         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
761         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
762         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
763         * WebProcess/WebPage/FindController.cpp:
764         (WebKit::FindController::updateFindUIAfterPageScroll):
765         (WebKit::FindController::hideFindUI):
766         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
767         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
768         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
769         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
770         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
771         * WebProcess/WebPage/WebFrame.cpp:
772         * WebProcess/WebPage/WebInspector.cpp:
773         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
774         * WebProcess/WebPage/WebPage.cpp:
775         (WebKit::WebPage::mainFrame const):
776         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
777         (WebKit::WebPage::plugInIntersectsSearchRect):
778         * WebProcess/WebPage/WebPage.h:
779         * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
780         * WebProcess/WebPage/ios/FindControllerIOS.mm:
781         * WebProcess/WebPage/ios/WebPageIOS.mm:
782         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
783         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
784         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
785         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
786         (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
787         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
788         * WebProcess/WebPage/mac/WebPageMac.mm:
789         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
790         (WebKit::WebPage::dataDetectorsDidPresentUI):
791         (WebKit::WebPage::dataDetectorsDidChangeUI):
792         (WebKit::WebPage::dataDetectorsDidHideUI):
793         * WebProcess/WebProcess.cpp:
794         * WebProcess/WebStorage/StorageAreaMap.cpp:
795
796 2018-04-03  Youenn Fablet  <youenn@apple.com>
797
798         Make NetworkProcess get ContentBlocker information from UIProcess
799         https://bugs.webkit.org/show_bug.cgi?id=184205
800
801         Reviewed by Alex Christensen.
802
803         Make NetworkProcess get content blockers from UIProcess directly.
804         Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
805         Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.
806
807         This is both more efficient than passing them for each PingLoad and safer in the sense
808         that a compromised WebProcess will not be able to bypass any of these.
809         In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.
810
811         Covered by existing beacon+content blocker tests.
812
813         Did some refactoring to add a typed content blocker identifier.
814         Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
815         Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.
816
817         * CMakeLists.txt:
818         * DerivedSources.make:
819         * NetworkProcess/NetworkLoadChecker.cpp:
820         (WebKit::NetworkLoadChecker::checkRequest):
821         (WebKit::NetworkLoadChecker::continueCheckingRequest):
822         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
823         * NetworkProcess/NetworkLoadChecker.h:
824         (WebKit::NetworkLoadChecker::setContentExtensionController):
825         * NetworkProcess/NetworkProcess.cpp:
826         (WebKit::NetworkProcess::didReceiveMessage):
827         * NetworkProcess/NetworkProcess.h:
828         (WebKit::NetworkProcess::networkUserContentController):
829         * NetworkProcess/NetworkResourceLoadParameters.cpp:
830         (WebKit::NetworkResourceLoadParameters::encode const):
831         (WebKit::NetworkResourceLoadParameters::decode):
832         * NetworkProcess/NetworkResourceLoadParameters.h:
833         * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
834         (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
835         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
836         (WebKit::NetworkContentRuleListManager::removeContentRuleList):
837         (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
838         (WebKit::NetworkContentRuleListManager::remove):
839         * NetworkProcess/NetworkContentRuleListManager.h: Added.
840         * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
841         * NetworkProcess/PingLoad.cpp:
842         * Scripts/webkit/messages.py:
843         * Shared/UserContentControllerIdentifier.h: Added.
844         * Shared/WebPageCreationParameters.cpp:
845         (WebKit::WebPageCreationParameters::decode):
846         * Shared/WebPageCreationParameters.h:
847         * Shared/WebPageGroupData.cpp:
848         (WebKit::WebPageGroupData::decode):
849         * Shared/WebPageGroupData.h:
850         * UIProcess/Network/NetworkProcessProxy.cpp:
851         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
852         (WebKit::NetworkProcessProxy::contentExtensionRules):
853         (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
854         * UIProcess/Network/NetworkProcessProxy.h:
855         * UIProcess/Network/NetworkProcessProxy.messages.in:
856         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
857         (WebKit::WebUserContentControllerProxy::get):
858         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
859         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
860         (WebKit::WebUserContentControllerProxy::addProcess):
861         (WebKit::WebUserContentControllerProxy::removeProcess):
862         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
863         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
864         (WebKit::WebUserContentControllerProxy::addUserScript):
865         (WebKit::WebUserContentControllerProxy::removeUserScript):
866         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
867         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
868         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
869         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
870         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
871         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
872         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
873         (WebKit::WebUserContentControllerProxy::addContentRuleList):
874         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
875         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
876         * UIProcess/UserContent/WebUserContentControllerProxy.h:
877         (WebKit::WebUserContentControllerProxy::create):
878         (WebKit::WebUserContentControllerProxy::addNetworkProcess):
879         (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
880         (WebKit::WebUserContentControllerProxy::contentExtensionRules):
881         (WebKit::WebUserContentControllerProxy::identifier const):
882         * WebKit.xcodeproj/project.pbxproj:
883         * WebProcess/Network/WebLoaderStrategy.cpp:
884         (WebKit::WebLoaderStrategy::startPingLoad):
885         * WebProcess/UserContent/WebUserContentController.cpp:
886         (WebKit::WebUserContentController::getOrCreate):
887         (WebKit::WebUserContentController::WebUserContentController):
888         (WebKit::WebUserContentController::~WebUserContentController):
889         * WebProcess/UserContent/WebUserContentController.h:
890         * WebProcess/WebPage/WebPage.h:
891         (WebKit::WebPage::userContentControllerIdentifier const):
892
893 2018-04-02  Beth Dakin  <bdakin@apple.com>
894
895         Fix the managed configurations build
896         https://bugs.webkit.org/show_bug.cgi?id=184253
897         -and corresponding-
898         rdar://problem/39078586
899
900         Reviewed by Dan Bernstein.
901
902         * UIProcess/ios/WKContentViewInteraction.mm:
903         (-[WKContentView canPerformActionForWebView:withSender:]):
904         (-[WKContentView _defineForWebView:]):
905
906 2018-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>
907
908         [Enchant] Clean up TextCheckerEnchant
909         https://bugs.webkit.org/show_bug.cgi?id=184233
910
911         Reviewed by Michael Catanzaro.
912
913         Use TextCheckerEnchant as a singleton now, instead of implementing the singleton here.
914
915         * UIProcess/gtk/TextCheckerGtk.cpp:
916         (WebKit::TextChecker::checkSpellingOfString):
917         (WebKit::TextChecker::getGuessesForWord):
918         (WebKit::TextChecker::learnWord):
919         (WebKit::TextChecker::ignoreWord):
920         (WebKit::TextChecker::setSpellCheckingLanguages):
921         (WebKit::TextChecker::loadedSpellCheckingLanguages):
922         (WebKit::enchantTextChecker): Deleted.
923
924 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
925
926         [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
927         https://bugs.webkit.org/show_bug.cgi?id=183346
928
929         Reviewed by Michael Catanzaro.
930
931         Pass the request cancellable to NetworkStorageSession::getCredentialFromPersistentStorage().
932
933         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
934         (WebKit::NetworkDataTaskSoup::authenticate):
935
936 2018-04-02  Brady Eidson  <beidson@apple.com>
937
938         Process swapping on navigation needs to handle server redirects.
939         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
940
941         Reviewed by Alex Christensen.
942
943         The same rules we apply to process swapping for basic navigations need to apply
944         to server redirects as well.
945
946         There's three interesting cases we need to support that are covered by new API tests:
947         1 - The initial load in a WKWebView redirects cross-origin.
948         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
949         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
950
951         Supporting all 3 of these brought their own little challenges.
952
953         By teaching Navigation objects more about redirects I was able to support all 3 cases.
954
955         * UIProcess/API/APINavigation.cpp:
956         (API::Navigation::Navigation):
957         (API::Navigation::setCurrentRequest):
958         (API::Navigation::appendRedirectionURL):
959         (API::Navigation::loggingString const):
960         (API::Navigation::loggingURL const): Deleted.
961         * UIProcess/API/APINavigation.h:
962         (API::Navigation::originalRequest const):
963         (API::Navigation::currentRequest const):
964         (API::Navigation::currentRequestProcessIdentifier const):
965         (API::Navigation::setCurrentRequestIsRedirect):
966         (API::Navigation::currentRequestIsRedirect const):
967         (API::Navigation::request const): Deleted.
968
969         * UIProcess/API/Cocoa/WKNavigation.mm:
970         (-[WKNavigation _request]):
971
972         * UIProcess/WebPageProxy.cpp:
973         (WebKit::WebPageProxy::receivedPolicyDecision):
974         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
975           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
976         (WebKit::WebPageProxy::didCreateMainFrame):
977         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
978           cross-origin redirect that is just starting back up in a new WebProcess.
979         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
980         (WebKit::WebPageProxy::didCommitLoadForFrame):
981         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
982         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
983           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
984         * UIProcess/WebPageProxy.h:
985         * UIProcess/WebPageProxy.messages.in:
986
987         * UIProcess/WebProcessPool.cpp:
988         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
989           be used to continue a navigation.
990         * UIProcess/WebProcessPool.h:
991
992         * UIProcess/WebProcessProxy.h:
993         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
994         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
995
996         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
997         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
998         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
999
1000 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
1001
1002         [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
1003         https://bugs.webkit.org/show_bug.cgi?id=184188
1004         <rdar://problem/38940307>
1005
1006         Reviewed by Youenn Fablet.
1007
1008         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
1009         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
1010         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1011         (WebKit::VideoFullscreenModelContext::willExitFullscreen):
1012         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
1013         (WebKit::VideoFullscreenManagerProxy::willExitFullscreen):
1014         * WebProcess/cocoa/VideoFullscreenManager.h:
1015         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
1016         * WebProcess/cocoa/VideoFullscreenManager.mm:
1017         (WebKit::VideoFullscreenManager::willExitFullscreen):
1018
1019 2018-04-02  Brian Burg  <bburg@apple.com>
1020
1021         [Cocoa] Fix some internal builds that consume WebDriver atoms
1022         https://bugs.webkit.org/show_bug.cgi?id=184197
1023
1024         Reviewed by Dan Bernstein.
1025
1026         * WebKit.xcodeproj/project.pbxproj:
1027         Use a Run Script phase to copy WebDriver atoms to WebKit.framework
1028         private headers during the installhdrs phase.
1029
1030 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
1031
1032         Unreviewed, rolling out r230174.
1033
1034         Caused LayoutTests to exit early with assertion failures.
1035
1036         Reverted changeset:
1037
1038         "Process swapping on navigation needs to handle server
1039         redirects."
1040         https://bugs.webkit.org/show_bug.cgi?id=184142
1041         https://trac.webkit.org/changeset/230174
1042
1043 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1044
1045         [Extra zoom mode] Update date picker UI to latest specifications
1046         https://bugs.webkit.org/show_bug.cgi?id=184234
1047         <rdar://problem/38804760>
1048
1049         Reviewed by Timothy Hatcher.
1050
1051         Rename WKTextFormControlListViewControllerDelegate to WKTextInputListViewControllerDelegate and adjust for the
1052         new initializer of WKDatePickerViewController.
1053
1054         * UIProcess/ios/WKContentViewInteraction.mm:
1055         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1056
1057 2018-04-02  Brady Eidson  <beidson@apple.com>
1058
1059         Process swapping on navigation needs to handle server redirects.
1060         <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142
1061
1062         Reviewed by Alex Christensen.
1063
1064         The same rules we apply to process swapping for basic navigations need to apply
1065         to server redirects as well.
1066
1067         There's three interesting cases we need to support that are covered by new API tests:
1068         1 - The initial load in a WKWebView redirects cross-origin.
1069         2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
1070         3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.
1071
1072         Supporting all 3 of these brought their own little challenges.
1073
1074         By teaching Navigation objects more about redirects I was able to support all 3 cases.
1075
1076         * UIProcess/API/APINavigation.cpp:
1077         (API::Navigation::Navigation):
1078         (API::Navigation::setCurrentRequest):
1079         (API::Navigation::appendRedirectionURL):
1080         (API::Navigation::loggingString const):
1081         (API::Navigation::loggingURL const): Deleted.
1082         * UIProcess/API/APINavigation.h:
1083         (API::Navigation::originalRequest const):
1084         (API::Navigation::currentRequest const):
1085         (API::Navigation::currentRequestProcessIdentifier const):
1086         (API::Navigation::setCurrentRequestIsRedirect):
1087         (API::Navigation::currentRequestIsRedirect const):
1088         (API::Navigation::request const): Deleted.
1089
1090         * UIProcess/API/Cocoa/WKNavigation.mm:
1091         (-[WKNavigation _request]):
1092
1093         * UIProcess/WebPageProxy.cpp:
1094         (WebKit::WebPageProxy::receivedPolicyDecision):
1095         (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
1096           redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
1097         (WebKit::WebPageProxy::didCreateMainFrame):
1098         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
1099           cross-origin redirect that is just starting back up in a new WebProcess.
1100         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1101         (WebKit::WebPageProxy::didCommitLoadForFrame):
1102         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1103         (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
1104           a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
1105         * UIProcess/WebPageProxy.h:
1106         * UIProcess/WebPageProxy.messages.in:
1107
1108         * UIProcess/WebProcessPool.cpp:
1109         (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
1110           be used to continue a navigation.
1111         * UIProcess/WebProcessPool.h:
1112
1113         * UIProcess/WebProcessProxy.h:
1114         (WebKit::WebProcessProxy::didCommitProvisionalLoad):
1115         (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):
1116
1117         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1118         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
1119         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1120
1121 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1122
1123         [Extra zoom mode] Zoom level is sometimes excessive when zooming to focused form controls
1124         https://bugs.webkit.org/show_bug.cgi?id=184222
1125         <rdar://problem/39063886>
1126
1127         Reviewed by Timothy Hatcher.
1128
1129         Upon interactively focusing an element, we zoom and scroll to reveal that element. The heuristics introduced in
1130         <https://trac.webkit.org/r168744> work by computing a target scale, and then a point to zoom to given that
1131         scale. Currently, this scale is dependent on the computed font size of the form control, such that the form
1132         control would be scaled to have an effective font size of 16.
1133
1134         However, in extra zoom mode, applying these same heuristics (ironically) results in excessive zoom levels, since
1135         scaling the font up to 16 would cause most form controls to zoom so far in that we lose context of surrounding
1136         elements such as labels and other form controls; the fact that the element is highlighted by the focused form
1137         control overlay makes this even more confusing, since part of the focus overlay highlight rect often ends up
1138         outside the viewport.
1139
1140         To fix this, we make a couple of tweaks to focus rect zooming in extra zoom mode. (1) Instead of computing
1141         target zoom level based on font size, try to zoom such that the focused element rect fills up most of the
1142         viewport (similar to double-tap zooming). This ensures that the focused form control overlay's highlight rect
1143         makes sense in most cases, with few exceptions (e.g. the element frame is larger than the viewport). (2)
1144         Introduce a minimum legible font size of 11, and compute the minimium scale needed such that the form control
1145         font would appear to be at least this legible font size. Then, clamp the target scale chosen by (1) to this
1146         minimum scale.
1147
1148         One additional consideration for (1) is that naively scaling to fit the element rect to the viewport (with some
1149         fixed margins) would cause the viewport scale to always change when moving focus between form controls of
1150         different dimensions, even if the current scale is more or less appropriate for all the focusable elements. To
1151         address this, instead of computing a single target zoom scale for an element rect, compute a range of possible
1152         target zoom scales (where the minimum and maximum values depend on the margin we add around the element rect).
1153         If the current scale already falls within this target scale range, then we won't bother adjusting the scale at
1154         all (unless the font size is too small — see (2)). If the current scale falls outside the target scale range, we
1155         then make the minimal adjustment needed to ensure that the element rect fits well within the viewport without
1156         being too small.
1157
1158         * UIProcess/API/Cocoa/WKWebView.mm:
1159         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
1160
1161         Move some logic around so that the target scale is computed after computing the visible size. Also renames some
1162         constants local to this function (WKWebViewStandardFontSize, kMinimumHeightToShowContentAboveKeyboard,
1163         UIWebFormAnimationDuration, CaretOffsetFromWindowEdge) such that they now share a consistent naming style.
1164
1165 2018-04-02  Jer Noble  <jer.noble@apple.com>
1166
1167         Enable Legacy EME for all WebKit & WebKitLegacy clients
1168         https://bugs.webkit.org/show_bug.cgi?id=184018
1169         <rdar://problem/34887387>
1170
1171         Reviewed by Eric Carlson.
1172
1173         * Shared/WebPreferences.yaml:
1174         * Shared/WebPreferencesDefaultValues.h:
1175
1176 2018-04-02  Jer Noble  <jer.noble@apple.com>
1177
1178         REGRESSION (229680): Fullscreen video does not work (youtube, netflix)
1179         https://bugs.webkit.org/show_bug.cgi?id=184235
1180
1181         Reviewed by Eric Carlson.
1182
1183         Enable the Fullscreen API by default.
1184
1185         * Shared/WebPreferences.yaml:
1186         * Shared/WebPreferencesDefaultValues.h:
1187
1188 2018-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
1189
1190         [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent
1191         https://bugs.webkit.org/show_bug.cgi?id=184120
1192
1193         Reviewed by Alex Christensen.
1194
1195         It seems that MSVC can't compile the code using `this` in a
1196         generalized lambda capture in another lambda.
1197
1198         In this case, there is no need to copy `protectedThis` for the
1199         inner lambda. Move `protectedThis` of the outer lambda to the
1200         inner as well as `callback`.
1201
1202         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1203         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1204         Moved `protectedThis` from the outer lambda to the inner.
1205
1206 2018-04-02  Dan Bernstein  <mitz@apple.com>
1207
1208         Build fix after r230121
1209
1210         * Configurations/WebKit.xcconfig: Disabled framework header postprocessing when building for
1211           iOS 11.*
1212         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Reverted r230159.
1213
1214 2018-04-02  Dan Bernstein  <mitz@apple.com>
1215
1216         Fixed the build when BOOL is not bool.
1217         <rdar://problem/39094484>
1218
1219         Reviewed by Jer Noble.
1220
1221         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1222         (-[WKFullScreenViewController videoControlsManagerDidChange]): Removed the write-only ivar
1223           _hasControlsManager, the assignment to which was causing the compiler error.
1224
1225 2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>
1226
1227         Unreviewed build fix.
1228
1229         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Update availability annotation.
1230
1231 2018-04-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1232
1233         [GTK] DragAndDropHandler.cpp should include GUniquePtrGtk.h
1234         https://bugs.webkit.org/show_bug.cgi?id=184119
1235
1236         Reviewed by Daniel Bates.
1237
1238         * UIProcess/gtk/DragAndDropHandler.cpp:
1239
1240 2018-04-02  Frederic Wang  <fwang@igalia.com>
1241
1242         Fix warnings for unused lambda captures in Source/WebKit
1243         https://bugs.webkit.org/show_bug.cgi?id=173555
1244
1245         Reviewed by Konstantin Tokarev.
1246
1247         When release logs are disabled, several lambda captures are unused, causing compilation
1248         failures with -Wunused-lambda-capture. This patch marks the corresponding variables as unused
1249         in order to fix these warnings.
1250
1251         Based on initial patch by: Konstantin Tokarev  <annulen@yandex.ru>
1252
1253         * NetworkProcess/NetworkResourceLoader.cpp:
1254         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1255         * UIProcess/Network/NetworkProcessProxy.cpp:
1256         (WebKit::NetworkProcessProxy::fetchWebsiteData):
1257         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1258         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1259         * UIProcess/WebProcessProxy.cpp:
1260         (WebKit::WebProcessProxy::fetchWebsiteData):
1261         (WebKit::WebProcessProxy::deleteWebsiteData):
1262         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1263         * UIProcess/ios/WKContentViewInteraction.mm:
1264         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1265
1266 2018-04-02  Alejandro G. Castro  <alex@igalia.com>
1267
1268         [GTK] Make libwebrtc backend buildable for GTK  port
1269         https://bugs.webkit.org/show_bug.cgi?id=178860
1270
1271         Reviewed by Youenn Fablet.
1272
1273         * CMakeLists.txt: Add RTC network classes to the compilation and
1274         the libwebrtc includes.
1275         * PlatformGTK.cmake: Add the libwebrtc directory.
1276         * SourcesGTK.txt: Add RTC files to the compilation.
1277
1278 2018-03-30  Chris Dumez  <cdumez@apple.com>
1279
1280         REGRESSION (r229828): Facebook login popup is blank
1281         https://bugs.webkit.org/show_bug.cgi?id=184206
1282         <rdar://problem/39057006>
1283
1284         Reviewed by Wenson Hsieh.
1285
1286         Add assertion to make sure we never try to do a policy check to
1287         a resource response while a policy check for a navigation is
1288         pending. This assertion was being hit by several of our redirection
1289         tests without my fix.
1290
1291         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1292         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1293
1294 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
1295
1296         Unreviewed, rolling out r230125.
1297
1298         Build fix broke more builds.
1299
1300         Reverted changeset:
1301
1302         "Unreviewed build fix, remove unused lambda capture."
1303         https://trac.webkit.org/changeset/230125
1304
1305 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
1306
1307         Unreviewed build fix, remove unused lambda capture.
1308
1309         * NetworkProcess/NetworkResourceLoader.cpp:
1310         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1311
1312 2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1313
1314         [Extra zoom mode] Adopt list view controller UI for numeric input types
1315         https://bugs.webkit.org/show_bug.cgi?id=184184
1316         <rdar://problem/37238916>
1317
1318         Reviewed by Timothy Hatcher.
1319
1320         Remove existing logic for presenting a number pad view controller, since number pads will now be handled as a
1321         special case of general text form controls in extra zoom mode.
1322
1323         * UIProcess/ios/WKContentViewInteraction.h:
1324         * UIProcess/ios/WKContentViewInteraction.mm:
1325         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
1326         (-[WKContentView dismissAllInputViewControllers]):
1327         (-[WKContentView _wheelChangedWithEvent:]):
1328
1329 2018-03-30  Dan Bernstein  <mitz@apple.com>
1330
1331         Update availability annotations to match the macOS 10.13.4 and iOS 11.3 GM SDKs
1332         https://bugs.webkit.org/show_bug.cgi?id=184173
1333
1334         Reviewed by Alex Christensen.
1335
1336         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13.4 and 11.3, respectively, in all declarations that
1337         appear in the GM SDKs.
1338
1339         * Shared/API/Cocoa/_WKNSWindowExtras.h:
1340         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1341         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
1342         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
1343         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1344         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1345         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1346         * UIProcess/API/Cocoa/WKViewPrivate.h:
1347         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1348         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1349         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1350         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1351         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
1352         * UIProcess/API/Cocoa/_WKAttachment.h:
1353         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1354         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
1355         * UIProcess/API/Cocoa/_WKDownload.h:
1356         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
1357         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
1358         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
1359         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1360         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
1361         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1362         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1363         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1364         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
1365         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
1366
1367 2018-03-30  Youenn Fablet  <youenn@apple.com>
1368
1369         NetworkLoadChecker should upgrade redirects if needed
1370         https://bugs.webkit.org/show_bug.cgi?id=184098
1371
1372         Reviewed by Chris Dumez.
1373
1374         In case of redirections, upgrade URL according CSP.
1375
1376         * NetworkProcess/NetworkLoadChecker.cpp:
1377         (WebKit::NetworkLoadChecker::checkRequest):
1378         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
1379
1380 2018-03-30  JF Bastien  <jfbastien@apple.com>
1381
1382         Update messages.py codegen for String, fix tests
1383         https://bugs.webkit.org/show_bug.cgi?id=184179
1384         <rdar://problem/39041352>
1385
1386         Reviewed by Mark Lam.
1387
1388         I updated some of the code in
1389         https://trac.webkit.org/changeset/230097 and auto-magically used a
1390         script to update copyright headers... and that broke the tests
1391         which checked for a particular date. Update all of the headers.
1392
1393         Part of this change updates the code generated by messages.py
1394
1395         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
1396         * Scripts/webkit/MessageReceiver-expected.cpp:
1397         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
1398         * Scripts/webkit/MessagesSuperclass-expected.h:
1399         * Scripts/webkit/messages.py:
1400         * Scripts/webkit/messages_unittest.py:
1401         (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
1402         generate a better error message
1403
1404 2018-03-29  JF Bastien  <jfbastien@apple.com>
1405
1406         Use Forward.h instead of forward-declaring WTF::String
1407         https://bugs.webkit.org/show_bug.cgi?id=184172
1408         <rdar://problem/39026146>
1409
1410         Reviewed by Yusuke Suzuki.
1411
1412         As part of #184164 I'm changing WTF::String, and the forward
1413         declarations are just wrong because I'm making it templated. We
1414         should use Forward.h anyways, so do that instead.
1415
1416         * Scripts/webkit/LegacyMessages-expected.h:
1417         * Scripts/webkit/Messages-expected.h:
1418         * Scripts/webkit/MessagesSuperclass-expected.h:
1419         * UIProcess/WebOpenPanelResultListenerProxy.h:
1420
1421 2018-03-29  Brian Burg  <bburg@apple.com>
1422
1423         Web Automation: clipToViewport is ignored for element screenshots
1424         https://bugs.webkit.org/show_bug.cgi?id=184158
1425         <rdar://problem/39014307>
1426
1427         Reviewed by Timothy Hatcher.
1428
1429         In §19.2 Take Element Screenshot, step 5.2 says that we should clip
1430         the element screenshot rect with the visible viewport rect. We don't
1431         do that right now even though we pass over clipToViewport.
1432
1433         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1434         (WebKit::snapshotRectForScreenshot):
1435         Clip the rect to viewport if needed.
1436
1437         (WebKit::WebAutomationSessionProxy::takeScreenshot):
1438         This scrollIntoView is misplaced; by this point we have already done
1439         the math to figure out the screenshot rect. Move it before computing the rect.
1440
1441 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
1442
1443         REGRESSION(r230035): ASSERT(MACH_PORT_VALID(m_sendPort)) hit in IPC::Connection::initializeSendSource()
1444         https://bugs.webkit.org/show_bug.cgi?id=184122
1445         <rdar://problem/39003606>
1446
1447         Reviewed by Chris Dumez.
1448
1449         One of the new assertions added in r230035 begin firing while running tests locally. This was happening
1450         because the WebInspector was attempting to open a new connection to a web process that had already
1451         terminated its mach port connection (a dead port).
1452         
1453         We should avoid opening new connections when the port we were given is already dead.
1454
1455         * Platform/IPC/Connection.h:
1456         (IPC::Connection::identifierIsValid): Added.
1457         * Platform/IPC/mac/ConnectionMac.mm:
1458         (IPC::Connection::platformInitialize): Do not perform initialization on a dead (or null) port.
1459         (IPC::Connection::open): Add some assertions that ports are in a valid state.
1460         (IPC::Connection::sendOutgoingMessage): Assert that the send port is not dead.
1461         (IPC::Connection::receiveSourceEventHandler): Assert that the receive port is valid.
1462         * UIProcess/ChildProcessProxy.cpp:
1463         (WebKit::ChildProcessProxy::didFinishLaunching): Treat a dead port as a signal that the
1464         child process failed to launch.
1465         * UIProcess/Network/NetworkProcessProxy.cpp:
1466         (WebKit::NetworkProcessProxy::didFinishLaunching): Ditto.
1467         * UIProcess/Plugins/PluginProcessProxy.cpp:
1468         (WebKit::PluginProcessProxy::didFinishLaunching): Ditto.
1469         * UIProcess/Storage/StorageProcessProxy.cpp:
1470         (WebKit::StorageProcessProxy::didFinishLaunching): Ditto.
1471         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1472         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): Ditto.
1473         * WebProcess/WebPage/WebInspectorUI.cpp:
1474         (WebKit::WebInspectorUI::establishConnection): Ditto.
1475         * WebProcess/WebProcess.cpp:
1476         (WebKit::WebProcess::ensureNetworkProcessConnection): Ditto.
1477         (WebKit::WebProcess::ensureWebToStorageProcessConnection): Ditto.
1478
1479 2018-03-29  Youenn Fablet  <youenn@apple.com>
1480
1481         Synchronize SecurityOrigin related scheme registries with NetworkProcess
1482         https://bugs.webkit.org/show_bug.cgi?id=184140
1483
1484         Reviewed by Chris Dumez.
1485
1486         Add syncing of scheme registries that are used by SecurityOrigin and ContentSecurityPolicy
1487         so that we can properly use them in NetworkProcess as we do in WebProcess.
1488         The registries that are not synced are:
1489         - URLSchemeAsEmptyDocument
1490         - URLSchemeDomainRelaxationForbidden
1491         - URLSchemeAsCachePartitioned
1492         - URLSchemeAsCanDisplayOnlyIfCanRequest
1493
1494         * NetworkProcess/NetworkProcess.cpp:
1495         (WebKit::NetworkProcess::initializeNetworkProcess):
1496         (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
1497         (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
1498         (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
1499         (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
1500         (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
1501         (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
1502         (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
1503         * NetworkProcess/NetworkProcess.h:
1504         * NetworkProcess/NetworkProcess.messages.in:
1505         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1506         (WebKit::NetworkProcessCreationParameters::encode const):
1507         (WebKit::NetworkProcessCreationParameters::decode):
1508         * NetworkProcess/NetworkProcessCreationParameters.h:
1509         * UIProcess/WebProcessPool.cpp:
1510         (WebKit::WebProcessPool::ensureNetworkProcess):
1511         (WebKit::WebProcessPool::registerURLSchemeAsSecure):
1512         (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
1513         (WebKit::WebProcessPool::registerURLSchemeAsLocal):
1514         (WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
1515         (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):
1516         (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
1517         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
1518
1519 2018-03-29  Brent Fulgham  <bfulgham@apple.com>
1520
1521         REGRESSION(r229480): ERROR: Unhandled web process message 'WebCookieManager:SetHTTPCookieAcceptPolicy'
1522         https://bugs.webkit.org/show_bug.cgi?id=184124
1523         <rdar://problem/38998971>
1524
1525         Reviewed by Chris Dumez.
1526
1527         Cookie accept policy messages were still being sent to the WebContent process after
1528         I removed cookie access in r229480. The WebContent process no longer recognizes these
1529         messages, and generates logging to that effect.
1530         
1531         This patch stops sending these unnecessary messages to the WebContent process. Only the
1532         Network process needs to receive this information.
1533
1534         * UIProcess/WebCookieManagerProxy.cpp:
1535         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
1536
1537 2018-03-29  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1538
1539         [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
1540         https://bugs.webkit.org/show_bug.cgi?id=184037
1541
1542         Reviewed by Žan Doberšek.
1543
1544         * Shared/wpe/WebEventFactory.cpp:
1545         (WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.
1546
1547 2018-03-28  Zalan Bujtas  <zalan@apple.com>
1548
1549         Make it possible to override the screen size
1550         https://bugs.webkit.org/show_bug.cgi?id=184111
1551         <rdar://problem/38972181>
1552
1553         Reviewed by Tim Horton.
1554
1555         * Shared/WebPageCreationParameters.cpp:
1556         (WebKit::WebPageCreationParameters::encode const):
1557         (WebKit::WebPageCreationParameters::decode):
1558         * Shared/WebPageCreationParameters.h:
1559         * UIProcess/WebPageProxy.cpp:
1560         (WebKit::WebPageProxy::creationParameters):
1561         * UIProcess/WebPageProxy.h:
1562         * UIProcess/ios/WebPageProxyIOS.mm:
1563         (WebKit::WebPageProxy::overrideScreenSize):
1564         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1565         (WebKit::WebChromeClient::overrideScreenSize const):
1566         * WebProcess/WebCoreSupport/WebChromeClient.h:
1567         * WebProcess/WebPage/WebPage.cpp:
1568         * WebProcess/WebPage/WebPage.h:
1569         * WebProcess/WebPage/ios/WebPageIOS.mm:
1570         (WebKit::WebPage::overrideScreenSize const):
1571
1572 2018-03-28  Chris Dumez  <cdumez@apple.com>
1573
1574         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
1575         https://bugs.webkit.org/show_bug.cgi?id=183962
1576         <rdar://problem/38817833>
1577
1578         Reviewed by Brady Eidson.
1579
1580         Swap WebProcess on for the initial navigation in a new Window that was opened
1581         via window.open(), when the new URL is cross-origin compared to the opener's
1582         origin. For now, we only swap process if 'noopener' property is set when calling
1583         window.open(). This is because we do not support the remote DOMWindows yet.
1584
1585         * Shared/NavigationActionData.cpp:
1586         (WebKit::NavigationActionData::encode const):
1587         (WebKit::NavigationActionData::decode):
1588         * Shared/NavigationActionData.h:
1589         * UIProcess/API/APINavigation.h:
1590         (API::Navigation::setIsCrossOriginWindowOpenNavigation):
1591         (API::Navigation::isCrossOriginWindowOpenNavigation const):
1592         (API::Navigation::setOpener):
1593         (API::Navigation::opener const):
1594         * UIProcess/WebPageProxy.cpp:
1595         (WebKit::WebPageProxy::receivedPolicyDecision):
1596         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1597         * UIProcess/WebProcessPool.cpp:
1598         (WebKit::WebProcessPool::processForNavigation):
1599         * UIProcess/WebProcessPool.h:
1600         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1601         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1602
1603 2018-03-28  Per Arne Vollan  <pvollan@apple.com>
1604
1605         Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
1606         https://bugs.webkit.org/show_bug.cgi?id=183959
1607         <rdar://problem/38965719>
1608
1609         Reviewed by Brent Fulgham.
1610
1611         Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.
1612
1613         * WebProcess/WebProcess.cpp:
1614         (WebKit::WebProcess::initializeProcess):
1615
1616 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1617
1618         Unreviewed build fix after r230045.
1619
1620         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: Add missing include (breaks iOS).
1621
1622 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1623
1624         Protect against invalid mach ports returned by mach_port_request_notification
1625         https://bugs.webkit.org/show_bug.cgi?id=184106
1626         <rdar://problem/37865316>
1627
1628         Reviewed by Chris Dumez.
1629
1630         * Platform/IPC/Connection.h:
1631         (IPC::Connection::Identifier::Identifier): Use default initializer syntax.
1632         * Platform/IPC/mac/ConnectionMac.mm:
1633         (IPC::Connection::open): Drive-by-fix: Include formatted mach error message in logging.
1634         (IPC::Connection::receiveSourceEventHandler): Check return value from 'mach_port_request_notification'
1635         and clean up if it experienced an error.
1636         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1637         (WebKit::ProcessLauncher::launchProcess): Ditto.
1638
1639 2018-03-28  Dean Jackson  <dino@apple.com>
1640
1641         WKWebViewContentProvider shouldn't be a UIScrollViewDelegate
1642         https://bugs.webkit.org/show_bug.cgi?id=184107
1643         <rdar://problem/38967492>
1644
1645         Reviewed by Tim Horton.
1646
1647         There is no need for this class to be a UIScrollViewDelegate. Instead
1648         the protocol should have an optional method that is effectively
1649         scrollViewDidScroll.
1650
1651         * UIProcess/API/Cocoa/WKWebView.mm:
1652         (-[WKWebView scrollViewDidScroll:]): Call web_scrollViewDidScroll
1653         if it exists.
1654         * UIProcess/Cocoa/WKWebViewContentProvider.h: Remove UIScrollViewDelegate
1655         and add an optional web_scrollViewDidScroll.
1656         * UIProcess/ios/WKPDFView.mm:
1657         (-[WKPDFView web_scrollViewDidScroll:]): Renamed from scrollViewDidScroll.
1658         (-[WKPDFView scrollViewDidScroll:]): Deleted.
1659         * UIProcess/ios/WKSystemPreviewView.mm:
1660         (-[WKSystemPreviewView scrollViewDidScroll:]): Deleted.
1661
1662 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1663
1664         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
1665         https://bugs.webkit.org/show_bug.cgi?id=184092
1666         <rdar://problem/38939917>
1667
1668         Reviewed by Tim Horton.
1669
1670         Add a private web view preference to switch between normal and boosted text autosizing mode. By default, we use
1671         normal text autosizing values.
1672
1673         * Shared/WebPreferences.yaml:
1674         * UIProcess/API/Cocoa/WKPreferences.mm:
1675         (-[WKPreferences _setShouldEnableTextAutosizingBoost:]):
1676         (-[WKPreferences _shouldEnableTextAutosizingBoost]):
1677         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1678
1679 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
1680
1681         Avoid uninitialized mach ports
1682         https://bugs.webkit.org/show_bug.cgi?id=184090
1683         <rdar://problem/37261129>
1684
1685         Reviewed by Chris Dumez.
1686
1687         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
1688         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
1689         there is a potential for us to try to use invalid ports.
1690
1691         We should always check return values, and ensure that the mach port variables we seek to initialize are
1692         kept in a valid state.
1693
1694         Reviewed by Chris Dumez.
1695
1696         * NetworkProcess/NetworkProcess.cpp:
1697         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): Initialize new port to a safe default and
1698         check the return state of the allocation function.
1699         * Platform/IPC/Connection.h:
1700         * Platform/IPC/mac/ConnectionMac.mm:
1701         (IPC::Connection::open): Ditto.
1702         (IPC::Connection::initializeSendSource): Ditto.
1703         (IPC::readFromMachPort): Ditto.
1704         (IPC::Connection::receiveSourceEventHandler): Ditto.
1705         * Platform/SharedMemory.h:
1706         * Platform/cocoa/SharedMemoryCocoa.cpp:
1707         (WebKit::makeMemoryEntry): Ditto.
1708         * Platform/mac/MachUtilities.cpp:
1709         (setMachPortQueueLength): Ditto.
1710         (setMachExceptionPort): Ditto.
1711         * PluginProcess/PluginProcess.cpp:
1712         (WebKit::PluginProcess::createWebProcessConnection): Ditto.
1713         * StorageProcess/StorageProcess.cpp:
1714         (WebKit::StorageProcess::createStorageToWebProcessConnection): Ditto.
1715         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1716         (WebKit::ProcessLauncher::launchProcess): Ditto.
1717         * WebProcess/WebPage/WebInspector.cpp:
1718         (WebKit::WebInspector::openFrontendConnection): Ditto.
1719
1720 2018-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1721
1722         Fails to build webkitgtk+ after git-svn-id: http://svn.webkit.org/repository/webkit/trunk@229877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1723         https://bugs.webkit.org/show_bug.cgi?id=184081
1724
1725         Unreviewed, switch to use UNUSED_PARAM()
1726
1727         * UIProcess/WebPageProxy.cpp:
1728         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1729
1730 2018-03-28  Tim Horton  <timothy_horton@apple.com>
1731
1732         Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
1733         https://bugs.webkit.org/show_bug.cgi?id=184072
1734         <rdar://problem/38946530>
1735
1736         Reviewed by Dan Bernstein.
1737
1738         * Platform/mac/LayerHostingContext.mm:
1739         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1740         * UIProcess/mac/ViewSnapshotStore.h:
1741         * UIProcess/mac/ViewSnapshotStore.mm:
1742         (WebKit::ViewSnapshot::clearImage):
1743
1744 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1745
1746         Revert an unnecessary workaround when zooming focused form controls
1747         https://bugs.webkit.org/show_bug.cgi?id=184067
1748         <rdar://problem/38805254>
1749
1750         Reviewed by Tim Horton.
1751
1752         Reverts an unintended change introduced in r227984.
1753
1754         * UIProcess/ios/WKContentViewInteraction.mm:
1755         (-[WKContentView _displayFormNodeInputView]):
1756
1757 2018-03-28  Miguel Gomez  <magomez@igalia.com>
1758
1759         [GTK][WPE] Remove UpdateAtlas
1760         https://bugs.webkit.org/show_bug.cgi?id=184042
1761
1762         Reviewed by Žan Doberšek.
1763
1764         Remove all the code related to UpdateAtlas handling.
1765
1766         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1767         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
1768         (WebKit::CoordinatedGraphicsScene::commitSceneState):
1769         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
1770         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
1771         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
1772         (WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
1773         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
1774         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1775         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1776         (WebKit::ThreadedCompositor::renderLayerTree):
1777         (WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
1778         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1779         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1780         (WebKit::WebChromeClient::delegatedScrollRequested):
1781         (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
1782         * WebProcess/WebCoreSupport/WebChromeClient.h:
1783         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1784         (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
1785         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1786         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1787         (WebKit::CompositingCoordinator::CompositingCoordinator):
1788         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1789         (WebKit::CompositingCoordinator::clearPendingStateChanges):
1790         (WebKit::CompositingCoordinator::renderNextFrame):
1791         (WebKit::CompositingCoordinator::purgeBackingStores):
1792         (WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
1793         (WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
1794         (WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
1795         (): Deleted.
1796         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
1797         (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
1798         (WebKit::CompositingCoordinator::releaseAtlases): Deleted.
1799         (WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
1800         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1801         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1802         (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
1803         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1804         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1805         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
1806         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1807         * WebProcess/WebPage/DrawingArea.h:
1808         * WebProcess/WebPage/LayerTreeHost.h:
1809         (WebKit::LayerTreeHost::setIsDiscardable):
1810
1811 2018-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1812
1813         REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
1814         https://bugs.webkit.org/show_bug.cgi?id=184075
1815
1816         Reviewed by Žan Doberšek.
1817
1818         This is because we are using a value after it has been moved.
1819
1820         * UIProcess/Automation/WebAutomationSession.cpp:
1821         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
1822         before using it when it's also going to be moved in the lambda capture.
1823
1824 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1825
1826         Unreviewed, fix typo in variable name
1827
1828         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1829         (webkitWebViewBaseCrossingNotifyEvent):
1830
1831 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
1832
1833         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
1834         https://bugs.webkit.org/show_bug.cgi?id=183923
1835         <rdar://problem/38756869>
1836
1837         Reviewed by Brent Fulgham.
1838
1839         Send OpenGL display mask to the WebContent process when the display ID is changing.
1840
1841         * UIProcess/WebPageProxy.cpp:
1842         (WebKit::WebPageProxy::windowScreenDidChange):
1843         * WebProcess/WebPage/WebPage.h:
1844         * WebProcess/WebPage/WebPage.messages.in:
1845         * WebProcess/WebPage/mac/WebPageMac.mm:
1846         (WebKit::WebPage::openGLDisplayMaskChanged):
1847
1848 2018-03-27  Youenn Fablet  <youenn@apple.com>
1849
1850         Move request checking out of PingLoad for future reuse in NetworkLoad
1851         https://bugs.webkit.org/show_bug.cgi?id=183865
1852
1853         Reviewed by Chris Dumez.
1854
1855         Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
1856         Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.
1857
1858         Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.
1859
1860         Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
1861         Ensure this callback is called even if preflight is not completed by returning a Canceled error.
1862
1863         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1864         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
1865         (WebKit::NetworkCORSPreflightChecker::returnResult):
1866         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
1867         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1868         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
1869         * NetworkProcess/NetworkCORSPreflightChecker.h:
1870         * NetworkProcess/NetworkLoadChecker.cpp: Added.
1871         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1872         (WebKit::NetworkLoadChecker::check):
1873         (WebKit::NetworkLoadChecker::checkRedirection):
1874         (WebKit::NetworkLoadChecker::returnError):
1875         (WebKit::NetworkLoadChecker::checkRequest):
1876         (WebKit::NetworkLoadChecker::checkCORSRequest):
1877         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
1878         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1879         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
1880         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
1881         (WebKit::NetworkLoadChecker::contentExtensionsBackend):
1882         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
1883         * NetworkProcess/NetworkLoadChecker.h: Added.
1884         (WebKit::NetworkLoadChecker::setCSPResponseHeaders):
1885         (WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
1886         (WebKit::NetworkLoadChecker::url const):
1887         (WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
1888         (WebKit::NetworkLoadChecker::isChecking const):
1889         (WebKit::NetworkLoadChecker::isRedirected const):
1890         * NetworkProcess/PingLoad.cpp:
1891         (WebKit::PingLoad::PingLoad):
1892         (WebKit::PingLoad::~PingLoad):
1893         (WebKit::PingLoad::willPerformHTTPRedirection):
1894         (WebKit::PingLoad::didReceiveChallenge):
1895         (WebKit::PingLoad::wasBlocked):
1896         (WebKit::PingLoad::cannotShowURL):
1897         (WebKit::PingLoad::timeoutTimerFired):
1898         (WebKit::PingLoad::currentURL const):
1899         * NetworkProcess/PingLoad.h:
1900         * WebKit.xcodeproj/project.pbxproj:
1901
1902 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
1903
1904         [WebAuthN] Implement authenticatorGetAssertion
1905         https://bugs.webkit.org/show_bug.cgi?id=183881
1906         <rdar://problem/37258628>
1907
1908         Reviewed by Brent Fulgham.
1909
1910         * Shared/WebPreferences.yaml:
1911         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
1912         (WebKit::WebCredentialsMessengerProxy::makeCredential):
1913         (WebKit::WebCredentialsMessengerProxy::getAssertion):
1914         (WebKit::WebCredentialsMessengerProxy::getAssertionReply):
1915         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
1916         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
1917         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
1918         (WebKit::WebCredentialsMessenger::getAssertion):
1919         (WebKit::WebCredentialsMessenger::getAssertionReply):
1920         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
1921
1922 2018-03-27  Chris Dumez  <cdumez@apple.com>
1923
1924         Avoid constructing SecurityOrigin objects from non-main threads
1925         https://bugs.webkit.org/show_bug.cgi?id=184024
1926
1927         Reviewed by Youenn Fablet.
1928
1929         Avoid constructing SecurityOrigin objects from non-main threads as much as possible.
1930
1931         * WebProcess/Storage/WebSWClientConnection.cpp:
1932         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
1933         (WebKit::WebSWClientConnection::matchRegistration):
1934         (WebKit::WebSWClientConnection::getRegistrations):
1935         * WebProcess/Storage/WebSWClientConnection.h:
1936         * WebProcess/Storage/WebSWOriginTable.cpp:
1937         (WebKit::WebSWOriginTable::contains const):
1938         * WebProcess/Storage/WebSWOriginTable.h:
1939
1940 2018-03-27  Chris Dumez  <cdumez@apple.com>
1941
1942         Move online state detection from the WebProcess to the NetworkProcess
1943         https://bugs.webkit.org/show_bug.cgi?id=183989
1944         <rdar://problem/37093299>
1945
1946         Reviewed by Youenn Fablet.
1947
1948         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
1949         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
1950         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
1951         its connected WebProcesses via IPC.
1952
1953         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1954         (WebKit::NetworkConnectionToWebProcess::setOnLineState):
1955         * NetworkProcess/NetworkConnectionToWebProcess.h:
1956         * NetworkProcess/NetworkProcess.cpp:
1957         (WebKit::NetworkProcess::NetworkProcess):
1958         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1959         * WebProcess/Network/NetworkProcessConnection.cpp:
1960         (WebKit::NetworkProcessConnection::setOnLineState):
1961         * WebProcess/Network/NetworkProcessConnection.h:
1962         * WebProcess/Network/NetworkProcessConnection.messages.in:
1963         * WebProcess/Network/WebLoaderStrategy.cpp:
1964         (WebKit::WebLoaderStrategy::isOnLine const):
1965         (WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
1966         (WebKit::WebLoaderStrategy::setOnLineState):
1967         * WebProcess/Network/WebLoaderStrategy.h:
1968
1969 2018-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1970
1971         [Extra zoom mode] Add support for new focused form control overlay behaviors
1972         https://bugs.webkit.org/show_bug.cgi?id=184043
1973         <rdar://problem/38758727>
1974
1975         Reviewed by Tim Horton.
1976
1977         See below for more details.
1978
1979         * UIProcess/ios/WKContentViewInteraction.mm:
1980         (-[WKContentView _willStartScrollingOrZooming]):
1981         (-[WKContentView _didEndScrollingOrZooming]):
1982
1983         Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
1984         when moving from one focused form control to another).
1985
1986         (-[WKContentView textInputController:didCommitText:withSuggestion:]):
1987
1988         When dismissing an input view controller, allow focused form control navigation only after updating assisted
1989         node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
1990
1991         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
1992         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
1993         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
1994         (-[WKContentView scrollViewForFocusedFormControlController:]):
1995         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
1996
1997         Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
1998         previous focusable form controls.
1999
2000 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
2001
2002         Further refine cookie read/write logging
2003         https://bugs.webkit.org/show_bug.cgi?id=184044
2004         <rdar://problem/38915610>
2005
2006         Reviewed by Chris Dumez.
2007
2008         Cookie logging was passing the partition, rather than the first party, when logging, which
2009         prevented logging in cases where partitioning or blocking was active. This patch corrects
2010         these calls so that logging is generated in these cases, too.
2011
2012         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2013         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
2014         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
2015         * NetworkProcess/NetworkResourceLoader.cpp:
2016         (WebKit::escapeIDForJSON): Make available to use in multiple functions.
2017         (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
2018         convenience functions.
2019         (WebKit::logBlockedCookieInformation): Added.
2020         (WebKit::logCookieInformationInternal): Added.
2021         (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
2022         convenience functions.
2023         * NetworkProcess/NetworkResourceLoader.h:
2024
2025 2018-03-27  Brian Burg  <bburg@apple.com>
2026
2027         Web Automation: support enter/exit fullscreen and hide/restore window operations
2028         https://bugs.webkit.org/show_bug.cgi?id=182837
2029         <rdar://problem/37580732>
2030
2031         Reviewed by Tim Horton.
2032
2033         The W3C specification is more explicit about when to exit fullscreen and
2034         restore the window for a browsing context. So, WebKit needs to have support
2035         for performing these operations on behalf of a driver.
2036
2037         Based on prototyping, it is sufficient to use a JavaScript atom to enter
2038         fullscreen mode. This is included in the patch as EnterFullscreen.js and
2039         can be used to implement the §10.7.5 Fullscreen Window command.
2040
2041         Other window operations cannot be peformed from JavaScript, so we need to
2042         delegate these operations to the session client (i.e., Safari).
2043         This patch adds session client callouts for restoring, minimizing, and
2044         switching to a browsing context.
2045
2046         Exiting fullscreen happens implicitly (per specification) when setting a
2047         window frame without an actual frame, or when switching/restoring/minimizing a window.
2048         If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
2049         Similarly, a driver can restore a minimized window using Set Window Rect.
2050
2051         * UIProcess/API/APIAutomationSessionClient.h:
2052         (API::AutomationSessionClient::requestHideWindowOfPage):
2053         (API::AutomationSessionClient::requestRestoreWindowOfPage):
2054         (API::AutomationSessionClient::requestSwitchToPage):
2055         Add new API client methods.
2056
2057         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2058         Add new Cocoa API delegate methods.
2059
2060         * UIProcess/Automation/Automation.json:
2061         Make the switch to browsing context command asynchronous, since this functionality
2062         is not always synchronous, and we prefer to use completion handlers in the delegates.
2063
2064         Add new protocol method for hiding the window of a browsing context.
2065         This is expected to minimize/miniaturize a window for desktop window managers.
2066
2067         * UIProcess/Automation/WebAutomationSession.h:
2068         * UIProcess/Automation/WebAutomationSession.cpp:
2069         (WebKit::WebAutomationSession::switchToBrowsingContext):
2070         Make this function asynchronous. Call out to the session client.
2071
2072         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
2073         Follow the steps in the specification to restore window and exit fullscreen.
2074
2075         (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
2076         Exit fullscreen and call out to the session client.
2077
2078         (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
2079         This is a little strange. Because there is no async API for exiting fullscreen
2080         from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
2081         out the response if the page exited fullscreen after we requested it to do so.
2082         Because the W3C specification mandates that drivers only process one command at
2083         a time, there will only ever be one callback installed by this method at a time.
2084
2085         (WebKit::WebAutomationSession::restoreWindowForPage):
2086         (WebKit::WebAutomationSession::hideWindowForPage):
2087         Call out to the session client.
2088
2089         (WebKit::WebAutomationSession::didEnterFullScreenForPage):
2090         (WebKit::WebAutomationSession::didExitFullScreenForPage):
2091         Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.
2092
2093         * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
2094         (enterFullscreen):
2095
2096         * UIProcess/Cocoa/AutomationSessionClient.h:
2097         * UIProcess/Cocoa/AutomationSessionClient.mm:
2098         (WebKit::AutomationSessionClient::AutomationSessionClient):
2099         (WebKit::AutomationSessionClient::requestSwitchToPage):
2100         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
2101         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
2102         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
2103         Add boilerplate to convert C++ API client to Objective-C delegate methods.
2104
2105         * UIProcess/WebFullScreenManagerProxy.cpp:
2106         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
2107         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
2108         Notify the automation session if the page is under automation and
2109         enters or exits fullscreen.
2110
2111         * WebKit.xcodeproj/project.pbxproj:
2112         Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
2113         as WebKit2 private headers and used by driver implementations.
2114
2115 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
2116
2117         Make AVFoundationEnabled preference available on iOS
2118         https://bugs.webkit.org/show_bug.cgi?id=183876
2119         <rdar://problem/38726459>
2120
2121         Reviewed by Youenn Fablet.
2122
2123         * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
2124         * Shared/WebPreferencesDefaultValues.h:
2125
2126         * UIProcess/API/Cocoa/WKPreferences.mm:
2127         (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
2128         (-[WKPreferences _avFoundationEnabled]): Ditto.
2129         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2130
2131 2018-03-26  Tim Horton  <timothy_horton@apple.com>
2132
2133         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
2134         https://bugs.webkit.org/show_bug.cgi?id=184030
2135         <rdar://problem/38895281>
2136
2137         Reviewed by Dan Bernstein.
2138
2139         * Configurations/Base.xcconfig:
2140         * Configurations/BaseTarget.xcconfig:
2141         * Configurations/WebKit.xcconfig:
2142
2143 2018-03-26  Tim Horton  <timothy_horton@apple.com>
2144
2145         Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
2146         https://bugs.webkit.org/show_bug.cgi?id=184026
2147         <rdar://problem/38883321>
2148
2149         Reviewed by Sam Weinig.
2150
2151         * UIProcess/API/Cocoa/WKWebView.mm:
2152         (-[WKWebView _takeViewSnapshot]):
2153         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2154
2155 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2156
2157         [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
2158         https://bugs.webkit.org/show_bug.cgi?id=184020
2159         Work towards <rdar://problem/38758727>
2160
2161         Reviewed by Tim Horton.
2162
2163         We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
2164         a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
2165         (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
2166         the focused form control overlay.
2167
2168         This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
2169         form control view controller can receive forwarded events from the web view. See below for more detail.
2170
2171         * UIProcess/ios/WKContentViewInteraction.mm:
2172         (-[WKContentView presentFocusedFormControlViewController:]):
2173         (-[WKContentView dismissFocusedFormControlViewController:]):
2174
2175         Remove logic to restore the web view as first responder.
2176
2177         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2178         (-[WKContentView dismissAllInputViewControllers]):
2179
2180         Restore first responder after dismissing a view controller that was presented when focusing a form control, only
2181         if the web view was first responder before presentation.
2182
2183         (-[WKContentView presentDatePickerViewController:]): Deleted.
2184         (-[WKContentView dismissDatePickerViewController:]): Deleted.
2185         (-[WKContentView presentTimePickerViewController:]): Deleted.
2186         (-[WKContentView dismissTimePickerViewController:]): Deleted.
2187         (-[WKContentView presentSelectMenuViewController:]): Deleted.
2188         (-[WKContentView dismissSelectMenuViewController:]): Deleted.
2189         (-[WKContentView dismissNumberPadViewController:]): Deleted.
2190         (-[WKContentView presentNumberPadViewController:]): Deleted.
2191         (-[WKContentView presentTextInputViewController:]): Deleted.
2192         (-[WKContentView dismissTextInputViewController:]): Deleted.
2193
2194 2018-03-06  Brian Burg  <bburg@apple.com>
2195
2196         Web Automation: provide a way to ask clients for a new tab or window
2197         https://bugs.webkit.org/show_bug.cgi?id=183381
2198         <rdar://problem/38167301>
2199
2200         Reviewed by Timothy Hatcher.
2201
2202         Add support for specifying browsing context options when requesting
2203         a new browsing context from the automation session client/delegate.
2204         This is currently just used for specifying tab vs window, but could
2205         also be used for things like toggling certain browser chrome or features.
2206
2207         There is no guarantee that the client has a notion of tabs vs windows,
2208         so this option is purely advisory and should not cause the command to
2209         fail if it cannot be honored.
2210
2211         This behavior caused by specifying this option is client-specific, so no
2212         new tests are included in WebKit for this change.
2213
2214         * UIProcess/API/APIAutomationSessionClient.h:
2215         (API::AutomationSessionClient::didRequestNewPageWithOptions):
2216         (API::AutomationSessionClient::didRequestNewWindow): Deleted.
2217         Add options parameter.
2218
2219         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2220         Adjust to new signature. More work is needed to plumb this information
2221         to the public API for GTK/WPE and support it in WebKitGTK driver.
2222
2223         * UIProcess/Automation/Automation.json: Add new optional parameter.
2224
2225         * UIProcess/Automation/WebAutomationSession.h:
2226         * UIProcess/Automation/WebAutomationSession.cpp:
2227         (WebKit::WebAutomationSession::createBrowsingContext):
2228         Convert the protocol option to an API option.
2229
2230         * UIProcess/Cocoa/AutomationSessionClient.h:
2231         * UIProcess/Cocoa/AutomationSessionClient.mm:
2232         (WebKit::AutomationSessionClient::AutomationSessionClient):
2233         (WebKit::toAPI):
2234         (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
2235         (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
2236         Convert the internal option to a Cocoa SPI option and pass it along.
2237
2238         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2239         Adjust delegate methods to include options. Clients need to adopt the new signature(s).
2240
2241 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2242
2243         [Extra zoom mode] Add plumbing for next and previous focusable element rects
2244         https://bugs.webkit.org/show_bug.cgi?id=184016
2245         Work towards <rdar://problem/38758727>
2246
2247         Reviewed by Tim Horton.
2248
2249         When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
2250         as well as flags indicating whether or not there are next or previous focusable elements. For
2251         <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.
2252
2253         * Shared/AssistedNodeInformation.cpp:
2254         (WebKit::AssistedNodeInformation::encode const):
2255         (WebKit::AssistedNodeInformation::decode):
2256
2257         IPC support for nextNodeRect and previousNodeRect.
2258
2259         * Shared/AssistedNodeInformation.h:
2260         * WebProcess/WebPage/ios/WebPageIOS.mm:
2261         (WebKit::elementRectInRootViewCoordinates):
2262
2263         Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
2264         current focused element as well as those of the next and previous elements, if any.
2265
2266         (WebKit::WebPage::getAssistedNodeInformation):
2267         (WebKit::hasAssistableElement): Deleted.
2268
2269         Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.
2270
2271 2018-03-26  Chris Dumez  <cdumez@apple.com>
2272
2273         Use SecurityOriginData more consistently in Service Worker code
2274         https://bugs.webkit.org/show_bug.cgi?id=183969
2275
2276         Reviewed by Darin Adler.
2277
2278         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
2279         SecurityOrigin objects unnecessarily.
2280
2281         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2282         (WebKit::NetworkResourceLoadParameters::encode const):
2283         * Shared/API/c/WKSecurityOriginRef.cpp:
2284         (WKSecurityOriginCopyDatabaseIdentifier):
2285         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2286         (WebKit::WebSWOriginStore::addToStore):
2287         (WebKit::WebSWOriginStore::removeFromStore):
2288         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2289         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2290         (WebKit::WebSWServerConnection::scheduleJobInServer):
2291         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2292         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2293         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2294         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2295         * StorageProcess/StorageProcess.cpp:
2296         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2297         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2298         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2299         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2300         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2301         (WebKit::StorageProcess::createServerToContextConnection):
2302         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
2303         * StorageProcess/StorageProcess.h:
2304         * UIProcess/API/APIFrameInfo.cpp:
2305         (API::FrameInfo::create):
2306         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2307         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2308         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2309         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
2310         * UIProcess/API/C/WKResourceCacheManager.cpp:
2311         (WKResourceCacheManagerClearCacheForOrigin):
2312         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2313         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
2314         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
2315         * UIProcess/ServiceWorkerProcessProxy.cpp:
2316         (WebKit::ServiceWorkerProcessProxy::create):
2317         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2318         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2319         * UIProcess/ServiceWorkerProcessProxy.h:
2320         * UIProcess/Storage/StorageProcessProxy.cpp:
2321         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2322         * UIProcess/WebProcessPool.cpp:
2323         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2324         (WebKit::WebProcessPool::disconnectProcess):
2325         (WebKit::WebProcessPool::updateProcessAssertions):
2326         * UIProcess/WebProcessPool.h:
2327         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2328         (WebKit::WebsiteDataStore::fetchDataAndApply):
2329         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
2330         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
2331         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2332         (WKBundlePageCopyOriginsWithApplicationCache):
2333         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2334         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
2335         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
2336         * WebProcess/Storage/WebSWClientConnection.cpp:
2337         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2338         (WebKit::WebSWClientConnection::matchRegistration):
2339         (WebKit::WebSWClientConnection::whenRegistrationReady):
2340         (WebKit::WebSWClientConnection::getRegistrations):
2341         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2342         (WebKit::WebChromeClient::exceededDatabaseQuota):
2343         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2344         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2345         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2346         * WebProcess/WebProcess.cpp:
2347         (WebKit::WebProcess::fetchWebsiteData):
2348         * WebProcess/WebStorage/StorageAreaImpl.cpp:
2349         (WebKit::StorageAreaImpl::securityOrigin const):
2350         * WebProcess/WebStorage/StorageAreaImpl.h:
2351         * WebProcess/WebStorage/StorageAreaMap.cpp:
2352         (WebKit::StorageAreaMap::StorageAreaMap):
2353         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2354         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2355         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2356         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
2357
2358 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
2359
2360         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
2361         https://bugs.webkit.org/show_bug.cgi?id=183911
2362         <rdar://problem/38762306>
2363
2364         Reviewed by Youenn Fablet.
2365
2366         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
2367         should never call Cookie API directly. That should only happen in the Networking or
2368         UIProcess. 
2369
2370         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
2371         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
2372         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
2373         * NetworkProcess/NetworkProcess.cpp:
2374         (WebKit::NetworkProcess::initializeNetworkProcess):
2375         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2376         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
2377         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2378         (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
2379         (WebKit::NetworkProcess::syncAllCookies):
2380         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2381         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2382         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2383         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2384         * PluginProcess/PluginProcess.cpp:
2385         (WebKit::PluginProcess::initializeProcess):
2386         * Shared/cf/CookieStorageUtilsCF.mm:
2387         (WebKit::cookieStorageFromIdentifyingData):
2388         (WebKit::identifyingDataFromCookieStorage):
2389         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2390         (WebKit::WebProcessPool::platformInitializeWebProcess):
2391         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2392         (WebKit::privateBrowsingSession):
2393         * UIProcess/WebProcessPool.cpp:
2394         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2395         (WebKit::WebsiteDataStore::parameters):
2396         * UIProcess/mac/WebCookieManagerProxyMac.mm:
2397         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
2398         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2399         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2400         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2401         (WebKit::WebFrameLoaderClient::createNetworkingContext):
2402         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2403         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2404         (WebKit::WebFrameNetworkingContext::storageSession const):
2405         * WebProcess/WebProcess.cpp:
2406         (WebKit::WebProcess::initializeProcess):
2407
2408 2018-03-26  Alex Christensen  <achristensen@webkit.org>
2409
2410         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
2411         https://bugs.webkit.org/show_bug.cgi?id=183965
2412
2413         Reviewed by Chris Dumez.
2414
2415         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2416         (WebKit::WebFrameLoaderClient::willCacheResponse const):
2417         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2418
2419 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2420
2421         [GTK][WPE] Add API to convert between DOM and JSCValue
2422         https://bugs.webkit.org/show_bug.cgi?id=183448
2423
2424         Reviewed by Michael Catanzaro.
2425
2426         Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
2427         most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.
2428
2429         * PlatformGTK.cmake:
2430         * PlatformWPE.cmake:
2431         * SourcesGTK.txt:
2432         * SourcesWPE.txt:
2433         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2434         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
2435         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
2436         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
2437         (WebKit::kit):
2438         (WebKit::core):
2439         (WebKit::wrapDocument):
2440         (webkit_dom_document_class_init):
2441         (webkit_dom_document_init):
2442         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
2443         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
2444         (WebKit::kit):
2445         (WebKit::core):
2446         (WebKit::wrapElement):
2447         (webkit_dom_element_class_init):
2448         (webkit_dom_element_init):
2449         (webkit_dom_element_html_input_element_is_user_edited):
2450         (webkit_dom_element_html_input_element_get_auto_filled):
2451         (webkit_dom_element_html_input_element_set_auto_filled):
2452         (webkit_dom_element_html_input_element_set_editing_value):
2453         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
2454         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
2455         (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
2456         (WebKit::kit):
2457         (WebKit::core):
2458         (WebKit::wrapNode):
2459         (webkitDOMNodeConstructor):
2460         (webkitDOMNodeFinalize):
2461         (webkit_dom_node_init):
2462         (webkit_dom_node_class_init):
2463         (webkitDOMNodeSetCoreObject):
2464         (webkitDOMNodeGetCoreObject):
2465         (webkit_dom_node_for_js_value):
2466         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
2467         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
2468         (webkitDOMObjectSetProperty):
2469         (webkit_dom_object_class_init):
2470         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
2471         (WebKit::wrap):
2472         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
2473         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
2474         (webkit_frame_get_js_value_for_dom_object):
2475         (webkit_frame_get_js_value_for_dom_object_in_script_world):
2476         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2477         (webkit_web_page_class_init):
2478         (webkitWebPageCreate):
2479         (webkit_web_page_get_dom_document):
2480         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
2481         (WebKit::GObjectEventListener::handleEvent):
2482         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
2483         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
2484         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
2485         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
2486         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
2487         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
2488         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
2489         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
2490         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
2491         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
2492         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
2493         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
2494         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
2495         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
2496         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
2497         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
2498         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
2499         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
2500         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2501         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
2502         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
2503         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
2504         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
2505         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
2506         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
2507         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
2508         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
2509         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
2510         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
2511         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
2512         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
2513         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
2514         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2515         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
2516         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2517         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
2518         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2519         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
2520         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
2521         (webkitDOMDocumentDOMEventTargetInit):
2522         (webkitDOMDocumentInstallProperties):
2523         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
2524         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
2525         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2526         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
2527         (webkitDOMElementDOMEventTargetInit):
2528         (webkitDOMElementInstallProperties):
2529         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
2530         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
2531         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
2532         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
2533         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
2534         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
2535         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
2536         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
2537         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
2538         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
2539         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
2540         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
2541         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
2542         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
2543         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
2544         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
2545         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
2546         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
2547         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
2548         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
2549         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
2550         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
2551         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
2552         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
2553         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
2554         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
2555         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
2556         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
2557         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
2558         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
2559         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
2560         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
2561         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2562         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
2563         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2564         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
2565         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
2566         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
2567         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
2568         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
2569         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
2570         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
2571         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
2572         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
2573         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2574         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
2575         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2576         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
2577         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2578         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
2579         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2580         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
2581         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2582         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
2583         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2584         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
2585         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2586         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
2587         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2588         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
2589         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2590         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
2591         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2592         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
2593         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2594         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
2595         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2596         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
2597         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2598         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
2599         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2600         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
2601         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2602         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
2603         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2604         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
2605         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2606         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
2607         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2608         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
2609         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2610         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
2611         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2612         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
2613         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2614         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
2615         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2616         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
2617         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
2618         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
2619         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2620         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
2621         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2622         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
2623         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2624         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
2625         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
2626         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2627         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
2628         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2629         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
2630         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2631         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
2632         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2633         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
2634         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2635         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
2636         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2637         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
2638         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2639         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
2640         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2641         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
2642         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2643         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
2644         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2645         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
2646         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2647         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
2648         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2649         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
2650         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2651         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
2652         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
2653         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
2654         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
2655         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
2656         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
2657         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
2658         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2659         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
2660         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
2661         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
2662         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
2663         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
2664         (webkitDOMNodeDOMEventTargetInit):
2665         (webkitDOMNodeInstallProperties):
2666         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2667         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
2668         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
2669         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
2670         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
2671         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
2672         (WebKit::wrapNodeGtk):
2673         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
2674         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2675         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
2676         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2677         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
2678         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
2679         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
2680         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
2681         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
2682         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2683         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
2684         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2685         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
2686         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
2687         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
2688         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
2689         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
2690         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2691         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
2692         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
2693         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
2694         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2695         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
2696         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
2697         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
2698         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
2699         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
2700         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
2701         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
2702         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
2703         * WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
2704         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
2705         * WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
2706         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
2707         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
2708         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
2709         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
2710
2711 2018-03-26  Zan Dobersek  <zdobersek@igalia.com>
2712
2713         [CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
2714         https://bugs.webkit.org/show_bug.cgi?id=184002
2715
2716         Reviewed by Carlos Garcia Campos.
2717
2718         Move the CoordinatedGraphicsScene constant-expression initializations
2719         from constructor to the point of declaration.
2720
2721         Default the CoordinatedGraphicsScene destructor.
2722
2723         The m_scrollPosition member variable is unused in this class, while the
2724         similarly-named m_renderedContentsScrollPosition tracks scroll position
2725         of the scene. Remove the latter and use m_scrollPosition in its place.
2726
2727         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2728         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
2729         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
2730         (WebKit::CoordinatedGraphicsScene::commitSceneState):
2731         (WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
2732         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2733
2734 2018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2735
2736         [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
2737         https://bugs.webkit.org/show_bug.cgi?id=183998
2738
2739         Reviewed by Carlos Garcia Campos.
2740
2741         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
2742
2743 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2744
2745         [GTK] Unresolved type warnings when generating gir
2746         https://bugs.webkit.org/show_bug.cgi?id=183926
2747
2748         Reviewed by Michael Catanzaro.
2749
2750         Skip deprecated functions using JSC C API from introspection.
2751
2752         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
2753         * UIProcess/API/glib/WebKitWebView.cpp:
2754         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
2755
2756 2018-03-25  Commit Queue  <commit-queue@webkit.org>
2757
2758         Unreviewed, rolling out r229954.
2759         https://bugs.webkit.org/show_bug.cgi?id=184000
2760
2761         Caused many layout tests to crash on Apple High Sierra,
2762         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
2763         by dydz on #webkit).
2764
2765         Reverted changeset:
2766
2767         "Use SecurityOriginData more consistently in Service Worker
2768         code"
2769         https://bugs.webkit.org/show_bug.cgi?id=183969
2770         https://trac.webkit.org/changeset/229954
2771
2772 2018-03-23  Brian Burg  <bburg@apple.com>
2773
2774         Web Automation: remove unnecessary member variable WebAutomationSession
2775         https://bugs.webkit.org/show_bug.cgi?id=183971
2776
2777         Reviewed by Timothy Hatcher.
2778
2779         The concept of the "active" browsing context is something in the WebDriver
2780         specification, but we were a bit too literal when first implementing this.
2781         There's no actual need for this on the browser side since most commands
2782         require implicitly switching to the target window passed in with the
2783         Automation command. The driver, however, still needs to track the current
2784         browsing context and current top-level browsing context.
2785
2786         For returning whether a browsing context is active,  we can just look at
2787         the page's activity state to know whether the page is active or not. For
2788         a normal browser, only one page is going to be visible and focused at a time.
2789
2790         * UIProcess/Automation/WebAutomationSession.h:
2791         * UIProcess/Automation/WebAutomationSession.cpp:
2792         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
2793         Consult the page's activity state to determine whether it's active.
2794
2795         (WebKit::WebAutomationSession::createBrowsingContext):
2796         (WebKit::WebAutomationSession::closeBrowsingContext):
2797         (WebKit::WebAutomationSession::switchToBrowsingContext):
2798         (WebKit::WebAutomationSession::handleRunOpenPanel):
2799         Stop reading and writing the current browsing context handle.
2800
2801         * UIProcess/WebPageProxy.h:
2802         (WebKit::WebPageProxy::isViewFocused const):
2803         (WebKit::WebPageProxy::isViewWindowActive const):
2804         Add new accessor.
2805
2806 2018-03-25  Tim Horton  <timothy_horton@apple.com>
2807
2808         Add and adopt ENABLE(AIRPLAY_PICKER)
2809         https://bugs.webkit.org/show_bug.cgi?id=183992
2810
2811         Reviewed by Daniel Bates.
2812
2813         * UIProcess/ios/WKContentViewInteraction.h:
2814         * UIProcess/ios/WKContentViewInteraction.mm:
2815         (-[WKContentView _showPlaybackTargetPicker:fromRect:]):
2816         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2817         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2818
2819 2018-03-25  Tim Horton  <timothy_horton@apple.com>
2820
2821         Move WKAnimationDelegate to its own header
2822         https://bugs.webkit.org/show_bug.cgi?id=183976
2823         <rdar://problem/38822299>
2824
2825         Reviewed by Dan Bernstein.
2826
2827         * Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
2828         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2829         * WebKit.xcodeproj/project.pbxproj:
2830         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2831         RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
2832         so we're just getting lucky that an -invalidate method exists on
2833         some other object. Instead, move WKAnimationDelegate to its own
2834         header, and include it in the places we use it.
2835
2836 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2837
2838         Adopt WK_PLATFORM_NAME in WebKit
2839         https://bugs.webkit.org/show_bug.cgi?id=183978
2840
2841         Reviewed by Dan Bernstein.
2842
2843         * Configurations/WebKit.xcconfig:
2844         * WebKit.xcodeproj/project.pbxproj:
2845         * mac/MigrateHeadersFromWebKitLegacy.make:
2846         * mac/postprocess-framework-headers.sh:
2847
2848 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2849
2850         Ignore sandbox_init_with_parameters deprecation warnings
2851         https://bugs.webkit.org/show_bug.cgi?id=183979
2852
2853         Reviewed by Dan Bernstein.
2854
2855         * Shared/ios/ChildProcessIOS.mm:
2856         (WebKit::ChildProcess::initializeSandbox):
2857
2858 2018-03-24  Chris Dumez  <cdumez@apple.com>
2859
2860         Use SecurityOriginData more consistently in Service Worker code
2861         https://bugs.webkit.org/show_bug.cgi?id=183969
2862
2863         Reviewed by Darin Adler.
2864
2865         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
2866         SecurityOrigin objects unnecessarily.
2867
2868         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2869         (WebKit::NetworkResourceLoadParameters::encode const):
2870         * Shared/API/c/WKSecurityOriginRef.cpp:
2871         (WKSecurityOriginCopyDatabaseIdentifier):
2872         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2873         (WebKit::WebSWOriginStore::addToStore):
2874         (WebKit::WebSWOriginStore::removeFromStore):
2875         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2876         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2877         (WebKit::WebSWServerConnection::scheduleJobInServer):
2878         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2879         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2880         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2881         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2882         * StorageProcess/StorageProcess.cpp:
2883         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2884         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2885         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2886         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2887         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2888         (WebKit::StorageProcess::createServerToContextConnection):
2889         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
2890         * StorageProcess/StorageProcess.h:
2891         * UIProcess/API/APIFrameInfo.cpp:
2892         (API::FrameInfo::create):
2893         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2894         (WKApplicationCacheManagerDeleteEntriesForOrigin):
2895         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2896         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
2897         * UIProcess/API/C/WKResourceCacheManager.cpp:
2898         (WKResourceCacheManagerClearCacheForOrigin):
2899         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2900         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
2901         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
2902         * UIProcess/ServiceWorkerProcessProxy.cpp:
2903         (WebKit::ServiceWorkerProcessProxy::create):
2904         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2905         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2906         * UIProcess/ServiceWorkerProcessProxy.h:
2907         * UIProcess/Storage/StorageProcessProxy.cpp:
2908         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2909         * UIProcess/WebProcessPool.cpp:
2910         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2911         (WebKit::WebProcessPool::disconnectProcess):
2912         (WebKit::WebProcessPool::updateProcessAssertions):
2913         * UIProcess/WebProcessPool.h:
2914         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2915         (WebKit::WebsiteDataStore::fetchDataAndApply):
2916         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
2917         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
2918         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2919         (WKBundlePageCopyOriginsWithApplicationCache):
2920         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2921         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
2922         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
2923         * WebProcess/Storage/WebSWClientConnection.cpp:
2924         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2925         (WebKit::WebSWClientConnection::matchRegistration):
2926         (WebKit::WebSWClientConnection::whenRegistrationReady):
2927         (WebKit::WebSWClientConnection::getRegistrations):
2928         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2929         (WebKit::WebChromeClient::exceededDatabaseQuota):
2930         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2931         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2932         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2933         * WebProcess/WebProcess.cpp:
2934         (WebKit::WebProcess::fetchWebsiteData):
2935         * WebProcess/WebStorage/StorageAreaImpl.cpp:
2936         (WebKit::StorageAreaImpl::securityOrigin const):
2937         * WebProcess/WebStorage/StorageAreaImpl.h:
2938         * WebProcess/WebStorage/StorageAreaMap.cpp:
2939         (WebKit::StorageAreaMap::StorageAreaMap):
2940         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2941         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2942         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2943         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
2944
2945 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2946
2947         Fix the !ENABLE(MEDIA_STREAM) build
2948         https://bugs.webkit.org/show_bug.cgi?id=183977
2949
2950         Reviewed by Wenson Hsieh.
2951
2952         * UIProcess/Cocoa/UIDelegate.mm:
2953         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2954         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2955         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2956         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2957
2958 2018-03-24  Tim Horton  <timothy_horton@apple.com>
2959
2960         WKFileUploadPanel shouldn't depend on WebKitLegacy
2961         https://bugs.webkit.org/show_bug.cgi?id=183981
2962
2963         Reviewed by Wenson Hsieh.
2964
2965         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2966         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
2967         Just use the underlying WebCore function instead of the
2968         unnecessary NSFileManager category method.
2969
2970 2018-03-23  Tim Horton  <timothy_horton@apple.com>
2971
2972         Fix the build with no pasteboard
2973         https://bugs.webkit.org/show_bug.cgi?id=183973
2974
2975         Reviewed by Dan Bernstein.
2976
2977         * Configurations/FeatureDefines.xcconfig:
2978
2979 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
2980
2981         Enable unified text selection in select cases for gradual testing
2982         https://bugs.webkit.org/show_bug.cgi?id=183967
2983         <rdar://problem/38815328>
2984
2985         Reviewed by Tim Horton.
2986         
2987         Enable in select places for a more gradual switch, as this is a big change and we want to make sure
2988         it works before switching completely.
2989
2990         * UIProcess/ios/WKContentViewInteraction.mm:
2991         (-[WKContentView useSelectionAssistantWithGranularity:]):
2992
2993 2018-03-23  John Wilander  <wilander@apple.com>
2994
2995         Resource Load Statistics: Pick up ITP debug mode flag from defaults
2996         https://bugs.webkit.org/show_bug.cgi?id=183956
2997         <rdar://problem/38559574>
2998
2999         Reviewed by Brent Fulgham.
3000
3001         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3002         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3003
3004 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3005
3006         [Extra zoom mode] Adopt list view controller UI for select menus
3007         https://bugs.webkit.org/show_bug.cgi?id=183944
3008         <rdar://problem/38799062>
3009
3010         Reviewed by Tim Horton.
3011
3012         Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.
3013
3014         * UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
3015         * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
3016         * WebKit.xcodeproj/project.pbxproj:
3017
3018 2018-03-23  Chris Dumez  <cdumez@apple.com>
3019
3020         Promptly terminate service worker processes when they are no longer needed
3021         https://bugs.webkit.org/show_bug.cgi?id=183873
3022         <rdar://problem/38676995>
3023
3024         Reviewed by Youenn Fablet.
3025
3026         The StorageProcess now keeps track of service worker clients for each security
3027         origin. When there is no longer any clients for a given security origin, the
3028         StorageProcess asks the service worker process for the given origin to terminate
3029         and severs its connection to it.
3030
3031         * Shared/Storage/StorageProcessCreationParameters.h:
3032         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3033         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
3034         (WebKit::WebSWServerToContextConnection::terminate):
3035         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3036         * StorageProcess/StorageProcess.cpp:
3037         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
3038         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
3039         (WebKit::StorageProcess::initializeWebsiteDataStore):
3040         (WebKit::StorageProcess::swServerForSession):
3041         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
3042         (WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
3043         * StorageProcess/StorageProcess.h:
3044         * StorageProcess/StorageProcess.messages.in:
3045         * UIProcess/API/Cocoa/WKProcessPool.mm:
3046         (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
3047         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3048         * UIProcess/WebProcessPool.cpp:
3049         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
3050         (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
3051         * UIProcess/WebProcessPool.h:
3052         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3053         (WebKit::WebSWContextManagerConnection::terminateProcess):
3054         * WebProcess/Storage/WebSWContextManagerConnection.h:
3055         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3056
3057 2018-03-23  Brady Eidson  <beidson@apple.com>
3058
3059         Go to back/forward list items after a process-swapped navigation.
3060         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
3061
3062         Reviewed by Andy Estes.
3063
3064         This takes the initial work of "process swap a normal navigation" and extends it to
3065         process swapping for back/forward item navigations.
3066
3067         * Scripts/webkit/messages.py:
3068
3069         Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
3070         they will be lost in process-swap scenarios:
3071         * Shared/SessionState.cpp:
3072         (WebKit::PageState::encode const):
3073         (WebKit::PageState::decode):
3074         * Shared/SessionState.h:
3075
3076         Make a new variant of APINavigation specifically for back/forward list items.
3077         * UIProcess/API/APINavigation.cpp:
3078         (API::Navigation::Navigation):
3079         (API::Navigation::loggingURL const):
3080         * UIProcess/API/APINavigation.h:
3081         (API::Navigation::create):
3082         (API::Navigation::backForwardListItem):
3083         (API::Navigation::backForwardFrameLoadType const):
3084
3085         * UIProcess/API/C/WKPage.cpp:
3086         (WKPageGoToBackForwardListItem):
3087
3088         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3089         (-[WKBrowsingContextController goToBackForwardListItem:]):
3090
3091         * UIProcess/API/Cocoa/WKWebView.mm:
3092         (-[WKWebView goToBackForwardListItem:]):
3093
3094         * UIProcess/WebNavigationState.cpp:
3095         (WebKit::WebNavigationState::createLoadRequestNavigation):
3096         (WebKit::WebNavigationState::createBackForwardNavigation):
3097         * UIProcess/WebNavigationState.h:
3098
3099         * UIProcess/WebPageProxy.cpp:
3100         (WebKit::WebPageProxy::reattachToWebProcessForReload):
3101         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3102         (WebKit::WebPageProxy::goForward):
3103         (WebKit::WebPageProxy::goBack):
3104         (WebKit::WebPageProxy::goToBackForwardItem):
3105         (WebKit::WebPageProxy::receivedPolicyDecision):
3106         (WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
3107         (WebKit::WebPageProxy::restoreFromSessionState):
3108         * UIProcess/WebPageProxy.h:
3109
3110         * UIProcess/WebProcessProxy.cpp:
3111         (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
3112         (WebKit::WebProcessProxy::addBackForwardItem): Deleted.
3113         * UIProcess/WebProcessProxy.h:
3114         * UIProcess/WebProcessProxy.messages.in:
3115
3116         * UIProcess/ios/ViewGestureControllerIOS.mm:
3117         (WebKit::ViewGestureController::endSwipeGesture):
3118
3119         * UIProcess/mac/ViewGestureControllerMac.mm:
3120         (WebKit::ViewGestureController::endSwipeGesture):
3121
3122         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3123         (WebKit::toPageState):
3124         (WebKit::toHistoryItem):
3125
3126         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3127         (WebKit::updateBackForwardItem):
3128
3129         * WebProcess/WebPage/WebPage.cpp:
3130         (WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
3131           passing the appropriate FrameLoadType around as needed to remember the specific type.
3132         (WebKit::WebPage::goForward): Deleted.
3133         (WebKit::WebPage::goBack): Deleted.
3134         * WebProcess/WebPage/WebPage.h:
3135         * WebProcess/WebPage/WebPage.messages.in:
3136
3137 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
3138
3139         Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
3140         https://bugs.webkit.org/show_bug.cgi?id=183804
3141
3142         Reviewed by Tim Horton.
3143
3144         We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
3145         or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to 
3146         be more direct in checking what we actually need to know i.e. are we selecting in a content editable.
3147
3148         * Platform/spi/ios/UIKitSPI.h:
3149         * UIProcess/ios/WKContentViewInteraction.mm:
3150         (hasAssistedNode):
3151         (-[WKContentView inputView]):
3152         (-[WKContentView _selectionClipRect]):
3153         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
3154         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3155         (-[WKContentView gestureRecognizerShouldBegin:]):
3156         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3157         (-[WKContentView webSelectionRects]):
3158         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3159         (-[WKContentView _autofillContext]):
3160
3161 2018-03-23  Youenn Fablet  <youenn@apple.com>
3162
3163         WebProcessPool should not ask to register all clients for each service worker process creation
3164         https://bugs.webkit.org/show_bug.cgi?id=183941
3165
3166         Reviewed by Chris Dumez.
3167
3168         Call registerServiceWorkerClients when there is no service worker process.
3169         Update service worker clients to register all of them no matter the session ID.
3170
3171         * UIProcess/WebProcessPool.cpp:
3172         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
3173         * WebProcess/WebProcess.cpp:
3174         (WebKit::WebProcess::registerServiceWorkerClients):
3175         * WebProcess/WebProcess.h:
3176         * WebProcess/WebProcess.messages.in:
3177
3178 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3179
3180         [Extra zoom mode] Adopt list view controller UI for select menus
3181         https://bugs.webkit.org/show_bug.cgi?id=183944
3182         <rdar://problem/38799062>
3183
3184         Reviewed by Andy Estes.
3185
3186         Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
3187         WebKitAdditions harness files. See corresponding changes for more details.
3188
3189         * UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
3190         * UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
3191         * UIProcess/ios/WKContentViewInteraction.h:
3192         * UIProcess/ios/WKContentViewInteraction.mm:
3193         (-[WKContentView presentSelectMenuViewController:]):
3194         (-[WKContentView dismissSelectMenuViewController:]):
3195         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
3196         (-[WKContentView numberOfItemsInSelectMenu:]):
3197         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
3198         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
3199         (-[WKContentView selectMenuUsesMultipleSelection:]):
3200         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
3201         (-[WKContentView _wheelChangedWithEvent:]):
3202
3203         Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
3204         handling for select menus here.
3205
3206         (-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
3207         (-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
3208         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
3209         (-[WKContentView startingIndexForSelectMenu:]): Deleted.
3210
3211         The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
3212         just remove this delegate hook altogether.
3213
3214         * WebKit.xcodeproj/project.pbxproj:
3215
3216 2018-03-23  Youenn Fablet  <youenn@apple.com>
3217
3218         CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
3219         https://bugs.webkit.org/show_bug.cgi?id=183945
3220
3221         Reviewed by Chris Dumez.
3222
3223         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3224         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3225         In case we clear Caches in the middle of the initialization, m_caches might not be empty
3226         but m_isInitialized is not yet set to true since we are computing the Caches size.
3227         Update the assertion and clear m_caches in that case.
3228
3229 2018-03-23  David Kilzer  <ddkilzer@apple.com>
3230
3231         Stop using dispatch_set_target_queue()
3232         <https://webkit.org/b/183908>
3233         <rdar://problem/33553533>
3234
3235         Reviewed by Daniel Bates.
3236
3237         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
3238         (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
3239         dispatch_set_target_queue() since this is handled in the
3240         dispatch_io_create() call above.
3241
3242 2018-03-23  Youenn Fablet  <youenn@apple.com>
3243
3244         CacheStorage::Engine should not ref itself when hopping to a background thread
3245         https://bugs.webkit.org/show_bug.cgi?id=183925
3246         <rdar://problem/38580483>
3247
3248         Reviewed by Chris Dumez.
3249
3250         Add support for weak pointers to CacheStorage Engine.
3251         Use weak pointer when hopping to background threads.
3252         Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
3253         Made some callbacks CompletionHandler as a bonus.
3254
3255         Made sure to use just one Engine for all private sessions.
3256
3257         * NetworkProcess/cache/CacheStorageEngine.cpp:
3258         (WebKit::CacheStorage::Engine::~Engine):
3259         (WebKit::CacheStorage::Engine::from):
3260         (WebKit::CacheStorage::Engine::initialize):
3261         (WebKit::CacheStorage::Engine::writeFile):
3262         (WebKit::CacheStorage::Engine::readFile):
3263         * NetworkProcess/cache/CacheStorageEngine.h:
3264         (WebKit::CacheStorage::Engine::weakPtrFactory):
3265
3266 2018-03-23  Ryan Haddad  <ryanhaddad@apple.com>
3267
3268         Unreviewed build fix.
3269
3270         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3271
3272 2018-03-23  Miguel Gomez  <magomez@igalia.com>
3273
3274         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
3275         https://bugs.webkit.org/show_bug.cgi?id=183892
3276
3277         Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
3278
3279         Reviewed by Žan Doberšek.
3280
3281         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3282         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
3283
3284 2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3285
3286         [WPE][GTK] Fix -Wswitch warnings after r229778
3287         https://bugs.webkit.org/show_bug.cgi?id=183927
3288
3289         Reviewed by Carlos Garcia Campos.
3290
3291         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3292         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
3293         received as a PolicyAction
3294         * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
3295         which should be invisible to WebKit clients
3296
3297 2018-03-22  Chris Dumez  <cdumez@apple.com>
3298
3299         Include security origin in the service worker process name
3300         https://bugs.webkit.org/show_bug.cgi?id=183913
3301
3302         Reviewed by Youenn Fablet.
3303
3304         Include security origin in the service worker process name to facilitate debugging. This way, we
3305         can differentiate which service worker process is used for which origin in activity monitor.
3306
3307         * Shared/ChildProcess.h:
3308         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3309         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
3310         * UIProcess/ServiceWorkerProcessProxy.cpp:
3311         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
3312         * WebProcess/cocoa/WebProcessCocoa.mm:
3313         (WebKit::WebProcess::initializeProcessName):
3314
3315 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3316
3317         Unreviewed, silence unused variable warning
3318
3319         * UIProcess/WebPageProxy.cpp:
3320         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3321
3322 2018-03-22  Dan Bernstein  <mitz@apple.com>
3323
3324         WKWebView doesn’t expose its spellCheckerDocumentTag
3325         https://bugs.webkit.org/show_bug.cgi?id=183797
3326         <rdar://problem/38678089>
3327
3328         Reviewed by Tim Horton.
3329
3330         * UIProcess/API/Cocoa/WKWebView.mm:
3331         (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
3332         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.
3333
3334 2018-03-22  Chris Dumez  <cdumez@apple.com>
3335
3336         Use the same SWServer for all ephemeral sessions
3337         https://bugs.webkit.org/show_bug.cgi?id=183921
3338         <rdar://problem/36873075>
3339
3340         Reviewed by Youenn Fablet.
3341
3342         Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
3343         one per sessionID. When browsing doing private browsing in Safari (and other fetching
3344         favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
3345         constructing new SWServers that would never go away. Each SWServer has a thread so we
3346         would eventually hit the thread limit for the storage process.
3347
3348         * StorageProcess/StorageProcess.cpp:
3349         (WebKit::StorageProcess::swServerForSession):
3350
3351 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3352
3353         Unreviewed, fix format string warnings in service worker code
3354
3355         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
3356
3357         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3358         (WebKit::WebSWServerConnection::startFetch):
3359         (WebKit::WebSWServerConnection::didFinishFetch):
3360         (WebKit::WebSWServerConnection::didFailFetch):
3361         (WebKit::WebSWServerConnection::didNotHandleFetch):
3362
3363 2018-03-22  Daniel Bates  <dabates@apple.com>
3364
3365         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
3366         https://bugs.webkit.org/show_bug.cgi?id=183907
3367         <rdar://problem/38759127>
3368
3369         Reviewed by Alex Christensen.
3370
3371         Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
3372         whose content should be displayed/loaded if and only if it can be requested. Disregarding an
3373         app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
3374         content for the registered schemes.
3375
3376         We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
3377         C API/SPI.
3378
3379         * Shared/WebProcessCreationParameters.cpp:
3380         (WebKit::WebProcessCreationParameters::encode const):
3381         (WebKit::WebProcessCreationParameters::decode):
3382         * Shared/WebProcessCreationParameters.h:
3383         * UIProcess/API/C/WKContext.cpp:
3384         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
3385         * UIProcess/API/C/WKContextPrivate.h:
3386         * UIProcess/API/Cocoa/WKProcessPool.mm:
3387         (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
3388         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3389         * UIProcess/WebProcessPool.cpp:
3390         (WebKit::WebProcessPool::initializeNewWebProcess):
3391         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
3392         * UIProcess/WebProcessPool.h:
3393         * WebProcess/WebProcess.cpp:
3394         (WebKit::WebProcess::initializeWebProcess):
3395         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
3396         * WebProcess/WebProcess.h:
3397         * WebProcess/WebProcess.messages.in:
3398
3399 2018-03-22  Tim Horton  <timothy_horton@apple.com>
3400
3401         Improve readability of WebCore's OTHER_LDFLAGS
3402         https://bugs.webkit.org/show_bug.cgi?id=183909