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