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