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