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