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