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