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