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