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