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