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