61354a3af6e5cbae1fa8ef82b81073794a067cff
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices
4         https://bugs.webkit.org/show_bug.cgi?id=178640
5         <rdar://problem/35113105>
6
7         Reviewed by Youenn Fablet.
8
9         In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the
10         shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance
11         hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work
12         lazily, the first time the web process requests permissions for user media access.
13
14         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
15         (WebKit::WebUserMediaClient::requestUserMediaAccess):
16         * WebProcess/WebPage/WebPage.cpp:
17         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
18         * WebProcess/WebPage/WebPage.h:
19         * WebProcess/WebPage/ios/WebPageIOS.mm:
20         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
21         * WebProcess/cocoa/WebProcessCocoa.mm:
22         (WebKit::WebProcess::platformInitializeWebProcess):
23
24 2017-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
25
26         Unreviewed, silence a -Wunused-but-set-variable warning
27
28         * WebProcess/WebPage/EventDispatcher.cpp:
29         (WebKit::EventDispatcher::wheelEvent):
30
31 2017-10-20  Alex Christensen  <achristensen@webkit.org>
32
33         Add FIXME comment after r223803
34         https://bugs.webkit.org/show_bug.cgi?id=178418
35
36         * UIProcess/WebProcessPool.cpp:
37         (WebKit::WebProcessPool::ensureNetworkProcess):
38         We need some work to better support customized persistent data stores.  Add a comment indicating such.
39
40 2017-10-20  Alex Christensen  <achristensen@webkit.org>
41
42         Fix API tests after r223791.
43         https://bugs.webkit.org/show_bug.cgi?id=178418
44
45         * UIProcess/WebProcessPool.cpp:
46         (WebKit::WebProcessPool::ensureNetworkProcess):
47         Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message,
48         that's the default session.  This is needed for WebKit.WebsiteDataStoreCustomPaths.
49         (WebKit::WebProcessPool::createNewWebProcess):
50         Don't change behavior or NetworkProcess initialization like I did in r223791.
51
52 2017-10-20  Alex Christensen  <achristensen@webkit.org>
53
54         Fix download tests on El Capitan after r223730
55         https://bugs.webkit.org/show_bug.cgi?id=178547
56
57         * UIProcess/Downloads/DownloadProxy.cpp:
58         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
59         Revert to original behavior.  This uses suggestedFilename, which may have come from places like
60         the download attribute, instead of always using the filename from CFNetwork.
61
62 2017-10-20  Alex Christensen  <achristensen@webkit.org>
63
64         Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate
65         https://bugs.webkit.org/show_bug.cgi?id=178418
66         <rdar://problem/29599569>
67
68         Reviewed by Tim Horton.
69         
70         In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there
71         was no way to add parameters to the default (and other) NetworkSession constructors.  Since
72         clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters
73         and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties
74         ought to be instead of making them WKProcessPool global.
75
76         We also need to expose access to NSURLRequest.boundInterfaceIdentifier.  Instead of serializing and
77         deserializing that property for each NSURLRequest and then having subresources mysteriously jump back
78         to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a
79         session networking property.
80         
81         I manually verified that these properties are being set properly with a custom test app and added logs.
82         Unfortunately, these properties don't do anything under circumstances anywhere close to what we test.
83         The architecture change of having NetworkSessionCreationParameters is verified to not have a change in
84         behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove).
85
86         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
87         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
88         * NetworkProcess/NetworkProcess.cpp:
89         (WebKit::NetworkProcess::NetworkProcess):
90         (WebKit::NetworkProcess::initializeNetworkProcess):
91         (WebKit::NetworkProcess::clearCachedCredentials):
92         * NetworkProcess/NetworkProcessCreationParameters.cpp:
93         (WebKit::NetworkProcessCreationParameters::encode const):
94         (WebKit::NetworkProcessCreationParameters::decode):
95         * NetworkProcess/NetworkProcessCreationParameters.h:
96         * NetworkProcess/NetworkSession.cpp:
97         (WebKit::NetworkSession::create):
98         (WebKit::NetworkSession::defaultSession): Deleted.
99         * NetworkProcess/NetworkSession.h:
100         * NetworkProcess/NetworkSessionCreationParameters.h: Added.
101         (WebKit::NetworkSessionCreationParameters::encode const):
102         (WebKit::NetworkSessionCreationParameters::decode):
103         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
104         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
105         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
106         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
107         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
108         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
109         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
110         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
111         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
112         (WebKit::NetworkSessionCocoa::create):
113         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
114         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted.
115         (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted.
116         (WebKit::NetworkSessionCocoa::defaultSession): Deleted.
117         * NetworkProcess/mac/RemoteNetworkingContext.mm:
118         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
119         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
120         * Shared/SessionTracker.cpp:
121         (WebKit::SessionTracker::networkSession):
122         (WebKit::SessionTracker::setSession):
123         * Shared/WebsiteDataStoreParameters.cpp:
124         (WebKit::WebsiteDataStoreParameters::encode const):
125         (WebKit::WebsiteDataStoreParameters::decode):
126         * Shared/WebsiteDataStoreParameters.h:
127         * UIProcess/API/APIProcessPoolConfiguration.cpp:
128         (API::ProcessPoolConfiguration::copy):
129         * UIProcess/API/APIProcessPoolConfiguration.h:
130         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
131         (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
132         (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
133         (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
134         (-[WKWebsiteDataStore _allowsCellularAccess]):
135         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
136         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
137         (-[_WKProcessPoolConfiguration allowsCellularAccess]):
138         (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):
139         * UIProcess/WebProcessPool.cpp:
140         (WebKit::WebProcessPool::ensureNetworkProcess):
141         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
142         * UIProcess/WebsiteData/WebsiteDataStore.h:
143         (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
144         (WebKit::WebsiteDataStore::boundInterfaceIdentifier):
145         (WebKit::WebsiteDataStore::setAllowsCellularAccess):
146         (WebKit::WebsiteDataStore::allowsCellularAccess):
147         * WebKit.xcodeproj/project.pbxproj:
148         * WebProcess/InjectedBundle/InjectedBundle.cpp:
149         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
150         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
151         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
152         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
153         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
154         * WebProcess/WebProcess.cpp:
155         (WebKit::WebProcess::ensurePrivateBrowsingSession):
156         (WebKit::WebProcess::clearCachedCredentials):
157
158 2017-10-20  Alex Christensen  <achristensen@webkit.org>
159
160         Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient
161         https://bugs.webkit.org/show_bug.cgi?id=178566
162         <rdar://problem/23041906>
163
164         Reviewed by Brady Eidson.
165
166         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
167         * UIProcess/Cocoa/DownloadClient.h:
168         * UIProcess/Cocoa/DownloadClient.mm:
169         (WebKit::DownloadClient::DownloadClient):
170         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
171         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType):
172         (WebKit::DownloadClient::didCreateDestination):
173         (WebKit::DownloadClient::processDidCrash):
174
175 2017-10-20  Youenn Fablet  <youenn@apple.com>
176
177         ResourceResponse should have a ServiceWorker source
178         https://bugs.webkit.org/show_bug.cgi?id=178593
179
180         Reviewed by Alex Christensen.
181
182         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
183         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker.
184         * WebProcess/Storage/ServiceWorkerClientFetch.h:
185
186 2017-10-20  Antoine Quint  <graouts@apple.com>
187
188         [Web Animations] Provide basic timeline and animation interfaces
189         https://bugs.webkit.org/show_bug.cgi?id=178526
190
191         Reviewed by Dean Jackson.
192
193         Remove the WEB_ANIMATIONS compile-time flag.
194
195         * Configurations/FeatureDefines.xcconfig:
196         * WebProcess/InjectedBundle/InjectedBundle.cpp:
197         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
198         (WebKit::InjectedBundle::setWebAnimationsEnabled):
199         * WebProcess/WebPage/WebPage.cpp:
200         (WebKit::WebPage::updatePreferences):
201
202 2017-10-02  Brian Burg  <bburg@apple.com>
203
204         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
205         https://bugs.webkit.org/show_bug.cgi?id=177661
206         <rdar://problem/34740286>
207
208         Reviewed by Joseph Pecoraro.
209
210         Move setup and delegates of the inspector frontend page into implementations of
211         WebInspectorProxy::platformCreateFrontendPage. The Mac implementation
212         will be subsumed by WKInspectorViewController, while the GTK implementation
213         is inherited from the cross-platform version that uses C API. Eventually the
214         GTK version should use GTK API rather than the soon to be deprecated C API.
215
216         * UIProcess/WebInspectorProxy.cpp:
217         (WebKit::WebInspectorProxy::createFrontendPage):
218         (WebKit::webProcessDidCrash): Deleted.
219         (WebKit::decidePolicyForNavigationAction): Deleted.
220         (WebKit::getContextMenuFromProposedMenu): Deleted.
221         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
222         (WebKit::exceededDatabaseQuota):
223         (WebKit::webProcessDidCrash):
224         (WebKit::decidePolicyForNavigationAction):
225         (WebKit::getContextMenuFromProposedMenu):
226         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
227         * UIProcess/mac/WebInspectorProxyMac.mm:
228         (WebKit::exceededDatabaseQuota):
229         (WebKit::webProcessDidCrash):
230         (WebKit::decidePolicyForNavigationAction):
231         (WebKit::getContextMenuFromProposedMenu):
232         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
233
234 2017-10-02  Brian Burg  <bburg@apple.com>
235
236         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
237         https://bugs.webkit.org/show_bug.cgi?id=177661
238         <rdar://problem/34740286>
239
240         Reviewed by Joseph Pecoraro.
241
242         Adopt WKInspectorViewController in WebInspectorProxyMac to set up the
243         frontend's web view.
244
245         * UIProcess/WebInspectorProxy.cpp:
246         (WebKit::WebInspectorProxy::invalidate):
247         (WebKit::WebInspectorProxy::close):
248         (WebKit::WebInspectorProxy::didClose):
249         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
250         Make closeFrontendPageAndWindow into the method that does work.
251         Only use didClose() as the IPC message entry point.
252
253         * UIProcess/WebInspectorProxy.h:
254         (WebKit::WebInspectorProxy::isUnderTest const): Make public.
255
256         * UIProcess/mac/WKInspectorViewController.h:
257         * UIProcess/mac/WKInspectorViewController.mm:
258         (+[WKInspectorViewController viewIsInspectorWebView:]):
259         Abstract away the -isInstanceOfClass: check for WKInspectorWKWebView.
260         Clients shouldn't need to know whether we use a subclass or what its name is.
261
262         * UIProcess/mac/WebInspectorProxyMac.mm:
263         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
264         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
265         Hook up view controller delegates.
266
267         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
268         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
269         (WebKit::WebInspectorProxy::closeFrontendPage):
270         New implementation based on the view controller.
271
272         (WebKit::WebInspectorProxy::platformBringToFront):
273         (WebKit::WebInspectorProxy::platformIsFront):
274         (WebKit::WebInspectorProxy::platformCanAttach):
275         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
276         (WebKit::WebInspectorProxy::platformAttach):
277         (WebKit::WebInspectorProxy::platformDetach):
278         (WebKit::WebInspectorProxy::platformStartWindowDrag):
279         Adjust to get the WKWebView out of the view controller for code that needs
280         to do something with the NSView, such as get/set the frame.
281
282         (WebKit::WebInspectorProxy::createFrontendConfiguration): Deleted.
283         (WebKit::exceededDatabaseQuota): Deleted.
284         (WebKit::webProcessDidCrash): Deleted.
285         (WebKit::decidePolicyForNavigationAction): Deleted.
286         (WebKit::getContextMenuFromProposedMenu): Deleted.
287
288 2017-10-02  Brian Burg  <bburg@apple.com>
289
290         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
291         https://bugs.webkit.org/show_bug.cgi?id=177661
292         <rdar://problem/34740286>
293
294         Reviewed by Joseph Pecoraro.
295
296         Introduce new platform methods to open and close the frontend page and window.
297         This matches how RemoteWebInspectorProxy divides work up into platform methods.
298         Move existing code from platformDidClose, platformOpen, and other methods into
299         the new platform methods. Move some identical platform code into WebInspectorProxy.cpp.
300
301         * UIProcess/WebInspectorProxy.h:
302         * UIProcess/WebInspectorProxy.cpp:
303         (WebKit::WebInspectorProxy::connect):
304         (WebKit::WebInspectorProxy::showConsole):
305         (WebKit::WebInspectorProxy::showResources):
306         (WebKit::WebInspectorProxy::showTimelines):
307         (WebKit::WebInspectorProxy::showMainResourceForFrame):
308         (WebKit::WebInspectorProxy::createFrontendPage):
309         (WebKit::WebInspectorProxy::createInspectorPage):
310         (WebKit::WebInspectorProxy::open):
311         (WebKit::WebInspectorProxy::didClose):
312         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed.
313
314         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
315         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
316         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
317         Do everything necessary to set up the frontend page WebView.
318
319         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
320         Do everything necessary to set up the detached NSWindow for the frontend.
321
322         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
323         (WebKit::WebInspectorProxy::platformDetach):
324         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
325         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
326         (WebKit::WebInspectorProxy::platformOpen): Deleted.
327         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
328
329         * UIProcess/mac/WebInspectorProxyMac.mm:
330         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
331         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Added.
332         Do everything necessary to set up the frontend page WebView.
333
334         (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added.
335         Do everything necessary to set up the detached NSWindow for the frontend.
336
337         (WebKit::WebInspectorProxy::closeFrontendPage):
338         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
339         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
340         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
341         (WebKit::WebInspectorProxy::platformInvalidate):
342         (WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings.
343
344         (WebKit::WebInspectorProxy::platformDetach):
345         Defer to the general open() method to create a window if needed and bring it to front.
346
347         (WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code.
348
349         (WebKit::WebInspectorProxy::closeFrontend): Deleted.
350         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
351         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
352         (WebKit::WebInspectorProxy::platformOpen): Deleted.
353         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
354         Defer to the general open() method to create a window if needed and bring it to front.
355
356         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
357         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
358         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
359         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
360         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
361         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
362         (WebKit::WebInspectorProxy::platformOpen): Deleted.
363         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
364         Update stubs.
365
366 2017-10-02  Brian Burg  <bburg@apple.com>
367
368         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
369         https://bugs.webkit.org/show_bug.cgi?id=177661
370         <rdar://problem/34740286>
371
372         Reviewed by Joseph Pecoraro.
373
374         This patch refactors some Cocoa code pathas.
375         Rename the timer that closes the WebView so it's more obvious what it is for.
376         Extract the common code to close the frontend window so its not implemented by
377         the timer callback.
378
379         In later patches, this will be extracted further into platform methods to open/close
380         the frontend and window, like how it is for RemoteWebInspectorProxy.
381
382         * UIProcess/WebInspectorProxy.cpp:
383         (WebKit::WebInspectorProxy::WebInspectorProxy):
384         * UIProcess/WebInspectorProxy.h:
385         * UIProcess/mac/WebInspectorProxyMac.mm:
386         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
387         (WebKit::WebInspectorProxy::closeFrontend):
388         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
389         (WebKit::WebInspectorProxy::platformDidClose):
390         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
391         (WebKit::WebInspectorProxy::platformInvalidate):
392         (WebKit::WebInspectorProxy::closeTimerFired): Deleted.
393
394 2017-09-30  Brian Burg  <bburg@apple.com>
395
396         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
397         https://bugs.webkit.org/show_bug.cgi?id=177661
398         <rdar://problem/34740286>
399
400         Reviewed by Joseph Pecoraro.
401
402         Modernize the ObjC adapter and related code a bit before it is hooked
403         into WKInspectorViewController.
404
405         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the
406         ivar to be declared here, move to @implementation.
407
408         * UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention.
409
410         * UIProcess/mac/WebInspectorProxyMac.mm:
411         (-[WKWebInspectorProxyObjCAdapter inspectorRef]):
412         (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
413         (-[WKWebInspectorProxyObjCAdapter invalidate]):
414         (-[WKWebInspectorProxyObjCAdapter windowDidMove:]):
415         (-[WKWebInspectorProxyObjCAdapter windowDidResize:]):
416         (-[WKWebInspectorProxyObjCAdapter windowWillClose:]):
417         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
418         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
419         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]):
420         Remove unnecessary casts to and from void*.
421
422         (WebKit::WebInspectorProxy::attachmentViewDidChange):
423         (WebKit::WebInspectorProxy::setInspectorWindowFrame):
424         (WebKit::WebInspectorProxy::closeTimerFired):
425         (WebKit::WebInspectorProxy::createInspectorWindow):
426         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
427         Fix uses of member variable m_objCAdapter.
428
429         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
430         Rename this to invalidate to match modern convention. In this context,
431         'close' might trick someone into thinking that this closes a window/page.
432
433 2017-09-30  Brian Burg  <bburg@apple.com>
434
435         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
436         https://bugs.webkit.org/show_bug.cgi?id=177661
437         <rdar://problem/34740286>
438
439         Reviewed by Joseph Pecoraro.
440
441         Move code that sets up and controls the inspector WebView into WKInspectorViewController.
442         This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually,
443         but for now just pull out code from RemoteWebInspectorProxy. The next patch will move
444         over WebInspectorProxy.
445
446         WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates.
447         Previously, a WKWebView was used but the delegates were set up using the C API. In
448         a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some
449         things. In general, WKInspectorViewController doesn't dig into any internals of
450         WebPageProxy or WebInspectorProxy; that is delegated to the client.
451
452         * UIProcess/RemoteWebInspectorProxy.h:
453         (WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now.
454         We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI
455         in the future, and WebInspectorProxy has the same method. Add this and connect it
456         to the view controller delegate method.
457
458         (WebKit::RemoteWebInspectorProxy::webView const):
459         This returns a plain WKWebView type now.
460
461         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
462         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
463         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
464         (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted.
465         (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
466         Make the ObjCAdapter forward view controller delegate calls to the C++ class.
467         It no longer needs to be the delegate of the WebView, as the view controller handles that.
468
469         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
470         Clean up and move WKWebView setup code into the view controller.
471
472         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
473         The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here.
474
475         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
476         (WebKit::RemoteWebInspectorProxy::platformSave):
477         (WebKit::RemoteWebInspectorProxy::platformAppend):
478         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
479         Use webView() instead of m_webView.
480
481         * UIProcess/mac/WKInspectorViewController.h: Added.
482         * UIProcess/mac/WKInspectorViewController.mm: Added.
483         (-[WKInspectorWKWebView tag]):
484         (-[WKInspectorViewController initWithInspectedPage:]):
485         (-[WKInspectorViewController dealloc]):
486         (-[WKInspectorViewController delegate]):
487         (-[WKInspectorViewController webView]):
488         (-[WKInspectorViewController setDelegate:]):
489         (-[WKInspectorViewController configuration]):
490         (-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]):
491         (-[WKInspectorViewController _webView:setWindowFrame:]):
492         (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
493         (-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]):
494         (-[WKInspectorViewController webViewWebContentProcessDidTerminate:]):
495         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
496         Move code from RemoteWebInspectorProxyMac into here.
497
498         * UIProcess/mac/WebInspectorProxyMac.mm:
499         (WebKit::WebInspectorProxy::createFrontendWindow):
500         Remove commented out code left over from the last time that this method got moved around.
501
502         * WebKit.xcodeproj/project.pbxproj:
503         Add new class.
504
505 2017-10-20  Zan Dobersek  <zdobersek@igalia.com>
506
507         [WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl
508         https://bugs.webkit.org/show_bug.cgi?id=178575
509
510         Reviewed by Carlos Garcia Campos.
511
512         * Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as
513         a supported platform prefix. No one invokes the script with this
514         argument anymore.
515
516 2017-10-19  Alex Christensen  <achristensen@webkit.org>
517
518         Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename
519         https://bugs.webkit.org/show_bug.cgi?id=178560
520
521         Reviewed by Tim Horton.
522
523         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
524         * UIProcess/Cocoa/DownloadClient.h:
525         * UIProcess/Cocoa/DownloadClient.mm:
526         (WebKit::DownloadClient::DownloadClient):
527         (WebKit::DownloadClient::didStart):
528         (WebKit::DownloadClient::didReceiveResponse):
529         (WebKit::DownloadClient::didReceiveData):
530         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
531         (WebKit::DownloadClient::didFinish):
532         (WebKit::DownloadClient::didFail):
533         (WebKit::DownloadClient::didCancel):
534         (WebKit::DownloadClient::willSendRequest):
535
536 2017-10-19  Chris Dumez  <cdumez@apple.com>
537
538         ServiceWorkerContextManager should be an IPC::MessageReceiver
539         https://bugs.webkit.org/show_bug.cgi?id=178552
540
541         Reviewed by Youenn Fablet.
542
543         ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many
544         ServiceWorker related methods on WebProcess class.
545
546         * DerivedSources.make:
547         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
548         (WebKit::WebSWServerConnection::startServiceWorkerContext):
549         (WebKit::WebSWServerConnection::startFetch):
550         * WebKit.xcodeproj/project.pbxproj:
551         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
552         (WebKit::ServiceWorkerContextManager::startFetchInServiceWorker):
553         (WebKit::ServiceWorkerContextManager::startFetch): Deleted.
554         * WebProcess/Storage/ServiceWorkerContextManager.h:
555         * WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added.
556         * WebProcess/WebProcess.cpp:
557         (WebKit::WebProcess::didReceiveMessage):
558         (WebKit::WebProcess::getWorkerContextConnection):
559         (WebKit::WebProcess::startServiceWorkerContext): Deleted.
560         (WebKit::WebProcess::startFetchInServiceWorker): Deleted.
561         * WebProcess/WebProcess.h:
562         * WebProcess/WebProcess.messages.in:
563
564 2017-10-19  Alex Christensen  <achristensen@webkit.org>
565
566         Modernize authentication challenge handling in WebKit
567         https://bugs.webkit.org/show_bug.cgi?id=178555
568
569         Reviewed by Tim Horton.
570
571         * UIProcess/API/APILoaderClient.h:
572         (API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
573         * UIProcess/API/APINavigationClient.h:
574         (API::NavigationClient::didReceiveAuthenticationChallenge):
575         * UIProcess/API/C/WKPage.cpp:
576         (WKPageSetPageLoaderClient):
577         (WKPageSetPageNavigationClient):
578         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
579         * UIProcess/Cocoa/NavigationState.h:
580         * UIProcess/Cocoa/NavigationState.mm:
581         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
582         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
583         * UIProcess/WebPageProxy.cpp:
584         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
585
586 2017-10-19  Alex Christensen  <achristensen@webkit.org>
587
588         Modernize API::DownloadClient
589         https://bugs.webkit.org/show_bug.cgi?id=178547
590
591         Reviewed by Andy Estes.
592
593         Use more C++ references instead of pointers because they're never null.
594
595         Remove canAuthenticateAgainstProtectionSpace because there are no implementations
596         except the default implementation which always returns true and we don't intend to
597         add this to the SPI because that's just a legacy call anyways from when NSURLConnection
598         hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design.
599
600         Separate the NetworkSession-only and pre-NetworkSession-only callbacks.  All the synchronous
601         IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them!
602
603         Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to
604         design an asynchronous API.
605
606         * NetworkProcess/Downloads/DownloadManager.cpp:
607         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted.
608         * NetworkProcess/Downloads/DownloadManager.h:
609         * NetworkProcess/Downloads/PendingDownload.cpp:
610         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
611         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted.
612         * NetworkProcess/Downloads/PendingDownload.h:
613         * NetworkProcess/NetworkProcess.cpp:
614         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted.
615         * NetworkProcess/NetworkProcess.h:
616         * NetworkProcess/NetworkProcess.messages.in:
617         * UIProcess/API/APIDownloadClient.h:
618         (API::DownloadClient::didStart):
619         (API::DownloadClient::didReceiveAuthenticationChallenge):
620         (API::DownloadClient::didReceiveResponse):
621         (API::DownloadClient::didReceiveData):
622         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
623         (API::DownloadClient::decideDestinationWithSuggestedFilename):
624         (API::DownloadClient::didCreateDestination):
625         (API::DownloadClient::didFinish):
626         (API::DownloadClient::didFail):
627         (API::DownloadClient::didCancel):
628         (API::DownloadClient::processDidCrash):
629         (API::DownloadClient::willSendRequest):
630         (API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted.
631         * UIProcess/API/C/WKContext.cpp:
632         (WKContextSetDownloadClient):
633         * UIProcess/API/glib/WebKitDownloadClient.cpp:
634         * UIProcess/Cocoa/DownloadClient.h:
635         * UIProcess/Cocoa/DownloadClient.mm:
636         (WebKit::DownloadClient::didStart):
637         (WebKit::DownloadClient::didReceiveResponse):
638         (WebKit::DownloadClient::didReceiveData):
639         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
640         (WebKit::DownloadClient::didFinish):
641         (WebKit::DownloadClient::didFail):
642         (WebKit::DownloadClient::didCancel):
643         (WebKit::DownloadClient::willSendRequest):
644         * UIProcess/Downloads/DownloadProxy.cpp:
645         (WebKit::DownloadProxy::processDidClose):
646         (WebKit::DownloadProxy::didStart):
647         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
648         (WebKit::DownloadProxy::willSendRequest):
649         (WebKit::DownloadProxy::didReceiveResponse):
650         (WebKit::DownloadProxy::didReceiveData):
651         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
652         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
653         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
654         (WebKit::DownloadProxy::didCreateDestination):
655         (WebKit::DownloadProxy::didFinish):
656         (WebKit::DownloadProxy::didFail):
657         (WebKit::DownloadProxy::didCancel):
658         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted.
659         * UIProcess/Downloads/DownloadProxy.h:
660         * UIProcess/Downloads/DownloadProxy.messages.in:
661
662 2017-10-19  Nan Wang  <n_wang@apple.com>
663
664         AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection
665         https://bugs.webkit.org/show_bug.cgi?id=176247
666         <rdar://problem/34217143>
667
668         Reviewed by Ryosuke Niwa.
669
670         When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a
671         list of totally wrong rects if the user changed the selection to some other text. This is because the
672         calculation is based on the current selection range. Therefore, we need to provide a way for accessibility
673         codepath to store the selection during a speaking session.
674
675         * UIProcess/API/Cocoa/WKWebView.mm:
676         (-[WKWebView _accessibilityStoreSelection]):
677         (-[WKWebView _accessibilityClearSelection]):
678         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
679         * UIProcess/WebPageProxy.h:
680         * UIProcess/ios/WKContentViewInteraction.h:
681         * UIProcess/ios/WKContentViewInteraction.mm:
682         (-[WKContentView _accessibilityStoreSelection]):
683         (-[WKContentView _accessibilityClearSelection]):
684         * UIProcess/ios/WebPageProxyIOS.mm:
685         (WebKit::WebPageProxy::storeSelectionForAccessibility):
686         * WebProcess/WebPage/WebPage.h:
687         * WebProcess/WebPage/WebPage.messages.in:
688         * WebProcess/WebPage/ios/WebPageIOS.mm:
689         (WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
690         (WebKit::WebPage::storeSelectionForAccessibility):
691         (WebKit::WebPage::getRectsAtSelectionOffsetWithText):
692
693 2017-10-19  Sam Weinig  <sam@webkit.org>
694
695         [Settings] Move global settings into their own file
696         https://bugs.webkit.org/show_bug.cgi?id=178512
697
698         Reviewed by Darin Adler.
699
700         Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
701
702         * NetworkProcess/NetworkProcess.cpp:
703         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
704         * Shared/WebPreferencesDefinitions.h:
705         * Shared/WebPreferencesStore.cpp:
706         * WebProcess/WebPage/WebPage.cpp:
707         (WebKit::m_cpuLimit):
708         (WebKit::WebPage::updatePreferences):
709         * WebProcess/WebProcess.cpp:
710         (WebKit::WebProcess::setResourceLoadStatisticsEnabled):
711         * WebProcess/cocoa/VideoFullscreenManager.mm:
712         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
713
714 2017-10-19  Andy Estes  <aestes@apple.com>
715
716         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
717         https://bugs.webkit.org/show_bug.cgi?id=178181
718         <rdar://problem/33660282>
719
720         Reviewed by Dan Bernstein.
721
722         * Configurations/BaseTarget.xcconfig:
723         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
724         (WebKit::serviceName):
725         * WebKit.xcodeproj/project.pbxproj:
726
727 2017-10-19  Youenn Fablet  <youenn@apple.com>
728
729         Add preliminary support for ServiceWorker Handle Fetch
730         https://bugs.webkit.org/show_bug.cgi?id=178475
731         <rdar://problem/35066424>
732
733         Reviewed by Chris Dumez.
734
735         Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527.
736
737         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
738         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
739         It is similar to WebResourceLoader that do the load through NetworkProcess.
740         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
741         it will fallback to WebResourceLoader through a fallback callback.
742
743         Loading through Service Worker is done currently if:
744         - There is a service worker registered for that origin
745         - Request is a subresource
746         - service workers mode is all
747         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
748         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
749
750         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
751         In particular, it is calling ResourceLoader error callback if response is of type error.
752         It should call ResourceLoader redirection callback if response is a redirection response.
753         This will be done as a follow-up.
754
755         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
756         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
757
758         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
759         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
760
761         * CMakeLists.txt:
762         * DerivedSources.make:
763         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
764         (WebKit::WebSWServerConnection::startFetch):
765         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
766         (WebKit::WebSWServerConnection::didReceiveFetchData):
767         (WebKit::WebSWServerConnection::didFinishFetch):
768         (WebKit::WebSWServerConnection::didFailFetch):
769         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
770         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
771         * StorageProcess/StorageProcess.cpp:
772         (WebKit::StorageProcess::didFailFetch):
773         (WebKit::StorageProcess::didReceiveFetchResponse):
774         (WebKit::StorageProcess::didReceiveFetchData):
775         (WebKit::StorageProcess::didFinishFetch):
776         * StorageProcess/StorageProcess.h:
777         * StorageProcess/StorageProcess.messages.in:
778         * WebKit.xcodeproj/project.pbxproj:
779         * WebProcess/Network/WebLoaderStrategy.cpp:
780         (WebKit::WebLoaderStrategy::scheduleLoad):
781         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
782         (WebKit::WebLoaderStrategy::remove):
783         * WebProcess/Network/WebLoaderStrategy.h:
784         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
785         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
786         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
787         (WebKit::ServiceWorkerClientFetch::didReceiveData):
788         (WebKit::ServiceWorkerClientFetch::didFinish):
789         (WebKit::ServiceWorkerClientFetch::didFail):
790         (WebKit::ServiceWorkerClientFetch::cancel):
791         * WebProcess/Storage/ServiceWorkerClientFetch.h: Copied from Source/WebKit/WebProcess/Storage/WebSWClientConnection.h.
792         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Copied from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in.
793         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Added.
794         (WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
795         (WebKit::ServiceWorkerContextManager::startFetch):
796         * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
797         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
798         * WebProcess/Storage/WebSWClientConnection.cpp:
799         (WebKit::WebSWClientConnection::startFetch):
800         * WebProcess/Storage/WebSWClientConnection.h:
801         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
802         (WebKit::shouldHandleFetch):
803         (WebKit::WebServiceWorkerProvider::handleFetch):
804         (WebKit::WebServiceWorkerProvider::cancelFetch):
805         (WebKit::WebServiceWorkerProvider::fetchFinished):
806         (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
807         * WebProcess/Storage/WebServiceWorkerProvider.h:
808         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
809         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
810         * WebProcess/WebProcess.cpp:
811         (WebKit::WebProcess::getWorkerContextConnection):
812         (WebKit::WebProcess::startServiceWorkerContext):
813         (WebKit::WebProcess::startFetchInServiceWorker):
814         * WebProcess/WebProcess.h:
815         * WebProcess/WebProcess.messages.in:
816
817 2017-10-19  Youenn Fablet  <youenn@apple.com>
818
819         Service Worker process should not be selected to open WebView on it
820         https://bugs.webkit.org/show_bug.cgi?id=178527
821
822         Reviewed by Chris Dumez.
823
824         Selection of process to open a page will no longer use an existing web process if it is the service worker process.
825
826         * UIProcess/WebProcessPool.cpp:
827         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
828
829 2017-10-19  Tim Horton  <timothy_horton@apple.com>
830
831         Display link bringup can block the main thread for ~150ms during WKWebView init
832         https://bugs.webkit.org/show_bug.cgi?id=178524
833
834         Reviewed by Dean Jackson.
835
836         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
837         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
838         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
839         (WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkHandler):
840         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
841         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
842         Lazily initialize the display link at first use.
843
844 2017-10-19  Tim Horton  <timothy_horton@apple.com>
845
846         Expand r209943 to suppress paste during provisional navigation as well
847         https://bugs.webkit.org/show_bug.cgi?id=178429
848         <rdar://problem/33952830>
849
850         Reviewed by Dean Jackson.
851
852         * Shared/WebPreferencesDefinitions.h:
853         * UIProcess/API/C/WKPreferences.cpp:
854         (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation):
855         (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation):
856         * UIProcess/API/Cocoa/WKPreferences.mm:
857         (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]):
858         (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]):
859         * WebProcess/WebPage/WebPage.cpp:
860         (WebKit::WebPage::updatePreferences):
861         Adjust to the changed preference name, except at the SPI level.
862
863 2017-10-19  Youenn Fablet  <youenn@apple.com>
864
865         Add API to clean CacheStorage data
866         https://bugs.webkit.org/show_bug.cgi?id=178034
867
868         Unreviewed.
869
870         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS.
871
872 2017-10-19  Chris Dumez  <cdumez@apple.com>
873
874         Unreviewed build fix after r223692.
875
876         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
877
878 2017-10-19  Chris Dumez  <cdumez@apple.com>
879
880         Unreviewed, revert r223650 as it caused crashes on the bots.
881
882         * CMakeLists.txt:
883         * DerivedSources.make:
884         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
885         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
886         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
887         * StorageProcess/StorageProcess.cpp:
888         * StorageProcess/StorageProcess.h:
889         * StorageProcess/StorageProcess.messages.in:
890         * WebKit.xcodeproj/project.pbxproj:
891         * WebProcess/Network/WebLoaderStrategy.cpp:
892         (WebKit::WebLoaderStrategy::scheduleLoad):
893         (WebKit::WebLoaderStrategy::remove):
894         * WebProcess/Network/WebLoaderStrategy.h:
895         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed.
896         * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed.
897         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed.
898         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Removed.
899         * WebProcess/Storage/WebSWClientConnection.cpp:
900         * WebProcess/Storage/WebSWClientConnection.h:
901         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
902         * WebProcess/Storage/WebServiceWorkerProvider.h:
903         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
904         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
905         * WebProcess/WebProcess.cpp:
906         (WebKit::WebProcess::getWorkerContextConnection):
907         (WebKit::WebProcess::startServiceWorkerContext):
908         * WebProcess/WebProcess.h:
909         * WebProcess/WebProcess.messages.in:
910
911 2017-10-19  Chris Dumez  <cdumez@apple.com>
912
913         http/tests/workers/service/basic-register.html is a flaky failure.
914         https://bugs.webkit.org/show_bug.cgi?id=178494
915         <rdar://problem/35065315>
916
917         Reviewed by Youenn Fablet.
918
919         In WebSWServerConnection::resolveJobInClient(), when a service worker is
920         registered, we:
921         1. Add the origin to the WebSWOriginStore
922         2. Send the IPC to the WebProcess to notify it that the registration succeeded.
923
924         The assumption was that step 1 would be synchronous and would therefore send
925         the shared memory handle to the WebProcess (if the SharedMemory was invalidated)
926         *before* step 2.
927
928         The issue is that step 1 was scheduling a zero-timer to schedule the addition.
929         As a result, there was a race and the WebContent process could check the
930         the WebSWOriginTable *after* being notified that a service worker was registered
931         but *before* it received the SharedMemory handle for the WebSWOriginTable. This
932         could lead to false negatives and was causing the layout test to be flaky.
933
934         To address the issue, step 1 is now synchronous.
935
936         * Shared/SharedStringHashStore.cpp:
937         (WebKit::SharedStringHashStore::SharedStringHashStore):
938         (WebKit::SharedStringHashStore::scheduleAddition):
939         (WebKit::SharedStringHashStore::scheduleRemoval):
940         (WebKit::SharedStringHashStore::contains):
941         (WebKit::SharedStringHashStore::flushPendingChanges):
942         (WebKit::SharedStringHashStore::processPendingOperations):
943         * Shared/SharedStringHashStore.h:
944         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
945         (WebKit::WebSWOriginStore::add):
946         (WebKit::WebSWOriginStore::addAll):
947         (WebKit::WebSWOriginStore::remove):
948         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
949         * UIProcess/VisitedLinkStore.cpp:
950         (WebKit::VisitedLinkStore::addVisitedLinkHash):
951         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
952
953 2017-10-18  Ryosuke Niwa  <rniwa@webkit.org>
954
955         Don't expose raw HTML in pasteboard to the web content
956         https://bugs.webkit.org/show_bug.cgi?id=178422
957
958         Reviewed by Wenson Hsieh.
959
960         Encode & decode the origin string of the copied content written into the system pasteboard.
961
962         * Shared/WebCoreArgumentCoders.cpp:
963         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
964         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
965
966 2017-10-18  Chris Dumez  <cdumez@apple.com>
967
968         Implement ServiceWorkerRegistration.scope / updateViaCache
969         https://bugs.webkit.org/show_bug.cgi?id=178497
970
971         Reviewed by Youenn Fablet.
972
973         * Shared/WebCoreArgumentCoders.h:
974         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
975
976 2017-10-18  Youenn Fablet  <youenn@apple.com>
977
978         Add preliminary support for ServiceWorker Handle Fetch
979         https://bugs.webkit.org/show_bug.cgi?id=178475
980
981         Reviewed by Chris Dumez.
982
983         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
984         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
985         It is similar to WebResourceLoader that do the load through NetworkProcess.
986         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
987         it will fallback to WebResourceLoader through a fallback callback.
988
989         Loading through Service Worker is done currently if:
990         - There is a service worker registered for that origin
991         - Request is a subresource
992         - service workers mode is all
993         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
994         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
995
996         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
997         In particular, it is calling ResourceLoader error callback if response is of type error.
998         It should call ResourceLoader redirection callback if response is a redirection response.
999         This will be done as a follow-up.
1000
1001         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
1002         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
1003
1004         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
1005         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
1006
1007         * DerivedSources.make:
1008         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1009         (WebKit::WebSWServerConnection::startFetch):
1010         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
1011         (WebKit::WebSWServerConnection::didReceiveFetchData):
1012         (WebKit::WebSWServerConnection::didFinishFetch):
1013         (WebKit::WebSWServerConnection::failedFetch):
1014         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1015         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1016         * StorageProcess/StorageProcess.cpp:
1017         (WebKit::StorageProcess::failedFetch):
1018         (WebKit::StorageProcess::didReceiveFetchResponse):
1019         (WebKit::StorageProcess::didReceiveFetchData):
1020         (WebKit::StorageProcess::didFinishFetch):
1021         * StorageProcess/StorageProcess.h:
1022         * StorageProcess/StorageProcess.messages.in:
1023         * WebKit.xcodeproj/project.pbxproj:
1024         * WebProcess/Network/WebLoaderStrategy.cpp:
1025         (WebKit::WebLoaderStrategy::scheduleLoad):
1026         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1027         * WebProcess/Network/WebLoaderStrategy.h:
1028         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
1029         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1030         (WebKit::ServiceWorkerClientFetch::didReceiveData):
1031         (WebKit::ServiceWorkerClientFetch::didFinishFetch):
1032         (WebKit::ServiceWorkerClientFetch::didFail):
1033         * WebProcess/Storage/ServiceWorkerClientFetch.h: Added.
1034         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Added.
1035         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Renamed from Source/WebCore/workers/service/context/SWContextManager.cpp.
1036         (WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
1037         (WebKit::ServiceWorkerContextManager::startFetch):
1038         * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
1039         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
1040         * WebProcess/Storage/WebSWClientConnection.cpp:
1041         (WebKit::WebSWClientConnection::startFetch):
1042         * WebProcess/Storage/WebSWClientConnection.h:
1043         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1044         (WebKit::shouldHandleFetch):
1045         (WebKit::WebServiceWorkerProvider::handleFetch):
1046         (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
1047         * WebProcess/Storage/WebServiceWorkerProvider.h:
1048         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1049         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1050         * WebProcess/WebProcess.cpp:
1051         (WebKit::WebProcess::getWorkerContextConnection):
1052         (WebKit::WebProcess::startServiceWorkerContext):
1053         (WebKit::WebProcess::startFetchInServiceWorker):
1054         * WebProcess/WebProcess.h:
1055         * WebProcess/WebProcess.messages.in:
1056
1057 2017-10-18  Chelsea Pugh  <cpugh@apple.com>
1058
1059         [iOS] Use new class name from UIKit when checking UITextSuggestion type
1060         https://bugs.webkit.org/show_bug.cgi?id=178416
1061         <rdar://problem/35010840>
1062
1063         Reviewed by Tim Horton.
1064
1065         Here we start using UITextAutofillSuggestion instead of the old name that was being used for
1066         AutoFill text suggestions.
1067
1068         * Platform/spi/ios/UIKitSPI.h:
1069         * UIProcess/ios/WKContentViewInteraction.mm:
1070         (-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class
1071         and when casting instead of UIKeyboardLoginCredentialsSuggestion.
1072
1073 2017-10-17  Jiewen Tan  <jiewen_tan@apple.com>
1074
1075         Replace some stack raw pointers with RefPtrs within WebCore/html
1076         https://bugs.webkit.org/show_bug.cgi?id=178201
1077         <rdar://problem/34841692>
1078
1079         Reviewed by Ryosuke Niwa.
1080
1081         Change the type of node as toNode() is changed to return RefPtr.
1082
1083         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
1084         (WebKit::wrap):
1085         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1086         (WebKit::WebEditorClient::handleKeyboardEvent):
1087         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
1088         (WebKit::WebEditorClient::handleKeyboardEvent):
1089         * WebProcess/WebPage/WebPage.cpp:
1090         (WebKit::WebPage::handleEditingKeyboardEvent):
1091         * WebProcess/WebPage/mac/WebPageMac.mm:
1092         (WebKit::frameForEvent):
1093
1094 2017-10-18  Chris Dumez  <cdumez@apple.com>
1095
1096         [Service Worker] Add stubs for Client / WindowClient / Clients
1097         https://bugs.webkit.org/show_bug.cgi?id=178469
1098
1099         Reviewed by Youenn Fablet.
1100
1101         Rename PageVisibilityState to VisibilityState.
1102
1103         * Shared/API/c/WKSharedAPICast.h:
1104         (WebKit::toVisibilityState):
1105         * WebProcess/WebPage/WebPage.h:
1106
1107 2017-10-18  John Wilander  <wilander@apple.com>
1108
1109         Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy
1110         https://bugs.webkit.org/show_bug.cgi?id=178470
1111         <rdar://problem/34417518>
1112
1113         Reviewed by Brian Burg.
1114
1115         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1116         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1117             Add a missing check of notifyPagesWhenTelemetryWasCaptured.
1118             The page notification is only for testing purposes.
1119
1120 2017-10-18  Chris Dumez  <cdumez@apple.com>
1121
1122         Unreviewed, fix build error after r223608 with some SDKs.
1123
1124         * StorageProcess/StorageProcess.cpp:
1125         (WebKit::StorageProcess::ensureSWOriginStoreForSession):
1126
1127 2017-10-18  Chris Dumez  <cdumez@apple.com>
1128
1129         Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
1130         https://bugs.webkit.org/show_bug.cgi?id=177876
1131         <rdar://problem/34813129>
1132
1133         Reviewed by Ryosuke Niwa.
1134
1135         Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side
1136         and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can
1137         efficiently check if there is a ServiceWorker registered for a given origin without actually doing
1138         an IPC to the StorageProcess.
1139
1140         For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles
1141         between the StorageProcess and the WebProcesses.
1142
1143         We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds
1144         on the StorageProcess side. We also clear this store whenever the API to clear service worker
1145         registrations is called. Code to query the WebSWOriginTable from the WebContent process side is
1146         there but currently only used by Internals for testing. We will later leverage this code when
1147         integrating with Fetch API.
1148
1149         * CMakeLists.txt:
1150         * Shared/SharedStringHashStore.h:
1151         (WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes):
1152         * Shared/SharedStringHashTable.cpp:
1153         (WebKit::SharedStringHashTable::clear):
1154         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
1155         (WebKit::WebSWOriginStore::WebSWOriginStore):
1156         (WebKit::WebSWOriginStore::add):
1157         (WebKit::WebSWOriginStore::remove):
1158         (WebKit::WebSWOriginStore::clear):
1159         (WebKit::WebSWOriginStore::registerSWServerConnection):
1160         (WebKit::WebSWOriginStore::unregisterSWServerConnection):
1161         (WebKit::WebSWOriginStore::sendStoreHandle):
1162         (WebKit::WebSWOriginStore::didInvalidateSharedMemory):
1163         * StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
1164         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1165         (WebKit::WebSWServerConnection::WebSWServerConnection):
1166         (WebKit::WebSWServerConnection::resolveJobInClient):
1167         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1168         (WebKit::WebSWServerConnection::sessionID const):
1169         * StorageProcess/StorageProcess.cpp:
1170         (WebKit::StorageProcess::deleteWebsiteData):
1171         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1172         (WebKit::StorageProcess::ensureSWOriginStoreForSession):
1173         (WebKit::StorageProcess::swOriginStoreForSession const):
1174         (WebKit::StorageProcess::serviceWorkerContextStarted):
1175         (WebKit::StorageProcess::registerSWServerConnection):
1176         (WebKit::StorageProcess::unregisterSWServerConnection):
1177         * StorageProcess/StorageProcess.h:
1178         * StorageProcess/StorageProcess.messages.in:
1179         * WebKit.xcodeproj/project.pbxproj:
1180         * WebProcess/Storage/WebSWClientConnection.cpp:
1181         (WebKit::WebSWClientConnection::WebSWClientConnection):
1182         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const):
1183         (WebKit::WebSWClientConnection::setSWOriginTableSharedMemory):
1184         * WebProcess/Storage/WebSWClientConnection.h:
1185         * WebProcess/Storage/WebSWClientConnection.messages.in:
1186         * WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
1187         (WebKit::WebSWOriginTable::contains const):
1188         (WebKit::WebSWOriginTable::setSharedMemory):
1189         * WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
1190         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1191         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
1192         * WebProcess/Storage/WebServiceWorkerProvider.h:
1193         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1194         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
1195         * WebProcess/Storage/WebToStorageProcessConnection.h:
1196         * WebProcess/WebProcess.cpp:
1197         (WebKit::WebProcess::startServiceWorkerContext):
1198
1199 2017-10-16  Andy Estes  <aestes@apple.com>
1200
1201         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
1202         https://bugs.webkit.org/show_bug.cgi?id=178191
1203         <rdar://problem/34906367>
1204
1205         Reviewed by Tim Horton.
1206
1207         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1208         (WebKit::toNSError):
1209
1210 2017-10-17  Sam Weinig  <sam@webkit.org>
1211
1212         [Settings] Generate Settings.h/cpp
1213         https://bugs.webkit.org/show_bug.cgi?id=178361
1214
1215         Reviewed by Dean Jackson.
1216
1217         * PlatformGTK.cmake:
1218         * PlatformWPE.cmake:
1219
1220             Delete the old Settings.h from the forwarding 
1221             headers directory to allow the build to work.
1222
1223 2017-10-17  John Wilander  <wilander@apple.com>
1224
1225         Add and remove cookie partition accordingly in intermediary redirect requests
1226         https://bugs.webkit.org/show_bug.cgi?id=178369
1227         <rdar://problem/34467603>
1228
1229         Reviewed by Brent Fulgham.
1230
1231         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1232         (WebKit::shouldChangePartition):
1233             Convenience function. Comment documents the logic.
1234         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1235             Now adds and removes cookie partition based on the
1236             redirect-to URL's domain.
1237         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1238         (WKBundleResourceLoadStatisticsNotifyObserver):
1239             Test infrastructure.
1240         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1241
1242 2017-10-17  Youenn Fablet  <youenn@apple.com>
1243
1244         Cache API implementation should be able to compute storage size for WebKit client applications.
1245         https://bugs.webkit.org/show_bug.cgi?id=178350
1246
1247         Reviewed by Chris Dumez.
1248
1249         When gathering data from DOM Cache, we compute the size as follows:
1250         - If Caches object is not persistent, size is zero
1251         - If Caches object is persistent, we use the size computed by NetworkCache::Storage. 
1252         Covered by updated tests.
1253
1254         * NetworkProcess/cache/CacheStorageEngine.cpp:
1255         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
1256         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
1257         (WebKit::CacheStorage::Engine::fetchEntries):
1258         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1259         (WebKit::CacheStorage::Caches::storageSize const):
1260         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1261         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1262         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
1263         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1264
1265 2017-10-17  Keith Miller  <keith_miller@apple.com>
1266
1267         Change WebCore sources to work with unified source builds
1268         https://bugs.webkit.org/show_bug.cgi?id=178229
1269
1270         Rubber stamped by Tim Horton.
1271
1272         * Configurations/FeatureDefines.xcconfig:
1273
1274 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1275
1276         Unreviewed, fix the iOS build after r223431
1277
1278         Remove an unused variable captured in a lambda.
1279
1280         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1281         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1282
1283 2017-10-12  Matt Rajca  <mrajca@apple.com>
1284
1285         Add API support for quirk that lets an arbitrary click allow auto-play.
1286         https://bugs.webkit.org/show_bug.cgi?id=178227
1287
1288         Reviewed by Alex Christensen.
1289
1290         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
1291         an arbitrary click allow auto-play via website policies.
1292
1293         * Shared/WebsitePolicies.h:
1294         * UIProcess/API/C/WKWebsitePolicies.cpp:
1295         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
1296         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
1297         * UIProcess/API/C/WKWebsitePolicies.h:
1298         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1299         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1300         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
1301         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
1302         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1303         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1304         * WebProcess/WebPage/WebPage.cpp:
1305         (WebKit::WebPage::updateWebsitePolicies):
1306
1307 2017-10-16  Andy Estes  <aestes@apple.com>
1308
1309         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
1310         https://bugs.webkit.org/show_bug.cgi?id=178191
1311         <rdar://problem/34906367>
1312
1313         Reviewed by Tim Horton.
1314
1315         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1316         (WebKit::toNSError):
1317
1318 2017-10-16  Tim Horton  <timothy_horton@apple.com>
1319
1320         Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:])
1321         https://bugs.webkit.org/show_bug.cgi?id=178358
1322         <rdar://problem/34676899>
1323
1324         Reviewed by Wenson Hsieh.
1325
1326         * UIProcess/ios/WKPDFView.mm:
1327         (-[WKPDFView _didFindMatch:]):
1328         UIPDFSelection can return a null rect as the selection's bounds.
1329         We can't zoom to a null rect (and doing so results in CA throwing an
1330         exception later).
1331
1332 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1333
1334         Add a _WKThumbnailView initializer with a WKWebView
1335         https://bugs.webkit.org/show_bug.cgi?id=178351
1336         <rdar://problem/34979453>
1337
1338         Reviewed by Tim Horton.
1339
1340         * UIProcess/API/Cocoa/WKWebView.mm:
1341         (-[WKWebView _page]):
1342         (-[WKWebView _setThumbnailView:]):
1343         (-[WKWebView _thumbnailView]):
1344         (-[WKWebView _setIgnoresAllEvents:]):
1345         (-[WKWebView _ignoresAllEvents]):
1346         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1347         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1348         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1349         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1350         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
1351         (-[_WKThumbnailView _viewWasUnparented]):
1352         (-[_WKThumbnailView _viewWasParented]):
1353
1354 2017-10-16  Alex Christensen  <achristensen@webkit.org>
1355
1356         Expose more WKView properties as WKWebViewPrivate SPI
1357         https://bugs.webkit.org/show_bug.cgi?id=178349
1358         <rdar://problem/34980919>
1359
1360         Reviewed by Tim Horton.
1361
1362         _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too.
1363         A few other properties also need exposing.
1364
1365         * UIProcess/API/Cocoa/WKWebView.mm:
1366         (toAPIScrollbarStyle):
1367         (toCoreScrollbarStyle):
1368         (-[WKWebView _setBackgroundExtendsBeyondPage:]):
1369         (-[WKWebView _backgroundExtendsBeyondPage]):
1370         (-[WKWebView _setOverlayScrollbarStyle:]):
1371         (-[WKWebView _overlayScrollbarStyle]):
1372         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1373
1374 2017-10-16  Chris Dumez  <cdumez@apple.com>
1375
1376         Log using differential privacy domains where the WebContent process crashes
1377         https://bugs.webkit.org/show_bug.cgi?id=178346
1378         <rdar://problem/33293830>
1379
1380         Reviewed by Alex Christensen.
1381
1382         * UIProcess/WebPageProxy.cpp:
1383         (WebKit::WebPageProxy::reload):
1384         (WebKit::WebPageProxy::currentURL const):
1385         (WebKit::WebPageProxy::processDidTerminate):
1386         * UIProcess/WebPageProxy.h:
1387         * UIProcess/WebProcessProxy.cpp:
1388         (WebKit::WebProcessProxy::didClose):
1389
1390 2017-10-16  Youenn Fablet  <youenn@apple.com>
1391
1392         Activate Cache API by default
1393         https://bugs.webkit.org/show_bug.cgi?id=178186
1394
1395         Reviewed by Chris Dumez.
1396
1397         * Shared/WebPreferencesDefinitions.h:
1398
1399 2017-10-16  Sam Weinig  <sam@webkit.org>
1400
1401         [Settings] Remove all custom code from Settings.h/cpp
1402         https://bugs.webkit.org/show_bug.cgi?id=178330
1403
1404         Reviewed by Simon Fraser.
1405
1406         * Shared/WebPreferencesDefinitions.h:
1407         * UIProcess/API/C/WKPreferences.cpp:
1408         (WKPreferencesSetFrameFlatteningEnabled):
1409         (WKPreferencesGetFrameFlatteningEnabled):
1410         * UIProcess/API/glib/WebKitSettings.cpp:
1411         (webkit_settings_get_enable_frame_flattening):
1412         (webkit_settings_set_enable_frame_flattening):
1413         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1414         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
1415         
1416             Update for naming changes of FrameFlattening now that it is an enum class.
1417
1418         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1419         (WebKit::WebChromeClient::contentsSizeChanged const):
1420
1421             Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
1422
1423 2017-10-16  Chris Dumez  <cdumez@apple.com>
1424
1425         [WK2][NetworkSession] Add support for resuming downloads
1426         https://bugs.webkit.org/show_bug.cgi?id=177625
1427         <rdar://problem/34345975>
1428
1429         Reviewed by Alex Christensen.
1430
1431         Add support for resuming downloads for the WK2 NETWORK_SESSION code path.
1432
1433         This was tested manually. I was unable to write an API test because our tests
1434         do not run an HTTP server and CFNetwork does not seem to generate resume data
1435         when cancelling a download over non-HTTP.
1436
1437         * NetworkProcess/Downloads/Download.cpp:
1438         (WebKit::Download::didReceiveChallenge):
1439         (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace):
1440         * NetworkProcess/Downloads/Download.h:
1441         * NetworkProcess/Downloads/DownloadManager.cpp:
1442         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
1443         (WebKit::DownloadManager::resumeDownload):
1444         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1445         (WebKit::Download::resume):
1446         This currently includes a workaround for <rdar://problem/34745171>. We update the
1447         resume data to include the NSURLSessionResumeInfoLocalPath key with the final
1448         destination path so that CFNetwork looks for the temporary data at the right
1449         location.
1450
1451         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1452         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1453         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1454         (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData):
1455         * Shared/Authentication/AuthenticationManager.cpp:
1456         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1457         * Shared/Authentication/AuthenticationManager.h:
1458
1459 2017-10-16  Adrian Perez de Castro  <aperez@igalia.com>
1460
1461         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
1462         https://bugs.webkit.org/show_bug.cgi?id=178090
1463
1464         Reviewed by Michael Catanzaro.
1465
1466         EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL
1467         implementation, its build options, and the libepoxy build options.  Using "static_cast"
1468         works when it is a numeric value and the width of the value needs to be optionally
1469         extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers,
1470         and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other
1471         cases. Therefore it seems reasonable to use a plain C cast expression to solve this
1472         particular situation.
1473
1474         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1475         (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression.
1476
1477 2017-10-16  Chris Dumez  <cdumez@apple.com>
1478
1479         Clicks on Link with download attribute causes all (other) links to trigger download when clicked
1480         https://bugs.webkit.org/show_bug.cgi?id=178267
1481         <rdar://problem/34985016>
1482
1483         Reviewed by Darin Adler.
1484
1485         When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute
1486         flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get
1487         updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if
1488         you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets
1489         called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the
1490         m_syncNavigationActionHasDownloadAttribute flag and we force a download.
1491
1492         To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really
1493         not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes
1494         more sense to associate the flag with the navigation and makes it less error-prone.
1495
1496         * UIProcess/API/APINavigation.h:
1497         (API::Navigation::setShouldForceDownload):
1498         (API::Navigation::shouldForceDownload const):
1499         * UIProcess/WebPageProxy.cpp:
1500         (WebKit::WebPageProxy::receivedPolicyDecision):
1501         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1502         * UIProcess/WebPageProxy.h:
1503
1504 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
1505
1506         Unreviewed, rolling out r223271.
1507
1508         This change introduced LayoutTest failures on WK1.
1509
1510         Reverted changeset:
1511
1512         "Use asynchronous ResourceHandleClient calls for WebKit1"
1513         https://bugs.webkit.org/show_bug.cgi?id=160677
1514         https://trac.webkit.org/changeset/223271
1515
1516 2017-10-13  Youenn Fablet  <youenn@apple.com>
1517
1518         Implement listing origins for which CacheStorage is storing data
1519         https://bugs.webkit.org/show_bug.cgi?id=178236
1520
1521         Reviewed by Chris Dumez.
1522
1523         Cache storage is split on per-origin folders which name is obfuscated through salting.
1524         To retrieve the origin for each folder, an origin file is now stored within each folder.
1525         This file contains the actual origin.
1526
1527         Adding support to get the list of origin by iterating through each folder and
1528         getting the actual origin by reading the content of the 'origin' file.
1529
1530         Adding C API for WebKitTestRunner.
1531
1532         * NetworkProcess/cache/CacheStorageEngine.cpp:
1533         (WebKit::CacheStorage::Engine::fetchEntries):
1534         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
1535         (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter):
1536         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
1537         (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter):
1538         * NetworkProcess/cache/CacheStorageEngine.h:
1539         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1540         (WebKit::CacheStorage::cachesOriginFilename):
1541         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
1542         (WebKit::CacheStorage::Caches::Caches):
1543         (WebKit::CacheStorage::Caches::storeOrigin):
1544         (WebKit::CacheStorage::Caches::readOrigin):
1545         (WebKit::CacheStorage::Caches::initialize):
1546         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1547         (WebKit::CacheStorage::Caches::origin const):
1548         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1549         (WKWebsiteDataStoreGetFetchCacheOrigins):
1550         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1551
1552 2017-10-13  Alex Christensen  <achristensen@webkit.org>
1553
1554         Fix API tests after r223269.
1555         https://bugs.webkit.org/show_bug.cgi?id=178246
1556
1557         * UIProcess/API/APIContentRuleListStore.cpp:
1558         (API::ContentRuleListStore::getContentRuleListSource):
1559         Version 10 also has the ability to recover content rule list source.
1560
1561 2017-10-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1562
1563         [GLib] WebKitNavigationAction should tell whether it is a redirect
1564         https://bugs.webkit.org/show_bug.cgi?id=178178
1565
1566         There is no good way to know whether a given navigation action has been caused
1567         by a redirect through the glib API. This is necessary to implement some app mode
1568         heuristics for Epiphany.
1569
1570         Reviewed by Carlos Garcia Campos.
1571
1572         * UIProcess/API/glib/WebKitNavigationAction.cpp:
1573         (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect.
1574         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object.
1575         (_WebKitNavigationAction::_WebKitNavigationAction):
1576         * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API.
1577         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto.
1578         * UIProcess/API/wpe/WebKitNavigationAction.h: ditto.
1579
1580 2017-10-12  Brady Eidson  <beidson@apple.com>
1581
1582         SW "Hello world".
1583         https://bugs.webkit.org/show_bug.cgi?id=178187
1584
1585         Reviewed by Andy Estes.
1586
1587         * WebProcess/WebProcess.cpp:
1588         (WebKit::WebProcess::startServiceWorkerContext):
1589
1590 2017-10-12  Alex Christensen  <achristensen@webkit.org>
1591
1592         Remove unnecessary includes in WebKit
1593         https://bugs.webkit.org/show_bug.cgi?id=178235
1594
1595         Reviewed by Tim Horton.
1596
1597         * Platform/IPC/ArgumentCoders.h:
1598         * WebProcess/WebProcess.cpp:
1599         * WebProcess/WebStorage/StorageAreaImpl.h:
1600
1601 2017-10-12  Alex Christensen  <achristensen@webkit.org>
1602
1603         Increment ContentRuleListStore::CurrentContentRuleListFileVersion
1604         https://bugs.webkit.org/show_bug.cgi?id=178246
1605         <rdar://problem/34890057>
1606
1607         Reviewed by Tim Horton.
1608
1609         * UIProcess/API/APIContentRuleListStore.h:
1610         Things are crashing.  Something isn't binary reverse compatible.
1611         Probably something related to r222602.
1612         This is why we have a version number to update.
1613
1614 2017-10-12  Alex Christensen  <achristensen@webkit.org>
1615
1616         Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
1617         https://bugs.webkit.org/show_bug.cgi?id=178240
1618         <rdar://problem/34962720>
1619
1620         Reviewed by Tim Horton.
1621         
1622         Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
1623         an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.
1624
1625         * UIProcess/API/Cocoa/WKWebView.mm:
1626         (-[WKWebView _dismissContentRelativeChildWindows]):
1627         (-[WKWebView _setFrame:andScrollBy:]):
1628         (-[WKWebView _setTotalHeightOfBanners:]):
1629         (-[WKWebView _totalHeightOfBanners]):
1630         (-[WKWebView _beginDeferringViewInWindowChanges]):
1631         (-[WKWebView _endDeferringViewInWindowChanges]):
1632         (-[WKWebView _endDeferringViewInWindowChangesSync]):
1633         (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
1634         (-[WKWebView _setIgnoresNonWheelEvents:]):
1635         (-[WKWebView _ignoresNonWheelEvents]):
1636         (-[WKWebView _setCustomSwipeViews:]):
1637         (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
1638         (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
1639         (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
1640         (-[WKWebView _fullScreenPlaceholderView]):
1641         (-[WKWebView _fullScreenWindow]):
1642         (-[WKWebView _disableFrameSizeUpdates]):
1643         (-[WKWebView _enableFrameSizeUpdates]):
1644         (-[WKWebView _canChangeFrameLayout:]):
1645         (-[WKWebView _underlayColor]):
1646         (-[WKWebView _setUnderlayColor:]):
1647         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1648         * UIProcess/API/mac/WKView.mm:
1649         (-[WKView createFullScreenWindow]):
1650         * UIProcess/Cocoa/WebViewImpl.h:
1651         * UIProcess/Cocoa/WebViewImpl.mm:
1652         (WebKit::WebViewImpl::fullScreenWindowController):
1653         (WebKit::WebViewImpl::fullScreenWindow):
1654         (WebKit::WebViewImpl::createFullScreenWindow): Deleted.
1655
1656 2017-10-12  Youenn Fablet  <youenn@apple.com>
1657
1658         Layout Test http/tests/cache-storage/cache-clearing.https.html is failing
1659         https://bugs.webkit.org/show_bug.cgi?id=178200
1660
1661         Reviewed by Chris Dumez.
1662
1663         Deleting only the per-origin folders inside the CacheStorage engine root folder.
1664
1665         * NetworkProcess/cache/CacheStorageEngine.cpp:
1666         (WebKit::CacheStorage::Engine::clearAllCaches):
1667         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1668         (WKWebsiteDataStoreRemoveAllFetchCaches):
1669         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
1670         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1671
1672 2017-10-12  Chris Dumez  <cdumez@apple.com>
1673
1674         [Mac] Add support for MouseEvent.buttons
1675         https://bugs.webkit.org/show_bug.cgi?id=178214
1676
1677         Reviewed by Ryosuke Niwa.
1678
1679         * Shared/WebEvent.h:
1680         (WebKit::WebMouseEvent::buttons const):
1681         * Shared/WebEventConversion.cpp:
1682         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1683         * Shared/WebMouseEvent.cpp:
1684         (WebKit::WebMouseEvent::WebMouseEvent):
1685         (WebKit::WebMouseEvent::encode const):
1686         (WebKit::WebMouseEvent::decode):
1687         * Shared/mac/WebEventFactory.mm:
1688         (WebKit::currentlyPressedMouseButtons):
1689         (WebKit::WebEventFactory::createWebMouseEvent):
1690         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1691         (WebKit::PDFPlugin::showContextMenuAtPoint):
1692         * WebProcess/Plugins/PluginView.cpp:
1693         (WebKit::PluginView::createWebEvent const):
1694         * WebProcess/WebPage/WebPage.cpp:
1695         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
1696         (WebKit::WebPage::simulateMouseDown):
1697         (WebKit::WebPage::simulateMouseUp):
1698         (WebKit::WebPage::simulateMouseMotion):
1699
1700 2017-10-12  Youenn Fablet  <youenn@apple.com>
1701
1702         Add API to clean CacheStorage data
1703         https://bugs.webkit.org/show_bug.cgi?id=178034
1704
1705         Unreviewed.
1706
1707         * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 
1708
1709 2017-10-12  Stephan Szabo  <stephan.szabo@sony.com>
1710
1711         [WinCairo] add WebProcess files for wincairo webkit
1712         https://bugs.webkit.org/show_bug.cgi?id=178024
1713
1714         Reviewed by Alex Christensen.
1715
1716         * PlatformWin.cmake:
1717         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
1718         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
1719         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
1720         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added.
1721         (WebKit::InjectedBundle::initialize):
1722         (WebKit::InjectedBundle::setBundleParameter):
1723         (WebKit::InjectedBundle::setBundleParameters):
1724         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1725         * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added.
1726         (WebKit::PluginProxy::needsBackingStore const):
1727         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added.
1728         (WebKit::WebContextMenuClient::lookUpInDictionary):
1729         (WebKit::WebContextMenuClient::isSpeaking):
1730         (WebKit::WebContextMenuClient::speak):
1731         (WebKit::WebContextMenuClient::stopSpeaking):
1732         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
1733         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
1734         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1735         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
1736         (WebKit::WebFrameNetworkingContext::storageSession const):
1737         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
1738         (WebKit::WebFrameNetworkingContext::blockedError const):
1739         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
1740         (WebKit::WebFrameNetworkingContext::create):
1741         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added.
1742         (WebKit::WebPopupMenu::setUpPlatformData):
1743         * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added.
1744         (WebKit::WebInspectorUI::canSave):
1745         (WebKit::WebInspectorUI::localizedStringsURL):
1746         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
1747         * WebProcess/WebPage/win/WebPageWin.cpp: Added.
1748         (WebKit::WebPage::platformInitialize):
1749         (WebKit::WebPage::platformDetach):
1750         (WebKit::WebPage::platformEditorState const):
1751         (WebKit::WebPage::platformPreferencesDidChange):
1752         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
1753         (WebKit::WebPage::platformHasLocalDataForURL):
1754         (WebKit::WebPage::cachedResponseMIMETypeForURL):
1755         (WebKit::WebPage::platformCanHandleRequest):
1756         (WebKit::WebPage::cachedSuggestedFilenameForURL):
1757         (WebKit::WebPage::cachedResponseDataForURL):
1758         (WebKit::WebPage::platformUserAgent const):
1759         (WebKit::WebPage::interpretKeyEvent):
1760         * WebProcess/WebProcess.cpp:
1761         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
1762         * WebProcess/win/WebProcessWin.cpp: Added.
1763         (loadResourceIntoBuffer):
1764         (WebKit::WebProcess::platformInitializeWebProcess):
1765         (WebKit::WebProcess::platformTerminate):
1766         (WebKit::WebProcess::platformSetCacheModel):
1767
1768 2017-10-12  David Kilzer  <ddkilzer@apple.com>
1769
1770         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
1771         <https://webkit.org/b/178226>
1772
1773         Reviewed by Chris Fleizach.
1774
1775         * UIProcess/ios/WKContentViewInteraction.mm:
1776         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
1777         - Remove unused lambda variable 'touch' which was also passed as
1778           an argument.
1779         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
1780         - Remove unused lambda variable 'gestureState' which was also
1781           passed as an argument.
1782         (-[WKContentView _simulateLongPressActionAtLocation:]):
1783         - Remove unused lambda variable 'location'.
1784
1785 2017-10-12  John Wilander  <wilander@apple.com>
1786
1787         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
1788         https://bugs.webkit.org/show_bug.cgi?id=175257
1789         <rdar://problem/33359866>
1790
1791         Reviewed by Brent Fulgham.
1792
1793         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1794         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]):
1795         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]):
1796             Test infrastructure.
1797         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1798         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1799         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1800         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1801             Test infrastructure.
1802         * UIProcess/WebResourceLoadStatisticsStore.h:
1803
1804 2017-10-12  Andy Estes  <aestes@apple.com>
1805
1806         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
1807         https://bugs.webkit.org/show_bug.cgi?id=178181
1808         <rdar://problem/33660282>
1809
1810         Reviewed by Dan Bernstein.
1811
1812         * Configurations/BaseTarget.xcconfig:
1813         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1814         (WebKit::serviceName):
1815         * WebKit.xcodeproj/project.pbxproj:
1816
1817 2017-10-12  Youenn Fablet  <youenn@apple.com>
1818
1819         CacheStorage persistent folder should be in /Library/Cache
1820         https://bugs.webkit.org/show_bug.cgi?id=178193
1821
1822         Reviewed by Brady Eidson.
1823
1824         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1825         (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage
1826         directory a subfolder of Caches folder.
1827         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1828         * UIProcess/WebProcessPool.cpp:
1829         (WebKit::legacyWebsiteDataStoreConfiguration):
1830         (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store
1831         has the right cache directory path. Also make sure that the quota is set even if there is no folder specified.
1832         Quota may still be useful in case of non persistent sessions.
1833         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1834         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1835         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1836         (API::WebsiteDataStore::defaultCacheStorageDirectory):
1837
1838 2017-10-11  Sam Weinig  <sam@webkit.org>
1839
1840         Remove out-parameter variants of copyToVector
1841         https://bugs.webkit.org/show_bug.cgi?id=178155
1842
1843         Reviewed by Tim Horton.
1844
1845         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
1846         (-[_WKRemoteObjectInterface debugDescription]):
1847         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1848         (WebKit::dump):
1849         * UIProcess/WebPageProxy.cpp:
1850         (WebKit::WebPageProxy::resetState):
1851         * UIProcess/WebProcessPool.cpp:
1852         (WebKit::WebProcessPool::createNewWebProcess):
1853         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1854         (WebKit::WebsiteDataStore::parameters):
1855         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1856         (WebKit::WebsiteDataStore::pendingCookies const):
1857         * UIProcess/ios/ProcessAssertionIOS.mm:
1858         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
1859         * WebProcess/Cookies/WebCookieManager.cpp:
1860         (WebKit::WebCookieManager::getHostnamesWithCookies):
1861         * WebProcess/Geolocation/WebGeolocationManager.cpp:
1862         (WebKit::WebGeolocationManager::didChangePosition):
1863         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
1864         * WebProcess/Network/WebLoaderStrategy.cpp:
1865         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
1866
1867             Replace out-parameter based copyToVector, with one that returns a Vector.
1868
1869 2017-10-11  Jaehun Lim  <ljaehun.lim@samsung.com>
1870
1871         Fix debug build
1872
1873         Unreviewed.
1874
1875         Add ENABLE(SERVICE_WORKER) guard.
1876
1877         * UIProcess/WebProcessPool.cpp:
1878         (WebKit::WebProcessPool::createWebPage):
1879
1880 2017-10-11  Youenn Fablet  <youenn@apple.com>
1881
1882         Add API to clean CacheStorage data
1883         https://bugs.webkit.org/show_bug.cgi?id=178034
1884
1885         Unreviewed.
1886
1887         * NetworkProcess/NetworkProcess.cpp:
1888         (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator.
1889
1890 2017-10-11  Youenn Fablet  <youenn@apple.com>
1891
1892         Add API to clean CacheStorage data
1893         https://bugs.webkit.org/show_bug.cgi?id=178034
1894
1895         Reviewed by Chris Dumez.
1896
1897         Introducing a new website data type for DOMCache.
1898         Adding API to delete DOMCache for a given origin or for all origins.
1899         This is added to WKWebsiteDataStore.
1900
1901         Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live
1902         for the duration of the NetworkProcess.
1903         This allows ensuring that once a cache is cleaned, WebProcess will update to this new state.
1904
1905         Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data.
1906
1907         * NetworkProcess/NetworkProcess.cpp:
1908         (WebKit::fetchDOMCacheEntries):
1909         (WebKit::NetworkProcess::fetchWebsiteData):
1910         (WebKit::NetworkProcess::deleteWebsiteData):
1911         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1912         * NetworkProcess/cache/CacheStorageEngine.cpp:
1913         (WebKit::CacheStorage::Engine::cachesRootPath):
1914         (WebKit::CacheStorage::Engine::fetchEntries):
1915         (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler):
1916         (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler):
1917         (WebKit::CacheStorage::Engine::clearEngines):
1918         (WebKit::CacheStorage::Engine::clearCachesForOrigins):
1919         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1920         (WebKit::CacheStorage::deleteFolder):
1921         (WebKit::CacheStorage::Engine::clearCaches):
1922         (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data.
1923         * NetworkProcess/cache/CacheStorageEngine.h:
1924         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1925         (WebKit::CacheStorage::Caches::Caches):
1926         (WebKit::CacheStorage::Caches::clear):
1927         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1928         (WebKit::CacheStorage::Caches::create):
1929         * Shared/WebsiteData/WebsiteDataType.h:
1930         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1931         (WKWebsiteDataStoreRemoveAllDOMCaches):
1932         (WKWebsiteDataStoreRemoveDOMCacheForOrigin):
1933         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1934         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1935         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1936         (dataTypesToString):
1937         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1938         (WebKit::toWebsiteDataType):
1939         (WebKit::toWKWebsiteDataTypes):
1940         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1941         (+[WKWebsiteDataStore allWebsiteDataTypes]):
1942         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1943         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
1944         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
1945
1946 2017-10-11  Chris Dumez  <cdumez@apple.com>
1947
1948         [Geolocation] Expose Coordinates.floorLevel
1949         https://bugs.webkit.org/show_bug.cgi?id=178173
1950         <rdar://problem/34918936>
1951
1952         Reviewed by Ryosuke Niwa.
1953
1954         * UIProcess/API/C/WKGeolocationPosition.cpp:
1955         (WKGeolocationPositionCreate):
1956         (WKGeolocationPositionCreate_b):
1957         (WKGeolocationPositionCreate_c):
1958         * UIProcess/API/C/WKGeolocationPosition.h:
1959
1960 2017-10-11  Youenn Fablet  <youenn@apple.com>
1961
1962         Bump default cache storage quota to 20MB
1963         https://bugs.webkit.org/show_bug.cgi?id=178132
1964
1965         Reviewed by Alex Christensen.
1966
1967         Adding the ability to set the quota per origin through WebsiteDataStore.
1968         Moving cache storage directory setting also in WebsiteDataStore.
1969
1970         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1971         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
1972         * NetworkProcess/NetworkProcess.cpp:
1973         (WebKit::NetworkProcess::initializeNetworkProcess):
1974         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1975         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1976         * Shared/WebsiteDataStoreParameters.cpp:
1977         (WebKit::WebsiteDataStoreParameters::encode const):
1978         (WebKit::WebsiteDataStoreParameters::decode):
1979         * Shared/WebsiteDataStoreParameters.h:
1980         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1981         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1982         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1983         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1984         (API::ProcessPoolConfiguration::copy):
1985         * UIProcess/API/APIProcessPoolConfiguration.h:
1986         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1987         * UIProcess/API/C/WKContextConfigurationRef.h:
1988         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1989         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
1990         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
1991         (-[WKWebsiteDataStore _cacheStorageDirectory]):
1992         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
1993         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1994         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1995         * UIProcess/WebProcessPool.cpp:
1996         (WebKit::legacyWebsiteDataStoreConfiguration):
1997         (WebKit::WebProcessPool::ensureNetworkProcess):
1998         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
1999         * UIProcess/WebProcessPool.h:
2000         * UIProcess/WebsiteData/WebsiteDataStore.h:
2001         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
2002         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
2003         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
2004         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
2005
2006 2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
2007
2008         Allow PAL to log messages
2009         https://bugs.webkit.org/show_bug.cgi?id=171523
2010
2011         Reviewed by Alex Christensen.
2012
2013         * Platform/Logging.h:
2014         * Scripts/generate-forwarding-headers.pl:
2015
2016 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
2017
2018         Sanitize URL in pasteboard for other applications and cross origin content
2019         https://bugs.webkit.org/show_bug.cgi?id=178060
2020         <rdar://problem/34874518>
2021
2022         Reviewed by Wenson Hsieh.
2023
2024         Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess.
2025
2026         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2027         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2028         * UIProcess/WebPasteboardProxy.cpp:
2029         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2030         * UIProcess/WebPasteboardProxy.h:
2031         * UIProcess/WebPasteboardProxy.messages.in:
2032         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2033         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
2034         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2035
2036 2017-10-11  Chris Dumez  <cdumez@apple.com>
2037
2038         Modernize Geolocation code
2039         https://bugs.webkit.org/show_bug.cgi?id=178148
2040
2041         Reviewed by Ryosuke Niwa.
2042
2043         * Shared/WebGeolocationPosition.cpp:
2044         (WebKit::WebGeolocationPosition::create):
2045         (WebKit::WebGeolocationPosition::~WebGeolocationPosition):
2046         * Shared/WebGeolocationPosition.h:
2047         (WebKit::WebGeolocationPosition::timestamp const):
2048         (WebKit::WebGeolocationPosition::latitude const):
2049         (WebKit::WebGeolocationPosition::longitude const):
2050         (WebKit::WebGeolocationPosition::accuracy const):
2051         (WebKit::WebGeolocationPosition::altitude const):
2052         (WebKit::WebGeolocationPosition::altitudeAccuracy const):
2053         (WebKit::WebGeolocationPosition::heading const):
2054         (WebKit::WebGeolocationPosition::speed const):
2055         (WebKit::WebGeolocationPosition::corePosition const):
2056         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
2057         * UIProcess/API/C/WKGeolocationPosition.cpp:
2058         (WKGeolocationPositionCreate_b):
2059         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
2060         (WebKit::wrapper):
2061         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
2062         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
2063         * UIProcess/WebGeolocationManagerProxy.cpp:
2064         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
2065         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2066         (-[WKLegacyCoreLocationProvider positionChanged:]):
2067         * WebProcess/Geolocation/WebGeolocationManager.cpp:
2068         (WebKit::WebGeolocationManager::didChangePosition):
2069         * WebProcess/Geolocation/WebGeolocationManager.h:
2070         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
2071         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2072         (WebKit::WebGeolocationClient::lastPosition):
2073         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
2074
2075 2017-10-11  Brady Eidson  <beidson@apple.com>
2076
2077         Add a SW context process (where SW scripts will actually execute).
2078         https://bugs.webkit.org/show_bug.cgi?id=178156
2079
2080         Reviewed by Andy Estes.
2081
2082         This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.
2083
2084         This process is where ServiceWorker scripts will execute, separate from the client WebProcess
2085         hosting the page(s) they are serving.
2086
2087         This patch also adds all of the plumbing to pass along a fetched service worker script to this
2088         context WebProcess, as well as message back failure to actually start the script so we can test.
2089
2090         Touches lots of code sites but is basically just a lot of plumbing.
2091
2092         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2093         (WebKit::WebSWServerConnection::WebSWServerConnection):
2094         (WebKit::WebSWServerConnection::startServiceWorkerContext):
2095         (WebKit::WebSWServerConnection::sendToContextProcess):
2096         (WebKit::WebSWServerConnection::setContextConnection):
2097         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2098
2099         * StorageProcess/StorageProcess.cpp:
2100         (WebKit::StorageProcess::workerContextProcessConnection):
2101         (WebKit::StorageProcess::createWorkerContextProcessConnection):
2102         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
2103         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
2104         (WebKit::StorageProcess::registerSWServerConnection):
2105         (WebKit::StorageProcess::unregisterSWServerConnection):
2106         * StorageProcess/StorageProcess.h:
2107         * StorageProcess/StorageProcess.messages.in:
2108
2109         * StorageProcess/StorageToWebProcessConnection.cpp:
2110         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
2111         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2112         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
2113         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
2114         * StorageProcess/StorageToWebProcessConnection.h:
2115
2116         * UIProcess/Storage/StorageProcessProxy.cpp:
2117         (WebKit::StorageProcessProxy::create):
2118         (WebKit::StorageProcessProxy::StorageProcessProxy):
2119         (WebKit::StorageProcessProxy::didClose):
2120         (WebKit::StorageProcessProxy::getWorkerContextProcessConnection):
2121         (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection):
2122         * UIProcess/Storage/StorageProcessProxy.h:
2123         * UIProcess/Storage/StorageProcessProxy.messages.in:
2124
2125         * UIProcess/WebProcessPool.cpp:
2126         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2127         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2128         (WebKit::WebProcessPool::didGetWorkerContextProcessConnection):
2129         (WebKit::WebProcessPool::disconnectProcess):
2130         (WebKit::WebProcessPool::createWebPage):
2131         * UIProcess/WebProcessPool.h:
2132
2133         * UIProcess/WebProcessProxy.cpp:
2134         (WebKit::WebProcessProxy::didGetWorkerContextConnection):
2135         * UIProcess/WebProcessProxy.h:
2136         * UIProcess/WebProcessProxy.messages.in:
2137
2138         * WebProcess/WebProcess.cpp:
2139         (WebKit::WebProcess::getWorkerContextConnection):
2140         (WebKit::WebProcess::startServiceWorkerContext):
2141         * WebProcess/WebProcess.h:
2142         * WebProcess/WebProcess.messages.in:
2143
2144 2017-10-11  Don Olmstead  <don.olmstead@sony.com>
2145
2146         Remove ENABLE_NETWORK_CACHE
2147         https://bugs.webkit.org/show_bug.cgi?id=177424
2148
2149         Reviewed by Antti Koivisto.
2150
2151         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2152         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
2153         * NetworkProcess/NetworkConnectionToWebProcess.h:
2154         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2155         * NetworkProcess/NetworkProcess.cpp:
2156         (WebKit::fetchDiskCacheEntries):
2157         (WebKit::clearDiskCacheEntries):
2158         (WebKit::NetworkProcess::setCacheModel):
2159         * NetworkProcess/NetworkProcess.h:
2160         (WebKit::NetworkProcess::cache):
2161         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2162         (WebKit::NetworkProcessCreationParameters::encode const):
2163         (WebKit::NetworkProcessCreationParameters::decode):
2164         * NetworkProcess/NetworkProcessCreationParameters.h:
2165         * NetworkProcess/NetworkResourceLoader.cpp:
2166         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2167         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
2168         (WebKit::NetworkResourceLoader::start):
2169         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2170         (WebKit::NetworkResourceLoader::startNetworkLoad):
2171         (WebKit::NetworkResourceLoader::abort):
2172         (WebKit::NetworkResourceLoader::didReceiveResponse):
2173         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2174         (WebKit::NetworkResourceLoader::didFinishLoading):
2175         (WebKit::NetworkResourceLoader::didFailLoading):
2176         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2177         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2178         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
2179         * NetworkProcess/NetworkResourceLoader.h:
2180         * NetworkProcess/cache/NetworkCache.cpp:
2181         * NetworkProcess/cache/NetworkCache.h:
2182         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2183         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
2184         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2185         * NetworkProcess/cache/NetworkCacheCoders.h:
2186         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
2187         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
2188         * NetworkProcess/cache/NetworkCacheData.cpp:
2189         * NetworkProcess/cache/NetworkCacheData.h:
2190         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2191         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
2192         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2193         * NetworkProcess/cache/NetworkCacheEntry.h:
2194         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2195         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2196         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2197         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2198         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2199         * NetworkProcess/cache/NetworkCacheKey.cpp:
2200         * NetworkProcess/cache/NetworkCacheKey.h:
2201         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2202         * NetworkProcess/cache/NetworkCacheStatistics.h:
2203         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2204         * NetworkProcess/cache/NetworkCacheStorage.h:
2205         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2206         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2207         (WebKit::NetworkProcess::clearDiskCache):
2208         * NetworkProcess/ios/NetworkProcessIOS.mm:
2209         (WebKit::NetworkProcess::clearCacheForAllOrigins):
2210         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2211         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2212         (WebKit::NetworkProcess::clearDiskCache):
2213         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2214         (WebKit::registerUserDefaultsIfNeeded):
2215         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2216         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2217         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2218         * UIProcess/soup/WebProcessPoolSoup.cpp:
2219         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2220         * WebProcess/Network/WebLoaderStrategy.cpp:
2221         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
2222         * config.h:
2223
2224 2017-10-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2225
2226         Unreviewed, rolling out r223146.
2227
2228         Better to not expose cairo in the WPE API
2229
2230         Reverted changeset:
2231
2232         "[WPE] Header cairo.h is used in GLib API headers but cannot
2233         be found"
2234         https://bugs.webkit.org/show_bug.cgi?id=178100
2235         http://trac.webkit.org/changeset/223146
2236
2237 2017-09-27  Frederic Wang  <fwang@igalia.com>
2238
2239         [iOS] Do not flatten frames when async frame scrolling is enabled
2240         https://bugs.webkit.org/show_bug.cgi?id=173704
2241
2242         Reviewed by Simon Fraser.
2243
2244         This patch disables frame flattening when async frame scrolling is enabled on iOS, as
2245         otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
2246         developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
2247         in the "Experimental WebKit Features" menu of Safari iOS.
2248
2249         Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
2250
2251         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2252         (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
2253         Source/WebCore.
2254
2255 2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>
2256
2257         Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
2258         https://bugs.webkit.org/show_bug.cgi?id=178154
2259
2260         Reviewed by Wenson Hsieh.
2261
2262         Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner.
2263
2264         * Shared/WebPreferencesDefinitions.h:
2265         * UIProcess/API/C/WKPreferences.cpp:
2266         (WKPreferencesSetCustomPasteboardDataEnabled):
2267         (WKPreferencesGetCustomPasteboardDataEnabled):
2268         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2269         * WebProcess/WebPage/WebPage.cpp:
2270         (WebKit::WebPage::updatePreferences):
2271
2272 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2273
2274         [WPE] Remove the possibility of installing the old WebKit2 C API
2275         https://bugs.webkit.org/show_bug.cgi?id=178125
2276
2277         Reviewed by Michael Catanzaro.
2278
2279         * PlatformWPE.cmake: Remove support for installing the deprecated C API.
2280
2281 2017-10-10  Chris Dumez  <cdumez@apple.com>
2282
2283         [WK2] Add API to clear service worker registrations
2284         https://bugs.webkit.org/show_bug.cgi?id=178085
2285         <rdar://problem/34866025>
2286
2287         Reviewed by Ryosuke Niwa.
2288
2289         Add API to clear service worker registrations. Although the request to
2290         clear the registration is passed on to the StorageProcess, it is currently
2291         a no-op on StorageProcess side until we actually persist service worker
2292         registrations on disk.
2293
2294         * Shared/WebsiteData/WebsiteDataType.h:
2295         * StorageProcess/StorageProcess.cpp:
2296         (WebKit::StorageProcess::fetchWebsiteData):
2297         (WebKit::StorageProcess::deleteWebsiteData):
2298         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2299         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2300         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
2301         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2302         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2303         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2304         (dataTypesToString):
2305         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2306         (WebKit::toWebsiteDataType):
2307         (WebKit::toWKWebsiteDataTypes):
2308         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2309         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2310         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2311         (WebKit::WebsiteDataStore::fetchDataAndApply):
2312         (WebKit::WebsiteDataStore::removeData):
2313
2314 2017-10-10  Commit Queue  <commit-queue@webkit.org>
2315
2316         Unreviewed, rolling out r223130.
2317         https://bugs.webkit.org/show_bug.cgi?id=178147
2318
2319         Breaks the build when EGLNativeWindowType is a pointer
2320         (Requested by aperezdc on #webkit).
2321
2322         Reverted changeset:
2323
2324         "[WPE] Build failure due to invalid cast of
2325         EGLNativeWindowType when targetting 64-bit ARM"
2326         https://bugs.webkit.org/show_bug.cgi?id=178090
2327         http://trac.webkit.org/changeset/223130
2328
2329 2017-10-10  Sam Weinig  <sam@webkit.org>
2330
2331         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
2332         https://bugs.webkit.org/show_bug.cgi?id=178102
2333
2334         Reviewed by Tim Horton.
2335
2336         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2337         (WebKit::NetworkConnectionToWebProcess::didClose):
2338         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2339         (WebKit::dumpChangedLayers):
2340         * UIProcess/API/glib/WebKitWebContext.cpp:
2341         (webkitWebContextInvalidateCustomProtocolRequests):
2342         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2343         (webkitWebViewBaseContainerForall):
2344         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2345         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
2346         * UIProcess/GenericCallback.h:
2347         (WebKit::invalidateCallbackMap):
2348         * UIProcess/WebProcessProxy.cpp:
2349         (WebKit::WebProcessProxy::shutDown):
2350         (WebKit::WebProcessProxy::didClose):
2351         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2352         (WebKit::WebProcessProxy::didBecomeResponsive):
2353         (WebKit::WebProcessProxy::willChangeIsResponsive):
2354         (WebKit::WebProcessProxy::didChangeIsResponsive):
2355         (WebKit::WebProcessProxy::disconnectFramesFromPage):
2356         (WebKit::WebProcessProxy::frameCountInPage const):
2357         (WebKit::WebProcessProxy::requestTermination):
2358         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2359         (WebKit::NPRuntimeObjectMap::invalidate):
2360         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2361         (WebKit::NetscapePlugin::stopAllStreams):
2362         * WebProcess/Plugins/PluginView.cpp:
2363         (WebKit::PluginView::cancelAllStreams):
2364         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2365         (WebKit::RemoteLayerTreeContext::buildTransaction):
2366         * WebProcess/WebProcess.cpp:
2367         (WebKit::WebProcess::didClose):
2368
2369 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2370
2371         [WPE] Header cairo.h is used in GLib API headers but cannot be found
2372         https://bugs.webkit.org/show_bug.cgi?id=178100
2373
2374         Reviewed by Michael Catanzaro.
2375
2376         * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled
2377         in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found.
2378
2379 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2380
2381         CSS constant properties should not be enabled by default
2382         https://bugs.webkit.org/show_bug.cgi?id=177416
2383
2384         Reviewed by Darin Adler.
2385
2386         * Shared/WebPreferencesDefinitions.h:
2387
2388 2017-10-10  Brady Eidson  <beidson@apple.com>
2389
2390         Random StorageProcess and SWServer cleanup.
2391         https://bugs.webkit.org/show_bug.cgi?id=178141
2392
2393         Reviewed by Andy Estes.
2394
2395         -StorageProcess should own the set of SWServers
2396         -Some renaming and cleanup
2397
2398         * StorageProcess/StorageProcess.cpp:
2399         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2400         (WebKit::StorageProcess::swServerForSession):
2401         * StorageProcess/StorageProcess.h:
2402         (WebKit::StorageProcess::queue):
2403
2404         * StorageProcess/StorageToWebProcessConnection.cpp:
2405         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2406         * StorageProcess/StorageToWebProcessConnection.h:
2407
2408 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2409
2410         Unreviewed, rolling out r223136.
2411
2412         Forgot to update GTK API header
2413
2414         Reverted changeset:
2415
2416         "[WPE] Header cairo.h is used in GLib API headers but cannot
2417         be found"
2418         https://bugs.webkit.org/show_bug.cgi?id=178100
2419         http://trac.webkit.org/changeset/223136
2420
2421 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2422
2423         [WPE] Header cairo.h is used in GLib API headers but cannot be found
2424         https://bugs.webkit.org/show_bug.cgi?id=178100
2425
2426         Reviewed by Žan Doberšek.
2427
2428         Instead of including <cairo.h>, it is better to forward-declare cairo_surface_t,
2429         which is the one and only Cairo declaration needed by the WPE API header.
2430
2431         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of <cairo.h>.
2432         * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of <cairo.h>.
2433         * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t.
2434
2435 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2436
2437         [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc
2438         https://bugs.webkit.org/show_bug.cgi?id=178133
2439
2440         Reviewed by Žan Doberšek.
2441
2442         * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires".
2443
2444 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2445
2446         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
2447         https://bugs.webkit.org/show_bug.cgi?id=178090
2448
2449         Reviewed by Žan Doberšek.
2450
2451         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
2452         (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast,
2453         this way extending values of EGLNativeWindowType to 64 bits is allowed.
2454
2455 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2456
2457         [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed
2458         https://bugs.webkit.org/show_bug.cgi?id=178104
2459
2460         Reviewed by Žan Doberšek.
2461
2462         * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable.
2463
2464 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
2465
2466         [WPE][CMake] The “install” target should install all public API headers
2467         https://bugs.webkit.org/show_bug.cgi?id=176475
2468
2469         Reviewed by Žan Doberšek.
2470
2471         Install the WPE port GLib-based API headers. The deprecated C API is still available,
2472         but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option.
2473
2474         * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE.
2475
2476 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
2477
2478         Fix typo of virtual keyword in PageClientImplIOS.h
2479         https://bugs.webkit.org/show_bug.cgi?id=178088
2480
2481         Reviewed by Simon Fraser.
2482
2483         This compile error happens when FULLSCREEN_API is enabled for iOS.
2484         Remove the redundant virtual keyword since function is marked override.
2485
2486         * UIProcess/ios/PageClientImplIOS.h:
2487
2488 2017-10-09  Chris Dumez  <cdumez@apple.com>
2489
2490         [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess
2491         https://bugs.webkit.org/show_bug.cgi?id=178095
2492         <rdar://problem/34415016>
2493
2494         Reviewed by Simon Fraser.
2495
2496         Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit.
2497         _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because
2498         WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally,
2499         _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that
2500         resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid]
2501         (which is true when the WebProcess has crashed.
2502
2503         Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even
2504         though it does not seem to be the cause of this bug. It seems to make sense to reset this member
2505         when the process crashes.
2506
2507         * UIProcess/API/Cocoa/WKWebView.mm:
2508         (-[WKWebView _processDidExit]):
2509
2510 2017-10-09  Youenn Fablet  <youenn@apple.com>
2511
2512         Add quota to cache API
2513         https://bugs.webkit.org/show_bug.cgi?id=177552
2514
2515         Reviewed by Alex Christensen.
2516
2517         Adding support for quota checking in CacheStorage::Caches.
2518         It is passed to NetworkProcess at creation time.
2519         Default quota size is configured to 400Ko by origin per default.
2520         This value is suitable for testing.
2521         Future patch should raise this default value and allows configuring it.
2522
2523         Quota is computed based on the response body size.
2524         This size is padded at WebCore for opaque responses.
2525         Size is stored persistently as opaque response padded size should remain stable.
2526         See https://github.com/whatwg/storage/issues/31 for the rationale about this padding.
2527
2528         In case of putting several records at the same time, the size of all records
2529         is computed so that all records will be written or rejected together.
2530
2531         Sending QuotaExceeded error when quota is exceeded.
2532         Future effort should allow asking UIProcess for quota extension.
2533
2534         * NetworkProcess/NetworkProcess.cpp:
2535         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const):
2536         * NetworkProcess/NetworkProcess.h:
2537         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2538         (WebKit::NetworkProcessCreationParameters::encode const):
2539         (WebKit::NetworkProcessCreationParameters::decode):
2540         * NetworkProcess/NetworkProcessCreationParameters.h:
2541         * NetworkProcess/cache/CacheStorageEngine.cpp:
2542         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2543         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2544         (WebKit::CacheStorage::Cache::toRecordInformation):
2545         (WebKit::CacheStorage::isolatedCopy):
2546         (WebKit::CacheStorage::Cache::open):
2547         (WebKit::CacheStorage::Cache::storeRecords):
2548         (WebKit::CacheStorage::Cache::put):
2549         (WebKit::CacheStorage::Cache::writeRecordToDisk):
2550         (WebKit::CacheStorage::Cache::updateRecordToDisk):
2551         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
2552         (WebKit::CacheStorage::Cache::encode):
2553         (WebKit::CacheStorage::Cache::decodeRecordHeader):
2554         (WebKit::CacheStorage::Cache::decode):
2555         * NetworkProcess/cache/CacheStorageEngineCache.h:
2556         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2557         (WebKit::CacheStorage::Caches::Caches):
2558         (WebKit::CacheStorage::Caches::initialize):
2559         (WebKit::CacheStorage::Caches::initializeSize):
2560         (WebKit::CacheStorage::Caches::requestSpace):
2561         (WebKit::CacheStorage::Caches::writeRecord):
2562         (WebKit::CacheStorage::Caches::removeRecord):
2563         (WebKit::CacheStorage::Caches::removeCacheEntry):
2564         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2565         (WebKit::CacheStorage::Caches::create):
2566         (WebKit::CacheStorage::Caches::hasEnoughSpace const):
2567         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2568         (WebKit::NetworkCache::Storage::traverse):
2569         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2570         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2571         * Shared/WebCoreArgumentCoders.cpp:
2572         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
2573         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
2574         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2575         (API::ProcessPoolConfiguration::copy):
2576         * UIProcess/API/APIProcessPoolConfiguration.h:
2577         * UIProcess/WebProcessPool.cpp:
2578         (WebKit::WebProcessPool::ensureNetworkProcess):
2579
2580 2017-10-09  Sam Weinig  <sam@webkit.org>
2581
2582         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
2583         https://bugs.webkit.org/show_bug.cgi?id=178072
2584
2585         Reviewed by Darin Adler.
2586
2587         * Shared/AsyncRequest.h:
2588         (WebKit::AsyncRequestMap::values):
2589         * UIProcess/WebProcessProxy.h:
2590         (WebKit::WebProcessProxy::pages const):
2591
2592             Update for type change for HashMap::values().
2593
2594 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
2595
2596         Incorrect fullscreen animation when element has a transform.
2597         https://bugs.webkit.org/show_bug.cgi?id=177558
2598         rdar://problem/29603741
2599
2600         Reviewed by Jer Noble.
2601
2602         Use a bit of code from element fullscreen to do this correctly for video fullscreen.
2603         The key is to get the absolute quad from the renderer. This will work for scaling,
2604         But since we still take the bounding box, it won't work for rotations.
2605
2606         * WebProcess/cocoa/VideoFullscreenManager.mm:
2607         (WebKit::inlineVideoFrame):
2608
2609 2017-10-09  Robin Morisset  <rmorisset@apple.com>
2610
2611         Make the names of the options consistent
2612         https://bugs.webkit.org/show_bug.cgi?id=177933
2613
2614         Reviewed by Saam Barati.
2615
2616         * NetworkProcess/capture/json.hpp:
2617         * Platform/IPC/Connection.cpp:
2618         (IPC::Connection::connectionDidClose):
2619         * UIProcess/API/Cocoa/WKWebView.mm:
2620         (-[WKWebView _keyboardWillHide:]):
2621         * UIProcess/WebPageProxy.cpp:
2622         (WebKit::WebPageProxy::runModal):
2623         * UIProcess/mac/WebInspectorProxyMac.mm:
2624         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2625         * WebProcess/WebPage/ios/WebPageIOS.mm:
2626         (WebKit::WebPage::selectWithGesture):
2627
2628 2017-10-09  Adrian Perez de Castro  <aperez@igalia.com>
2629
2630         [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config
2631         https://bugs.webkit.org/show_bug.cgi?id=178081
2632
2633         Reviewed by Carlos Alberto Lopez Perez.
2634
2635         * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit.
2636
2637 2017-10-08  Tim Horton  <timothy_horton@apple.com>
2638
2639         mediaPlaybackRequiresUserAction API replacement annotation is wrong
2640         https://bugs.webkit.org/show_bug.cgi?id=178063
2641
2642         Reviewed by Dan Bernstein.
2643
2644         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2645         mediaPlaybackRequiresUserAction suggests that you should use 
2646         requiresUserActionForMediaPlayback instead, but that is also deprecated.
2647         Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback.
2648
2649 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2650
2651         [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners
2652         https://bugs.webkit.org/show_bug.cgi?id=178037
2653
2654         Reviewed by Tim Horton.
2655
2656         This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required
2657         to implement -[WKContentView insertTextSuggestion:].
2658
2659         * Platform/spi/ios/UIKitSPI.h:
2660         * UIProcess/ios/WKContentViewInteraction.mm:
2661         (-[WKContentView insertTextSuggestion:]):
2662
2663 2017-10-06  Chris Dumez  <cdumez@apple.com>
2664
2665         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
2666         https://bugs.webkit.org/show_bug.cgi?id=178027
2667         <rdar://problem/34748470>
2668
2669         Reviewed by Youenn Fablet.
2670
2671         Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to
2672         make sure that CFNetwork never adds a Content-Type HTTP headers to our requests
2673         when we did not add one.
2674
2675         This is covered by the following tests on newer OSes:
2676         - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html
2677         - http/tests/blink/sendbeacon/beacon-same-origin.html
2678
2679         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2680         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2681
2682 2017-10-06  Aishwarya Nirmal  <anirmal@apple.com>
2683
2684         [iOS] Respect the "caret-color" CSS property when editing 
2685         https://bugs.webkit.org/show_bug.cgi?id=177489
2686         <rdar://problem/34600419>
2687
2688         Reviewed by Tim Horton.
2689
2690         This change adds support for the caret-color property on iOS.
2691
2692         * Shared/EditorState.cpp:
2693         (WebKit::EditorState::PostLayoutData::encode const):
2694         (WebKit::EditorState::PostLayoutData::decode):
2695         * Shared/EditorState.h:
2696         * UIProcess/ios/WKContentViewInteraction.mm:
2697         (-[WKContentView insertionPointColor]):
2698         * WebProcess/WebPage/ios/WebPageIOS.mm:
2699         (WebKit::WebPage::platformEditorState const):
2700
2701 2017-10-06  Brian Burg  <bburg@apple.com>
2702
2703         Web Inspector: clicking in Inspector webview clears the selection in the inspected page
2704         https://bugs.webkit.org/show_bug.cgi?id=178014
2705         <rdar://problem/12706857>
2706
2707         Reviewed by Timothy Hatcher.
2708
2709         If the Inspector is docked to the inspected view, clicking on the Inspector
2710         webview will cause selection in the inspected view to be lost. This is because
2711         the selection is lost when the web view resigns first responder.
2712
2713         Add a check in maintainsInactiveSelection to always retain selection if
2714         Web Inspector is open. This approach seems simpler than trying to sync a client's
2715         usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied
2716         and unapplied when an inspector web view is shown or hidden.
2717
2718         * UIProcess/WebPageProxy.cpp:
2719         (WebKit::WebPageProxy::maintainsInactiveSelection const):
2720         (WebKit::WebPageProxy::inspector const): Drive by, use nullptr.
2721
2722         * UIProcess/WebPageProxy.h:
2723         (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted.
2724
2725 2017-10-06  Alex Christensen  <achristensen@webkit.org>
2726
2727         Add more infrastructure to apply custom headers to same-origin requests
2728         https://bugs.webkit.org/show_bug.cgi?id=177629
2729
2730         Reviewed by Ryosuke Niwa.
2731
2732         * UIProcess/API/C/WKWebsitePolicies.cpp:
2733         (WKWebsitePoliciesCopyCustomHeaderFields):
2734         (WKWebsitePoliciesSetCustomHeaderFields):
2735         * UIProcess/API/C/WKWebsitePolicies.h:
2736         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2737         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2738         (-[_WKWebsitePolicies customHeaderFields]):
2739         (-[_WKWebsitePolicies setCustomHeaderFields:]):
2740
2741         Make the SPI for setting custom header fields take a dictionary<String, String>
2742         instead of an array of Strings with colons. This matches NSURLRequest and other
2743         APIs that deal with header fields.
2744
2745 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2746
2747         [iOS] Tweak support for classifying form controls (followup to r222487)
2748         https://bugs.webkit.org/show_bug.cgi?id=177917
2749         <rdar://problem/34820122>
2750
2751         Reviewed by Dean Jackson.
2752
2753         This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
2754         implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
2755         issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
2756         assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
2757         more detail.
2758
2759         * UIProcess/WebPageProxy.h:
2760
2761         Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
2762         retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
2763         else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
2764         assisted node information.
2765
2766         This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
2767         to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.
2768
2769         * UIProcess/ios/WKContentView.mm:
2770         (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
2771         (-[WKContentView representingPageURL]): Deleted.
2772         * UIProcess/ios/WKContentViewInteraction.mm:
2773         (-[WKContentView _autofillContext]):
2774
2775         Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
2776         containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
2777         credentials, and there exists a representing page URL.
2778
2779         When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
2780         additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
2781         resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
2782         value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
2783         that all members but the element type in the content view's assisted node information could be stale, so this
2784         seems worthy of some investigation.
2785
2786         * UIProcess/ios/WebPageProxyIOS.mm:
2787         (WebKit::WebPageProxy::startAssistingNode):
2788         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
2789         (WebKit::WebPageProxy::representingPageURL): Deleted.
2790
2791 2017-10-06  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2792
2793         [WinCairo] Add shared curl files
2794         https://bugs.webkit.org/show_bug.cgi?id=177999
2795
2796         Reviewed by Alex Christensen.
2797
2798         * PlatformWin.cmake:
2799         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
2800         (WebKit::AuthenticationManager::receivedCredential):
2801         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2802         (WebKit::AuthenticationManager::receivedCancellation):
2803         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2804         (WebKit::AuthenticationManager::receivedChallengeRejection):
2805         * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
2806         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2807         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2808         (IPC::ArgumentCoder<CertificateInfo>::encode):
2809         (IPC::ArgumentCoder<CertificateInfo>::decode):
2810         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
2811         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
2812         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
2813         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
2814         (IPC::ArgumentCoder<Credential>::encodePlatformData):
2815         (IPC::ArgumentCoder<Credential>::decodePlatformData):
2816
2817 2017-10-06  Brent Fulgham  <bfulgham@apple.com>
2818
2819         Sandbox rules block PluginProcess using "File Open/Save" dialogs
2820         https://bugs.webkit.org/show_bug.cgi?id=177965
2821         <rdar://problem/33976846>
2822
2823         Reviewed by Alexey Proskuryakov.
2824
2825         Update the PluginProcess sandboxes to allow the same XPC services as
2826         the WebContent process. Also allow access to the openAndSavePanelServices.
2827
2828         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 
2829
2830 2017-10-06  Brady Eidson  <beidson@apple.com>
2831
2832         Add (entirely incorrect) fetching of ServiceWorker scripts.
2833         https://bugs.webkit.org/show_bug.cgi?id=176179
2834
2835         Reviewed by Andy Estes.
2836
2837         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2838         (WebKit::WebSWServerConnection::startScriptFetchInClient):
2839         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2840         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2841
2842         * WebProcess/Storage/WebSWClientConnection.cpp:
2843         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
2844         * WebProcess/Storage/WebSWClientConnection.h:
2845         * WebProcess/Storage/WebSWClientConnection.messages.in:
2846
2847 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2848
2849         [GTK][WPE] Add API to configure and enable resource load statistics
2850         https://bugs.webkit.org/show_bug.cgi?id=177943
2851
2852         Reviewed by Michael Catanzaro.
2853
2854         Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
2855         stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
2856         Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.
2857
2858         * UIProcess/API/glib/WebKitWebContext.cpp:
2859         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
2860         (webkitWebContextConstructed):
2861         * UIProcess/API/glib/WebKitWebsiteData.cpp:
2862         (recordContainsSupportedDataTypes):
2863         (toWebKitWebsiteDataTypes):
2864         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2865         (webkitWebsiteDataManagerGetProperty):
2866         (webkitWebsiteDataManagerSetProperty):
2867         (webkitWebsiteDataManagerConstructed):
2868         (webkit_website_data_manager_class_init):
2869         (webkitWebsiteDataManagerGetDataStore):
2870         (webkit_website_data_manager_get_resource_load_stats_directory):
2871         (webkit_website_data_manager_set_resource_load_stats_enabled):
2872         (webkit_website_data_manager_get_resource_load_stats_enabled):
2873         (toWebsiteDataTypes):
2874         * UIProcess/API/gtk/WebKitWebsiteData.h:
2875         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
2876         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2877         * UIProcess/API/wpe/WebKitWebsiteData.h:
2878         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
2879
2880 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2881
2882         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
2883         https://bugs.webkit.org/show_bug.cgi?id=168171
2884
2885         Reviewed by Chris Dumez.
2886
2887         Add C API to handle all resource load statistics requests made by the layout tests.
2888
2889         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2890         (WKWebsiteDataStoreSetStatisticsLastSeen):
2891         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
2892         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
2893         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
2894         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
2895         (WKWebsiteDataStoreSetStatisticsGrandfathered):
2896         (WKWebsiteDataStoreIsStatisticsGrandfathered):
2897         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
2898         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
2899         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
2900         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
2901         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
2902         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
2903         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
2904         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
2905         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
2906         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
2907         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
2908         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
2909         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
2910         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
2911         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
2912         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
2913         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2914         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2915         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
2916         (WKWebsiteDataStoreStatisticsResetToConsistentState):
2917         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2918
2919 2017-10-05  Tim Horton  <timothy_horton@apple.com>
2920
2921         Fix the Mac CMake build
2922         https://bugs.webkit.org/show_bug.cgi?id=177985
2923
2924         Unreviewed build fix.
2925
2926         * CMakeLists.txt:
2927         * PlatformMac.cmake:
2928         After r222917, there's one more piece of WebKitSystemInterface left.
2929         And some missing bits of PaymentRequest.
2930
2931 2017-10-05  Keith Miller  <keith_miller@apple.com>
2932
2933         Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.
2934
2935         * Configurations/Base.xcconfig:
2936
2937 2017-10-05  Jer Noble  <jer.noble@apple.com>
2938
2939         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
2940         https://bugs.webkit.org/show_bug.cgi?id=177261
2941
2942         Reviewed by Eric Carlson.
2943
2944         * Configurations/FeatureDefines.xcconfig:
2945
2946 2017-10-05  Alex Christensen  <achristensen@webkit.org>
2947
2948         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
2949         https://bugs.webkit.org/show_bug.cgi?id=177966
2950         <rdar://problem/22387135>
2951
2952         Reviewed by Tim Horton.
2953
2954         * UIProcess/API/APINavigationClient.h:
2955         (API::NavigationClient::didChangeBackForwardList):
2956         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2957         * UIProcess/Cocoa/NavigationState.h:
2958         * UIProcess/Cocoa/NavigationState.mm:
2959         (WebKit::NavigationState::setNavigationDelegate):
2960         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
2961         (WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
2962         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
2963         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
2964         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
2965         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
2966         (WebKit::NavigationState::NavigationClient::processDidTerminate):
2967         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
2968         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
2969         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
2970         (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
2971         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
2972         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
2973         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
2974         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
2975         * UIProcess/WebPageProxy.cpp:
2976         (WebKit::WebPageProxy::didChangeBackForwardList):
2977
2978 2017-10-05  Alex Christensen  <achristensen@webkit.org>
2979
2980         Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
2981         https://bugs.webkit.org/show_bug.cgi?id=177974
2982         <rdar://problem/22888802>
2983
2984         Reviewed by Tim Horton.
2985
2986         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2987         * UIProcess/Cocoa/NavigationState.h:
2988         * UIProcess/Cocoa/NavigationState.mm:
2989         (WebKit::NavigationState::setNavigationDelegate):
2990         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2991         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
2992         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
2993         * UIProcess/Cocoa/UIDelegate.mm:
2994         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
2995
2996 2017-10-05  John Wilander  <wilander@apple.com>
2997
2998         Storage Access API: Web process should ask UI process for grant/deny
2999         https://bugs.webkit.org/show_bug.cgi?id=176941
3000         <rdar://problem/34440036>
3001
3002         Reviewed by Chris Dumez and Sam Weinig.
3003
3004         This patch adds infrastructure to let WebCore::Document call
3005         WebKit::WebResourceLoadStatisticsStore and ask for storage
3006         access on behalf of an iframe. The communication goes through
3007         the ChromeClient since we might want to add a native prompt.
3008         From the ChromeClient it continues to the WebPage which
3009         messages the WebPageProxy. The WebPageProxy calls the
3010         WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
3011         A uint64_t is used to match the right callback with the boolean
3012         result.
3013
3014         * UIProcess/WebPageProxy.cpp:
3015         (WebKit::WebPageProxy::requestStorageAccess):
3016         * UIProcess/WebPageProxy.h:
3017         * UIProcess/WebPageProxy.messages.in:
3018         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3019         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3020         * UIProcess/WebResourceLoadStatisticsStore.h:
3021         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3022         (WebKit::WebsiteDataStore::requestStorageAccess):
3023         * UIProcess/WebsiteData/WebsiteDataStore.h:
3024         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3025         (WebKit::WebChromeClient::requestStorageAccess):
3026         * WebProcess/WebCoreSupport/WebChromeClient.h:
3027         * WebProcess/WebPage/WebPage.cpp:
3028         (WebKit::nextRequestStorageAccessContextId):
3029         (WebKit::WebPage::requestStorageAccess):
3030         (WebKit::WebPage::storageAccessResponse):
3031         * WebProcess/WebPage/WebPage.h:
3032         * WebProcess/WebPage/WebPage.messages.in:
3033
3034 2017-10-05  Chris Dumez  <cdumez@apple.com>
3035
3036         Drop unused parameters for CookiesStrategy::cookiesEnabled()
3037         https://bugs.webkit.org/show_bug.cgi?id=177957
3038
3039         Reviewed by Alex Christensen.
3040
3041         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3042         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
3043         * NetworkProcess/NetworkConnectionToWebProcess.h:
3044         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3045         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3046         (WebKit::WebPlatformStrategies::cookiesEnabled):
3047         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3048
3049 2017-10-05  Tim Horton  <timothy_horton@apple.com>
3050
3051         Make progress toward properly-formed XPC services in the Mac CMake build
3052         https://bugs.webkit.org/show_bug.cgi?id=177918
3053
3054         Reviewed by Alex Christensen.
3055
3056         * CMakeLists.txt:
3057         * PlatformMac.cmake:
3058         Turn on the storage process on Mac, and fix its build.
3059         Move XPC services to Versions/A/XPCServices and add the toplevel
3060         XPCServices as a symlink of that.
3061         Run the XPC services' Info.plists through configure_file, and substitute
3062         the important variables (most critically the bundle identifier).
3063         Factor out the service setup so we don't keep duplicating it as it
3064         gets more complicated.
3065
3066 2017-10-05  Andy Estes  <aestes@apple.com>
3067
3068         [Payment Request] Add a payment method that supports Apple Pay
3069         https://bugs.webkit.org/show_bug.cgi?id=177850
3070
3071         Reviewed by Youenn Fablet.
3072
3073         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3074         (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
3075         (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
3076         -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
3077         (WebKit::toPKPaymentSummaryItem):
3078         (WebKit::toPKShippingMethod):
3079
3080 2017-10-05  Youenn Fablet  <youenn@apple.com>
3081
3082         Make LibWebRTCProvider port agnostic
3083         https://bugs.webkit.org/show_bug.cgi?id=177747
3084
3085         Reviewed by Alex Christensen & Alex Garcia.
3086
3087         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.
3088
3089 2017-10-04  Alex Christensen  <achristensen@webkit.org>
3090
3091         Stop linking with WebKitSystemInterface
3092         https://bugs.webkit.org/show_bug.cgi?id=177915
3093
3094         Reviewed by Antti Koivisto.
3095
3096         * Configurations/DebugRelease.xcconfig:
3097         * WebKit.xcodeproj/project.pbxproj:
3098
3099 2017-10-04  Alex Christensen  <achristensen@webkit.org>
3100
3101         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
3102         https://bugs.webkit.org/show_bug.cgi?id=177912
3103
3104         Reviewed by Saam Barati.
3105
3106         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3107         * NetworkProcess/mac/NetworkProcessMac.mm:
3108         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3109         * Platform/IPC/mac/ConnectionMac.mm:
3110         * Platform/mac/LayerHostingContext.mm:
3111         * PluginProcess/mac/PluginProcessMac.mm:
3112         * PluginProcess/mac/PluginProcessShim.mm:
3113         * Shared/ios/ChildProcessIOS.mm:
3114         * Shared/mac/ChildProcessMac.mm:
3115         * Shared/mac/SandboxExtensionMac.mm:
3116         * Shared/mac/WebCoreArgumentCodersMac.mm:
3117         * Shared/mac/WebEventFactory.mm:
3118         * StorageProcess/ios/StorageProcessIOS.mm:
3119         * StorageProcess/mac/StorageProcessMac.mm:
3120         * UIProcess/API/Cocoa/WKWebView.mm:
3121         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3122         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3123         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3124         * UIProcess/Cocoa/WebViewImpl.mm:
3125         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3126         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3127         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3128         * UIProcess/mac/PageClientImplMac.mm:
3129         * UIProcess/mac/WKTextInputWindowController.mm:
3130         * UIProcess/mac/WebContextMenuProxyMac.mm:
3131         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3132         * UIProcess/mac/WindowServerConnection.mm:
3133         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3134         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
3135         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3136         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3137         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3138         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3139         * WebProcess/WebPage/ios/WebPageIOS.mm:
3140         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
3141         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
3142         * WebProcess/WebPage/mac/WebPageMac.mm:
3143         * WebProcess/cocoa/WebProcessCocoa.mm:
3144
3145 2017-10-04  Youenn Fablet  <youenn@apple.com>
3146
3147         rtc::PacketOptions should have its own IPC encoding/decoding routines
3148         https://bugs.webkit.org/show_bug.cgi?id=177812
3149
3150         Reviewed by Alex Christensen.
3151
3152         Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
3153         Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
3154         Updating code using rtc::PacketOptions accordingly.
3155
3156         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
3157         (WebKit::NetworkRTCSocket::sendTo):
3158         * NetworkProcess/webrtc/NetworkRTCSocket.h:
3159         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
3160         * Platform/IPC/Decoder.cpp:
3161         (IPC::Decoder::operator>>):
3162         (IPC::Decoder::decode):
3163         * Platform/IPC/Decoder.h:
3164         * Platform/IPC/Encoder.cpp:
3165         (IPC::Encoder::encode):
3166         * Platform/IPC/Encoder.h:
3167         * Shared/RTCPacketOptions.cpp: Added.
3168         (WebKit::RTCPacketOptions::encode const):
3169         (WebKit::RTCPacketOptions::decode):
3170         * Shared/RTCPacketOptions.h: Added.
3171         * WebKit.xcodeproj/project.pbxproj:
3172         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3173         (WebKit::LibWebRTCSocket::SendTo):
3174
3175 2017-10-04  Don Olmstead  <don.olmstead@sony.com>
3176
3177         Include Pasteboard.h for all in WebCoreArgumentCoders
3178         https://bugs.webkit.org/show_bug.cgi?id=177902
3179
3180         Reviewed by Alex Christensen.
3181
3182         * Shared/WebCoreArgumentCoders.cpp:
3183
3184 2017-10-04  David Kilzer  <ddkilzer@apple.com>
3185
3186         Remove unused variables in lambdas for network process cache
3187         <https://webkit.org/b/177878>
3188         <rdar://problem/34038482>
3189
3190         Reviewed by Tim Horton.
3191
3192         * NetworkProcess/cache/CacheStorageEngine.cpp:
3193         (WebKit::CacheStorage::Engine::open):
3194         (WebKit::CacheStorage::Engine::putRecords):
3195         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
3196         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3197         (WebKit::CacheStorageEngineConnection::reference):
3198         - Remove unused |this| from lambda captures.
3199
3200 2017-10-04  Stephan Szabo  <stephan.szabo@sony.com>
3201
3202         [WinCairo] add PLATFORM(WIN) configurations to config.h
3203         https://bugs.webkit.org/show_bug.cgi?id=177846
3204
3205         Reviewed by Alex Christensen.
3206
3207         * config.h:
3208
3209 2017-10-04  Adrian Perez de Castro  <aperez@igalia.com>
3210
3211         [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
3212         https://bugs.webkit.org/show_bug.cgi?id=158531
3213
3214         Reviewed by Carlos Alberto Lopez Perez.
3215
3216         Do not bypass WebCore event handling when receiving touch events.
3217
3218         Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
3219         Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.
3220
3221         * UIProcess/API/gtk/PageClientImpl.cpp:
3222         (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
3223         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3224         (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
3225         * UIProcess/gtk/GestureController.cpp:
3226         (WebKit::GestureController::reset): Added.
3227         (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
3228         (WebKit::GestureController::Gesture::reset): Added.
3229         * UIProcess/gtk/GestureController.h:
3230
3231 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3232
3233         Unreviewed WPE build fix after r222837
3234         https://bugs.webkit.org/show_bug.cgi?id=177449
3235
3236         * Shared/wpe/WebEventFactory.cpp:
3237         (WebKit::wallTimeForEventTime):
3238
3239 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
3240
3241         Use blob URL when pasting RTFD instead of overriding DocumentLoader
3242         https://bugs.webkit.org/show_bug.cgi?id=177801
3243         <rdar://problem/34542270>
3244
3245         Reviewed by Wenson Hsieh.
3246
3247         Fixed the assertion failure when RTFD content is empty.
3248
3249         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3250         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
3251
3252 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3253
3254         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
3255         https://bugs.webkit.org/show_bug.cgi?id=177449
3256
3257         Reviewed by Chris Dumez.
3258
3259         * Shared/wpe/WebEventFactory.cpp:
3260         (WebKit::wallTimeForEventTime):
3261
3262 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
3263
3264         Correct nullptr dereference during shutdown
3265         https://bugs.webkit.org/show_bug.cgi?id=177845
3266         <rdar://problem/33651405>
3267
3268         Reviewed by Chris Dumez.
3269
3270         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
3271         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
3272         already been destroyed, they are in an invalid state when accessed.
3273
3274         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3275         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
3276         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
3277         a reference to completely valid object.
3278         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3279         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
3280         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
3281
3282 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3283
3284         Moderize WebKit's back forward list code
3285         https://bugs.webkit.org/show_bug.cgi?id=177843
3286
3287         Reviewed by Tim Horton.
3288
3289         Use Ref instead of RefPtr when possible.
3290         Use references instead of pointers when possible.
3291         Remove unnecessary null checks.
3292         Reduce unnecessary Vector copying.
3293
3294         * Shared/SessionState.h:
3295         * Shared/WebBackForwardListItem.h:
3296         * UIProcess/API/APILoaderClient.h:
3297         (API::LoaderClient::didChangeBackForwardList):
3298         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
3299         * UIProcess/API/C/WKPage.cpp:
3300         (WKPageSetPageLoaderClient):
3301         * UIProcess/WebBackForwardList.cpp:
3302         (WebKit::WebBackForwardList::pageClosed):
3303         (WebKit::WebBackForwardList::addItem):
3304         (WebKit::WebBackForwardList::goToItem):
3305         (WebKit::WebBackForwardList::currentItem const):
3306         (WebKit::WebBackForwardList::backItem const):
3307         (WebKit::WebBackForwardList::forwardItem const):
3308         (WebKit::WebBackForwardList::itemAtIndex const):
3309         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
3310         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
3311         (WebKit::WebBackForwardList::removeAllItems):
3312         (WebKit::WebBackForwardList::clear):
3313         (WebKit::WebBackForwardList::backForwardListState const):
3314         (WebKit::WebBackForwardList::restoreFromState):
3315         * UIProcess/WebBackForwardList.h:
3316         * UIProcess/WebPageProxy.cpp:
3317         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3318         (WebKit::WebPageProxy::initializeWebPage):
3319         (WebKit::WebPageProxy::didChangeBackForwardList):
3320         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
3321         (WebKit::WebPageProxy::backForwardGoToItem):
3322         * UIProcess/WebPageProxy.h:
3323         * UIProcess/WebProcessProxy.cpp:
3324         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
3325         * UIProcess/WebProcessProxy.h:
3326         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3327         (WebKit::WebBackForwardListProxy::itemAtIndex):
3328
3329 2017-10-03  Chris Dumez  <cdumez@apple.com>
3330
3331         SharedStringHashStore should support removing hashes
3332         https://bugs.webkit.org/show_bug.cgi?id=177770
3333
3334         Reviewed by Alex Christensen.
3335
3336         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
3337         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
3338         Worker purposes.
3339
3340         * Shared/SharedStringHashStore.cpp:
3341         (WebKit::SharedStringHashStore::SharedStringHashStore):
3342         (WebKit::SharedStringHashStore::add):
3343         (WebKit::SharedStringHashStore::remove):
3344         (WebKit::SharedStringHashStore::contains):
3345         (WebKit::SharedStringHashStore::clear):
3346         (WebKit::SharedStringHashStore::resizeTable):
3347         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
3348         * Shared/SharedStringHashStore.h:
3349         * Shared/SharedStringHashTable.cpp:
3350         (WebKit::SharedStringHashTable::remove):
3351         * Shared/SharedStringHashTable.h:
3352         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
3353         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
3354         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
3355         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
3356         * UIProcess/VisitedLinkStore.cpp:
3357         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
3358         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
3359         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
3360         * UIProcess/VisitedLinkStore.h:
3361
3362 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3363
3364         Fix API tests after r222794.
3365         https://bugs.webkit.org/show_bug.cgi?id=177825
3366
3367         * UIProcess/WebPageProxy.cpp:
3368         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3369         Sometimes there's no navigation client.
3370
3371 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3372
3373         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
3374         https://bugs.webkit.org/show_bug.cgi?id=177787
3375         <rdar://problem/22387633>
3376
3377         Reviewed by Tim Horton.
3378
3379         * UIProcess/API/APILoaderClient.h:
3380         (API::LoaderClient::didFailToInitializePlugin):
3381         * UIProcess/API/APINavigationClient.h:
3382         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
3383         (API::NavigationClient::didFailToInitializePlugIn):
3384         * UIProcess/API/C/WKPage.cpp:
3385         (WKPageSetPageLoaderClient):
3386         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3387         * UIProcess/Cocoa/NavigationState.h:
3388         * UIProcess/Cocoa/NavigationState.mm:
3389         (WebKit::NavigationState::setNavigationDelegate):
3390         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
3391         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
3392         * UIProcess/WebPageProxy.cpp:
3393         (WebKit::WebPageProxy::didFailToInitializePlugin):
3394
3395 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
3396
3397         [GTK] Prefer -webkit-system-font
3398         https://bugs.webkit.org/show_bug.cgi?id=177814
3399
3400         Reviewed by Carlos Garcia Campos.
3401
3402         Use "font-family: -webkit-system-font" instead of "font: menu".
3403
3404         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
3405         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
3406
3407 2017-10-03  Alex Christensen  <achristensen@webkit.org>
3408
3409         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
3410         https://bugs.webkit.org/show_bug.cgi?id=177825
3411         <rdar://problem/22387505>
3412
3413         Reviewed by Tim Horton.
3414
3415         * UIProcess/API/APILoaderClient.h:
3416         (API::LoaderClient::willGoToBackForwardListItem):
3417         * UIProcess/API/APINavigationClient.h:
3418         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
3419         (API::NavigationClient::willGoToBackForwardListItem):
3420         * UIProcess/API/C/WKPage.cpp:
3421         (WKPageSetPageLoaderClient):
3422         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3423         * UIProcess/Cocoa/NavigationState.h:
3424         * UIProcess/Cocoa/NavigationState.mm:
3425         (WebKit::NavigationState::setNavigationDelegate):
3426         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
3427         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
3428         * UIProcess/WebPageProxy.cpp:
3429         (WebKit::WebPageProxy::willGoToBackForwardListItem):
3430         * UIProcess/WebPageProxy.h:
3431         * UIProcess/WebPageProxy.messages.in:
3432         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3433         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
3434
3435 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3436
3437         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
3438         https://bugs.webkit.org/show_bug.cgi?id=177449
3439
3440         Reviewed by Chris Dumez.
3441
3442         * Shared/gtk/WebEventFactory.cpp:
3443         (WebKit::WebEventFactory::createWebMouseEvent):
3444         (WebKit::WebEventFactory::createWebWheelEvent):
3445         (WebKit::WebEventFactory::createWebKeyboardEvent):
3446         (WebKit::WebEventFactory::createWebTouchEvent):
3447         * Shared/wpe/WebEventFactory.cpp:
3448         (WebKit::wallTimeForEventTime):
3449         (WebKit::WebEventFactory::createWebKeyboardEvent):
3450         (WebKit::WebEventFactory::createWebMouseEvent):
3451         (WebKit::WebEventFactory::createWebWheelEvent):
3452         (WebKit::WebEventFactory::createWebTouchEvent):
3453
3454 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3455
3456         [GTK][WPE] WebProcess should run cleanup on quit to release resources
3457         https://bugs.webkit.org/show_bug.cgi?id=168126
3458
3459         Reviewed by Michael Catanzaro.
3460
3461         Do not call exit on sync message send failure for GTK and WPE ports.
3462
3463         * WebProcess/WebProcess.cpp:
3464         (WebKit::WebProcess::initializeConnection):
3465
3466 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
3467
3468         Move more code into PasteboardCustomData
3469         https://bugs.webkit.org/show_bug.cgi?id=177795
3470
3471         Reviewed by Wenson Hsieh.
3472
3473         Added the support for encoding and decoding the origin string in PasteboardCustomData.
3474
3475         * Shared/WebCoreArgumentCoders.cpp:
3476         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
3477         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
3478
3479 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
3480
3481         [GTK] Do not hardcode font family in served remote inspector HTML snippets
3482         https://bugs.webkit.org/show_bug.cgi?id=177742
3483
3484         Reviewed by Carlos Garcia Campos.
3485
3486         Instead of hardcoding Cantarell as the font used for the HTML snippets served
3487         by the remote inspector handler, use "font: menu" to obtain the system UI
3488         font, plus a "font-size" rule for adjusting the size.
3489
3490         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
3491         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
3492         CSS rules in the served snippet.
3493
3494 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
3495
3496         Web Inspector: Include Beacon and Ping requests in Network tab
3497         https://bugs.webkit.org/show_bug.cgi?id=177641
3498         <rdar://problem/33086839>
3499
3500         Reviewed by Chris Dumez.
3501
3502         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3503         (WebKit::NetworkConnectionToWebProcess::loadPing):
3504         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
3505         * NetworkProcess/NetworkConnectionToWebProcess.h:
3506         * NetworkProcess/PingLoad.cpp:
3507         (WebKit::PingLoad::PingLoad):
3508         (WebKit::PingLoad::didFinish):
3509         (WebKit::PingLoad::didReceiveResponseNetworkSession):
3510         * NetworkProcess/PingLoad.h:
3511         * WebProcess/Network/NetworkProcessConnection.cpp:
3512         (WebKit::NetworkProcessConnection::didFinishPingLoad):
3513         * WebProcess/Network/NetworkProcessConnection.h:
3514         * WebProcess/Network/NetworkProcessConnection.messages.in:
3515         * WebProcess/Network/WebLoaderStrategy.cpp:
3516         (WebKit::WebLoaderStrategy::networkProcessCrashed):
3517         (WebKit::WebLoaderStrategy::startPingLoad):
3518         (WebKit::WebLoaderStrategy::didFinishPingLoad):
3519         * WebProcess/Network/WebLoaderStrategy.h:
3520         Pass an optional ResourceResponse back to the ping completion handler.
3521
3522 2017-10-02  Alex Christensen  <achristensen@webkit.org>
3523
3524         REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
3525         https://bugs.webkit.org/show_bug.cgi?id=177764
3526
3527         Reviewed by Chris Dumez.
3528
3529         * UIProcess/API/C/WKPage.cpp:
3530         (WKPageSetPageNavigationClient):
3531         I shouldn't have reverted the A API telling the listener to continue if there's no client function.
3532
3533 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3534
3535         [WPE][GTK] Crash in webkit_web_resource_get_data_finish()
3536         https://bugs.webkit.org/show_bug.cgi?id=177107
3537
3538         Reviewed by Michael Catanzaro.
3539
3540         Handle errors in webkit_web_resource_get_data() callback.
3541
3542         * UIProcess/API/glib/WebKitWebResource.cpp:
3543         (resourceDataCallback):
3544         (webkit_web_resource_get_data):
3545
3546 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
3547
3548         [WPE] Fix UIProcess build with GStreamer and without VIDEO
3549         https://bugs.webkit.org/show_bug.cgi?id=177753
3550
3551         Reviewed by Michael Catanzaro.
3552
3553         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
3554         This is the WPE counterpart of bug 153135.
3555
3556         * UIProcess/API/wpe/PageClientImpl.h:
3557
3558 2017-10-02  Alex Christensen  <achristensen@webkit.org>
3559
3560         Expose more WKPreferences SPI to match C SPI
3561         https://bugs.webkit.org/show_bug.cgi?id=177697
3562
3563         * UIProcess/API/Cocoa/WKPreferences.mm:
3564         (-[WKPreferences _javaEnabledForLocalFiles]):
3565         (-[WKPreferences _setPlugInsEnabled:]): Deleted.
3566         (-[WKPreferences _plugInsEnabled]): Deleted.
3567         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3568         _javaEnabledForLocalFiles should return the correct value.
3569         _plugInsEnabled has public API.  This SPI is not needed.
3570
3571 2017-10-02  Alex Christensen  <achristensen@webkit.org>
3572
3573         REGRESSION(r214201): WebProcess hangs during policy decisions
3574         https://bugs.webkit.org/show_bug.cgi?id=177590
3575         <rdar://problem/33362929>
3576
3577         Reviewed by Andy Estes.
3578
3579         This is like r222431 but for trunk instead of a branch.
3580         It includes the same regression API test so I don't make the same mistake again.
3581
3582         * UIProcess/API/C/WKPage.cpp:
3583         (WKPageSetPageNavigationClient):
3584         * UIProcess/WebPageProxy.cpp:
3585         (WebKit::WebPageProxy::receivedPolicyDecision):
3586         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3587         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3588         * UIProcess/WebPageProxy.h:
3589         * UIProcess/WebPageProxy.messages.in:
3590         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3591         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3592         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3593         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
3594         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3595         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3596         * WebProcess/WebPage/WebDocumentLoader.cpp:
3597         (WebKit::WebDocumentLoader::setNavigationID):
3598         * WebProcess/WebPage/WebFrame.cpp:
3599         (WebKit::WebFrame::setUpPolicyListener):
3600         (WebKit::WebFrame::invalidatePolicyListener):
3601         (WebKit::WebFrame::didReceivePolicyDecision):
3602         * WebProcess/WebPage/WebFrame.h:
3603         * WebProcess/WebPage/WebPage.cpp:
3604         (WebKit::WebPage::didReceivePolicyDecision):
3605         * WebProcess/WebPage/WebPage.h:
3606         * WebProcess/WebPage/WebPage.messages.in:
3607
3608 2017-10-02  Alex Christensen  <achristensen@webkit.org>
3609
3610         Remove unnecessary copy of SessionID in WebPageProxy
3611         https://bugs.webkit.org/show_bug.cgi?id=177702
3612
3613         Reviewed by Darin Adler.
3614
3615         * UIProcess/WebPageProxy.cpp:
3616         (WebKit::WebPageProxy::sessionID const):
3617         (WebKit::WebPageProxy::creationParameters):
3618         * UIProcess/WebPageProxy.h:
3619         (WebKit::WebPageProxy::sessionID const): Deleted.
3620
3621 2017-10-02  Alex Christensen  <achristensen@webkit.org>
3622
3623         Expose more WKPreferences SPI to match C SPI
3624         https://bugs.webkit.org/show_bug.cgi?id=177697
3625         <rdar://problem/24110556>
3626
3627         Reviewed by Darin Adler.
3628
3629         * UIProcess/API/Cocoa/WKPreferences.mm:
3630         (-[WKPreferences _setJavaEnabledForLocalFiles:]):
3631         (-[WKPreferences _javaEnabledForLocalFiles]):
3632         (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
3633         (-[WKPreferences _canvasUsesAcceleratedDrawing]):
3634         (-[WKPreferences _setAcceleratedCompositingEnabled:]):
3635         (-[WKPreferences _acceleratedCompositingEnabled]):
3636         (-[WKPreferences _setDefaultTextEncodingName:]):
3637         (-[WKPreferences _defaultTextEncodingName]):
3638         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
3639         (-[WKPreferences _needsSiteSpecificQuirks]):
3640         (-[WKPreferences _setAuthorAndUserStylesEnabled:]):
3641         (-[WKPreferences _authorAndUserStylesEnabled]):
3642         (-[WKPreferences _setDOMTimersThrottlingEnabled:]):
3643         (-[WKPreferences _domTimersThrottlingEnabled]):
3644         (-[WKPreferences _setWebArchiveDebugModeEnabled:]):
3645         (-[WKPreferences _webArchiveDebugModeEnabled]):
3646         (-[WKPreferences _setLocalFileContentSniffingEnabled:]):
3647         (-[WKPreferences _localFileContentSniffingEnabled]):
3648         (-[WKPreferences _setUsesPageCache:]):
3649         (-[WKPreferences _usesPageCache]):
3650         (-[WKPreferences _setPageCacheSupportsPlugins:]):
3651         (-[WKPreferences _pageCacheSupportsPlugins]):
3652         (-[WKPreferences _setShouldPrintBackgrounds:]):
3653         (-[WKPreferences _shouldPrintBackgrounds]):
3654         (-[WKPreferences _setWebSecurityEnabled:]):
3655         (-[WKPreferences _webSecurityEnabled]):
3656         (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
3657         (-[WKPreferences _universalAccessFromFileURLsAllowed]):
3658         (-[WKPreferences _setAVFoundationEnabled:]):
3659         (-[WKPreferences _avFoundationEnabled]):
3660         (-[WKPreferences _setSuppressesIncrementalRendering:]):
3661         (-[WKPreferences _suppressesIncrementalRendering]):
3662         (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
3663         (-[WKPreferences _asynchronousPluginInitializationEnabled]):
3664         (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
3665         (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
3666         (-[WKPreferences _setCookieEnabled:]):
3667         (-[WKPreferences _cookieEnabled]):
3668         (-[WKPreferences _setPlugInSnapshottingEnabled:]):
3669         (-[WKPreferences _plugInSnapshottingEnabled]):
3670         (-[WKPreferences _setQTKitEnabled:]):
3671         (-[WKPreferences _qtKitEnabled]):
3672         (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
3673         (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
3674         (-[WKPreferences _setMediaSourceEnabled:]):
3675         (-[WKPreferences _mediaSourceEnabled]):
3676         (-[WKPreferences _setViewGestureDebuggingEnabled:]):
3677         (-[WKPreferences _viewGestureDebuggingEnabled]):
3678         (-[WKPreferences _setCSSAnimationTriggersEnabled:]):
3679         (-[WKPreferences _cssAnimationTriggersEnabled]):
3680         (-[WKPreferences _setStandardFontFamily:]):
3681         (-[WKPreferences _standardFontFamily]):
3682         (-[WKPreferences _setNotificationsEnabled:]):
3683         (-[WKPreferences _notificationsEnabled]):
3684         (-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
3685         (-[WKPreferences _backspaceKeyNavigationEnabled]):
3686         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3687
3688 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3689
3690         [GTK][WPE] Enable interactive forms validation by default
3691         https://bugs.webkit.org/show_bug.cgi?id=177737
3692
3693         Reviewed by Michael Catanzaro.
3694
3695         It's currently disabled for no reason.
3696
3697         * Shared/WebPreferencesDefinitions.h:
3698
3699 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
3700
3701         Remove ENABLE_CSS_REGIONS
3702         https://bugs.webkit.org/show_bug.cgi?id=177689
3703
3704         Reviewed by Darin Adler.
3705
3706         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
3707         (webkit_dom_element_get_webkit_region_overset):
3708         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
3709         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3710         (webkit_dom_element_get_webkit_region_overset): Deleted.
3711         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
3712
3713 2017-09-30  Darin Adler  <darin@apple.com>
3714
3715         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
3716         https://bugs.webkit.org/show_bug.cgi?id=177708
3717
3718         Reviewed by Anders Carlsson.
3719
3720         I ran into an intermittent crash when running regression tests. It looked like a connection
3721         client was being called after it was destroyed. I did an audit of the all the connection
3722         clients to make sure they all invalidate their connection before they are destroyed.
3723
3724         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3725         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
3726         connection since this object opened the connection. There is no obvious
3727         guarantee that the connection will already be invalid when this is destroyed.
3728         * StorageProcess/StorageToWebProcessConnection.cpp:
3729         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
3730         * UIProcess/Plugins/PluginProcessProxy.cpp:
3731         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
3732         * WebProcess/Network/NetworkProcessConnection.cpp:
3733         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
3734         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3735         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
3736
3737         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
3738         from IPC::Connection::Client because we can, and this means we don't have to study quite
3739         as much code to understand how this is used as a connection client.
3740         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
3741         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
3742         * WebProcess/WebPage/WebInspector.h: Ditto.
3743         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
3744
3745         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3746         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
3747         reference cycle cycle leading to a leak that I believe exists here.
3748
3749 2017-09-29  Alex Christensen  <achristensen@webkit.org>
3750
3751         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
3752         https://bugs.webkit.org/show_bug.cgi?id=177491
3753
3754         Reviewed by Andy Estes.
3755
3756         * WebProcess/WebPage/WebFrame.cpp:
3757         (WebKit::WebFrame::setUpWillSubmitFormListener):
3758         (WebKit::WebFrame::continueWillSubmitForm):
3759         (WebKit::WebFrame::invalidatePolicyListener):
3760         Speculative fix for a flaky assertion.
3761         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
3762
3763 2017-09-29  Chris Dumez  <cdumez@apple.com>
3764
3765         http/tests/preconnect/link-rel-preconnect-https.html is flaky
3766         https://bugs.webkit.org/show_bug.cgi?id=177673
3767
3768         Reviewed by Alex Christensen.
3769
3770         Update PreconnectTask to query the client when a certificate needs to be
3771         validated. This allows WebKitTestRunner to ignore invalid certificates
3772         and this causes http/tests/preconnect/link-rel-preconnect-https.html
3773         to pass consistently.
3774
3775         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
3776         instead of using a NetworkDataTask directly.
3777
3778         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3779         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
3780         * NetworkProcess/NetworkConnectionToWebProcess.h:
3781         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3782         * NetworkProcess/NetworkLoad.h:
3783         * NetworkProcess/NetworkProcess.cpp:
3784         (WebKit::generateCanAuthenticateIdentifier):
3785         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
3786         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
3787         (WebKit::NetworkProcess::preconnectTo):
3788         * NetworkProcess/NetworkProcess.h:
3789         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3790         (WebKit::NetworkResourceLoadParameters::encode const):
3791         (WebKit::NetworkResourceLoadParameters::decode):
3792         * NetworkProcess/PreconnectTask.cpp:
3793         (WebKit::PreconnectTask::PreconnectTask):
3794         (WebKit::PreconnectTask::~PreconnectTask):
3795         (WebKit::PreconnectTask::willSendRedirectedRequest):
3796         (WebKit::PreconnectTask::didReceiveResponse):
3797         (WebKit::PreconnectTask::didReceiveBuffer):
3798         (WebKit::PreconnectTask::didFinishLoading):
3799         (WebKit::PreconnectTask::didFailLoading):
3800         (WebKit::PreconnectTask::didSendData):
3801         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
3802         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
3803         (WebKit::PreconnectTask::frameID const):
3804         (WebKit::PreconnectTask::pageID const):
3805         * NetworkProcess/PreconnectTask.h:
3806         * WebProcess/Network/WebLoaderStrategy.cpp:
3807         (WebKit::WebLoaderStrategy::preconnectTo):
3808         * WebProcess/Network/WebLoaderStrategy.h:
3809
3810 2017-09-29  Alex Christensen  <achristensen@webkit.org>
3811
3812         Expose WebPreferences::webGLEnabled through WKPreferences
3813         https://bugs.webkit.org/show_bug.cgi?id=177692
3814         <rdar://problem/24110556>
3815
3816         Reviewed by Andy Estes.
3817
3818         * UIProcess/API/Cocoa/WKPreferences.mm:
3819         (-[WKPreferences _setWebGLEnabled:]):
3820         (-[WKPreferences _webGLEnabled]):
3821         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3822
3823 2017-09-29  Chris Dumez  <cdumez@apple.com>
3824
3825         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
3826         https://bugs.webkit.org/show_bug.cgi?id=177667
3827
3828         Reviewed by Alex Christensen.
3829
3830         Move some authentication-related code to avoid duplication.
3831         This is a preparation code supporting Download authentication
3832         as Download uses a NSURLSessionDownloadTask and not a
3833         NetworkDataTask.
3834
3835         * NetworkProcess/NetworkDataTask.h:
3836         (WebKit::NetworkDataTask::setSuggestedFilename):
3837         * NetworkProcess/NetworkLoad.cpp:
3838         (WebKit::NetworkLoad::didReceiveChallenge):
3839         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3840         * NetworkProcess/NetworkSession.cpp:
3841         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
3842         * NetworkProcess/NetworkSession.h:
3843         * NetworkProcess/PreconnectTask.cpp:
3844         (WebKit::PreconnectTask::didReceiveChallenge):
3845         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3846         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3847         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
3848         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3849         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3850         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3851         (WebKit::certificatesMatch):
3852         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
3853
3854 2017-09-29  Alex Christensen  <achristensen@webkit.org>
3855
3856         Fix WKWebViewConfigurationPrivate after r222663
3857         https://bugs.webkit.org/show_bug.cgi?id=177644
3858
3859         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3860         (-[WKWebViewConfiguration init]):
3861         (-[WKWebViewConfiguration copyWithZone:]):
3862         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3863
3864 2017-09-29  Chris Dumez  <cdumez@apple.com>
3865
3866         Split some logic out of VisitedLinkStore and make it reusable
3867         https://bugs.webkit.org/show_bug.cgi?id=177575
3868
3869         Reviewed by Alex Christensen.
3870
3871         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
3872         visited links and from other processes than the UIProcess.
3873
3874         The plan is to reuse the new SharedStringHashStore for Service Worker registration
3875         on StorageProcess side and querying on WebContent process side.
3876
3877         * CMakeLists.txt:
3878         * Shared/SharedStringHashStore.cpp: Added.
3879         (WebKit::nextPowerOf2):
3880         (WebKit::tableSizeForKeyCount):
3881         (WebKit::SharedStringHashStore::SharedStringHashStore):
3882         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
3883         (WebKit::SharedStringHashStore::add):
3884         (WebKit::SharedStringHashStore::clear):
3885         (WebKit::SharedStringHashStore::resizeTable):
3886         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
3887         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
3888         (WebKit::SharedStringHashStore::Client::~Client):
3889         (WebKit::SharedStringHashStore::isEmpty const):
3890         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
3891         (WebKit::SharedStringHashTable::SharedStringHashTable):
3892         (WebKit::SharedStringHashTable::~SharedStringHashTable):
3893         (WebKit::SharedStringHashTable::setSharedMemory):
3894         (WebKit::SharedStringHashTable::add):
3895         (WebKit::SharedStringHashTable::contains const):
3896         (WebKit::SharedStringHashTable::clear):
3897         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
3898         * UIProcess/API/C/WKContext.cpp:
3899         (WKContextAddVisitedLink):
3900         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
3901         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
3902         * UIProcess/VisitedLinkStore.cpp:
3903         (WebKit::VisitedLinkStore::VisitedLinkStore):
3904         (WebKit::VisitedLinkStore::addProcess):
3905         (WebKit::VisitedLinkStore::addVisitedLinkHash):
3906         (WebKit::VisitedLinkStore::removeAll):
3907         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
3908         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
3909         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
3910         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
3911         * UIProcess/VisitedLinkStore.h:
3912         * UIProcess/WebProcessPool.cpp:
3913         * UIProcess/WebProcessPool.h:
3914         * UIProcess/WebProcessProxy.h:
3915         * WebKit.xcodeproj/project.pbxproj:
3916         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3917         (WebKit::VisitedLinkTableController::isLinkVisited):
3918         (WebKit::VisitedLinkTableController::addVisitedLink):
3919         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
3920         * WebProcess/WebPage/VisitedLinkTableController.h:
3921         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
3922
3923 2017-09-28  Alex Christensen  <achristensen@webkit.org>
3924
3925         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
3926         https://bugs.webkit.org/show_bug.cgi?id=177644
3927         <rdar://problem/34338698>
3928
3929         Reviewed by Geoffrey Garen.
3930
3931         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
3932         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
3933
3934         * UIProcess/API/Cocoa/WKWebView.mm:
3935         (-[WKWebView _initializeWithConfiguration:]):
3936         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3937         (-[WKWebViewConfiguration _setCPULimit:]):
3938         (-[WKWebViewConfiguration _cpuLimit]):
3939         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3940
3941 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
3942
3943         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
3944         https://bugs.webkit.org/show_bug.cgi?id=170449
3945         <rdar://problem/31432525>
3946
3947         Reviewed by Wenson Hsieh.
3948
3949         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
3950         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
3951
3952         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3953         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
3954         * UIProcess/WebPasteboardProxy.h:
3955         * UIProcess/WebPasteboardProxy.messages.in:
3956         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3957         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
3958         since WebCore will now create File objects for these pasted files.
3959
3960 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3961
3962         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
3963         https://bugs.webkit.org/show_bug.cgi?id=177662
3964         <rdar://problem/33410373>
3965
3966         Reviewed by Tim Horton.
3967
3968         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
3969
3970         * Shared/EditorState.cpp:
3971         (WebKit::EditorState::PostLayoutData::encode const):
3972         (WebKit::EditorState::PostLayoutData::decode):
3973         * Shared/EditorState.h:
3974
3975         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
3976         any plain text. Add IPC support for this new flag.
3977
3978         * UIProcess/ios/WKContentViewInteraction.mm:
3979         (-[WKContentView hasText]):
3980         * WebProcess/WebPage/ios/WebPageIOS.mm:
3981         (WebKit::computeEditableRootHasContentAndPlainText):
3982
3983         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
3984         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
3985         things to note here:
3986         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
3987           character near the selection, just set the flags to true and bail, since the editable root necessarily has
3988           content that is plain text.
3989         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
3990         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
3991         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
3992         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
3993         if we had a range selection rather than a caret selection even when the editable root has content, because the
3994         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
3995
3996         (WebKit::WebPage::platformEditorState const):
3997
3998 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
3999
4000         Fix the macOS CMake build
4001
4002         * CMakeLists.txt:
4003
4004 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
4005
4006         Revise deployment target macros from r222620
4007
4008         Rubber-stamped by Wenson Hsieh.
4009
4010         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
4011         * WebProcess/Plugins/PDF/PDFPlugin.mm:
4012         (WebKit::PDFPlugin::pdfDocumentDidLoad):
4013
4014 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
4015
4016         Request for PDF URL targets for specific pages, sections, etc.
4017         https://bugs.webkit.org/show_bug.cgi?id=177582
4018         <rdar://problem/5692679>
4019
4020         Reviewed by Tim Horton.
4021         
4022         This change sets the URL fragment for scroll anchoring in PDFs.
4023
4024         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
4025         * WebProcess/Plugins/PDF/PDFPlugin.mm:
4026         (WebKit::PDFPlugin::pdfDocumentDidLoad):
4027
4028 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
4029
4030         [PAL] Move HysteresisActivity into PAL
4031         https://bugs.webkit.org/show_bug.cgi?id=177516
4032
4033         Reviewed by Alex Christensen.
4034
4035         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
4036         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
4037         * Shared/WebSQLiteDatabaseTracker.cpp:
4038         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
4039         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
4040         * Shared/WebSQLiteDatabaseTracker.h:
4041         * WebProcess/WebPage/WebPage.cpp:
4042         (WebKit::m_pageScrolledHysteresis):
4043         (WebKit::m_userActivityHysteresis):
4044         (WebKit::WebPage::updateUserActivity):
4045         * WebProcess/WebPage/WebPage.h:
4046         * WebProcess/WebProcess.cpp:
4047         (WebKit::WebPr