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