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