f2eead1109fd243785d31500d1aa20869f710b47
[WebKit.git] / Source / WebKit / ChangeLog
1 2017-12-24  David Kilzer  <ddkilzer@apple.com>
2
3         REGRESSION (r224313): Fix build warning when compiling WebKit.xcassets
4         <https://webkit.org/b/181148>
5
6         Reviewed by Dan Bernstein.
7
8         Fixes the following build warning:
9
10             Opensource/Source/WebKit/WebKit.xcassets: warning: Failed to read file attributes for "Opensource/Source/WebKit/WebKit.xcassets"
11                 Failure Reason: No such file or directory
12
13         * WebKit.xcodeproj/project.pbxproj: Fix relative path with
14         case-insensitive filesystem and repository name assumptions.
15
16 2017-12-22  Jeff Miller  <jeffm@apple.com>
17
18         Allow WebsitePolicies API object to be bridged to _WKWebsitePolicies
19         https://bugs.webkit.org/show_bug.cgi?id=181135
20
21         Reviewed by Dan Bernstein.
22
23         _WKWebsitePolicies already wraps WebsitePolicies, we just never hooked this up in newObject().
24
25         * Shared/Cocoa/APIObject.mm:
26         (API::Object::newObject):
27
28 2017-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
29
30         Fix build failures due to using deprecated AppKit symbols
31         https://bugs.webkit.org/show_bug.cgi?id=181110
32         <rdar://problem/36162865>
33
34         Reviewed by Dan Bernstein and Tim Horton.
35
36         See WebCore ChangeLog for more details.
37
38         * Shared/mac/PasteboardTypes.mm:
39         (WebKit::PasteboardTypes::forEditing):
40         (WebKit::PasteboardTypes::forURL):
41         (WebKit::PasteboardTypes::forImages):
42         (WebKit::PasteboardTypes::forImagesWithArchive):
43         (WebKit::PasteboardTypes::forSelection):
44         * UIProcess/Cocoa/WebViewImpl.mm:
45         (WebKit::WebViewImpl::WebViewImpl):
46         (WebKit::WebViewImpl::setIntrinsicContentSize):
47         (WebKit::WebViewImpl::writeSelectionToPasteboard):
48         (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes):
49         (WebKit::WebViewImpl::validateUserInterfaceItem):
50         (WebKit::WebViewImpl::performDragOperation):
51         (WebKit::WebViewImpl::setFileAndURLTypes):
52         (WebKit::WebViewImpl::setPromisedDataForImage):
53         (WebKit::WebViewImpl::setPromisedDataForAttachment):
54         (WebKit::WebViewImpl::provideDataForPasteboard):
55         * UIProcess/mac/WKPrintingView.mm:
56         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
57         (-[WKPrintingView _drawPreview:]):
58         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
59         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
60         * UIProcess/mac/WebContextMenuProxyMac.mm:
61         (-[WKMenuTarget forwardContextMenuAction:]):
62         (WebKit::WebContextMenuProxyMac::createContextMenuItem):
63         * UIProcess/mac/WebPageProxyMac.mm:
64         (WebKit::WebPageProxy::searchTheWeb):
65         * WebProcess/Plugins/PDF/PDFPlugin.mm:
66         (WebKit::PDFPlugin::writeItemsToPasteboard):
67         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
68         (WebKit::convertImageToBitmap):
69         * WebProcess/WebPage/mac/WebPageMac.mm:
70         (WebKit::drawPDFPage):
71
72 2017-12-22  Chris Dumez  <cdumez@apple.com>
73
74         [Service Workers] Implement "Soft Update" algorithm
75         https://bugs.webkit.org/show_bug.cgi?id=180702
76         <rdar://problem/36163461>
77
78         Reviewed by Youenn Fablet.
79
80         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
81         (WebKit::WebSWServerConnection::startScriptFetchInClient):
82         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
83         * WebProcess/Storage/WebSWClientConnection.messages.in:
84
85 2017-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>
86
87         [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
88         https://bugs.webkit.org/show_bug.cgi?id=179914
89         <rdar://problem/36196039>
90
91         Unreviewed.
92
93         I messed up a last-minute change, and inverted the conditional that determines whether to
94         use the version script. I did test this change to ensure that it worked properly by checking
95         that the library size was correct, but only in non-developer mode. My test was thwarted by
96         -fvisibility=hidden. It looks like so few internal symbols are exported that missing the
97         version script had little impact on the size of the resulting libraries. That's good, I
98         suppose.
99
100         * PlatformGTK.cmake:
101         * PlatformWPE.cmake:
102
103 2017-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>
104
105         [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
106         https://bugs.webkit.org/show_bug.cgi?id=179914
107
108         Reviewed by Carlos Garcia Campos.
109
110         Mark a few InjectedBundle symbols with default visibility, so they don't get hidden by
111         -fvisibility=hidden. Also, remove Windows conditionals, since Windows is not supported by
112         any GLib ports.
113
114         Also, move the symbols map to here, and share it between WPE and GTK.
115
116         * CMakeLists.txt:
117         * PlatformGTK.cmake:
118         * PlatformWPE.cmake:
119         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
120         * WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp:
121         * webkitglib-symbols.map: Renamed from Source/cmake/gtksymbols.filter.
122
123 2017-12-21  Michael Catanzaro  <mcatanzaro@igalia.com>
124
125         [WPE][GTK] Deprecate and replace webkit_form_submission_request_get_text_fields
126         https://bugs.webkit.org/show_bug.cgi?id=176725
127
128         Reviewed by Carlos Garcia Campos.
129
130         The problem is this function returns results in a GHashTable, but many fields can have the
131         same name, or no name at all, and those fields are currently just dropped. It's impossible
132         to fix, since the GHashTable is part of the API, so deprecate it and add a new function that
133         returns two GPtrArrays instead.
134
135         * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
136         (webkitFormSubmissionRequestCreate):
137         (webkit_form_submission_request_get_text_fields):
138         (webkit_form_submission_request_list_text_fields):
139         * UIProcess/API/gtk/WebKitFormSubmissionRequest.h:
140         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
141         * UIProcess/API/wpe/WebKitFormSubmissionRequest.h:
142
143 2017-12-21  Youenn Fablet  <youenn@apple.com>
144
145         ServiceWorkerThreadProxy should set the correct cookie and cache partitioning options
146         https://bugs.webkit.org/show_bug.cgi?id=181000
147
148         Reviewed by Chris Dumez.
149
150         Update Service Worker WebPreferencesStore based on the first web page added.
151         This allows having the right storage blocking policy.
152
153         Storing that policy in the context manager to set it properly when
154         creating a new service worker thread proxy.
155
156         Set up correctly partitioning parameters in the dummy Document used by the service worker.
157
158         * UIProcess/ServiceWorkerProcessProxy.cpp:
159         (WebKit::ServiceWorkerProcessProxy::updatePreferencesStore):
160         * UIProcess/ServiceWorkerProcessProxy.h:
161         * UIProcess/WebPageProxy.h:
162         * UIProcess/WebProcessPool.cpp:
163         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
164         (WebKit::WebProcessPool::pageAddedToProcess):
165         * UIProcess/WebProcessPool.h:
166         * WebProcess/Plugins/PluginView.cpp:
167         (WebKit::PluginView::getAuthenticationInfo):
168         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
169         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
170         (WebKit::WebSWContextManagerConnection::installServiceWorker):
171         * WebProcess/Storage/WebSWContextManagerConnection.h:
172         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
173
174 2017-12-21  Dan Bernstein  <mitz@apple.com>
175
176         WKPreferences doesn’t expose editable link behavior
177         https://bugs.webkit.org/show_bug.cgi?id=181111
178
179         Reviewed by Tim Horton.
180
181         * UIProcess/API/Cocoa/WKPreferences.mm:
182         (toAPI): Added. Converts WebCore::EditableLinkBehavior to _WKEditableLinkBehavior.
183         (toEditableLinkBehavior): Added. Converts the other way.
184         (-[WKPreferences _editableLinkBehavior]): Added this getter.
185         (-[WKPreferences _setEditableLinkBehavior:]): Ditto.
186         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared new property.
187
188 2017-12-21  Andy Estes  <aestes@apple.com>
189
190         Address additional review feedback after r226182.
191
192         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
193         (WebKit::toPKPaymentRequest):
194
195 2017-12-21  Jeremy Jones  <jeremyj@apple.com>
196
197         Update FULLSCREEN_API feature defines.
198         https://bugs.webkit.org/show_bug.cgi?id=181015
199
200         Reviewed by Tim Horton.
201
202         Change enabled iphone sdk for FULLSCREEN_API.
203
204         * Configurations/FeatureDefines.xcconfig:
205
206 2017-12-21  John Wilander  <wilander@apple.com>
207
208         Storage Access API: Make DocumentLoader::willSendRequest() and WebFrameLoaderClient::detachedFromParent2() tell the network process to get rid of any sub frame access entries
209         https://bugs.webkit.org/show_bug.cgi?id=180728
210         <rdar://problem/36009288>
211
212         Reviewed by Youenn Fablet.
213
214         This change calls the network process to clear any storage access
215         entries when a subframe navigates or is detached.
216
217         * NetworkProcess/NetworkProcess.cpp:
218         (WebKit::NetworkProcess::removeStorageAccess):
219         * NetworkProcess/NetworkProcess.h:
220         * NetworkProcess/NetworkProcess.messages.in:
221         * UIProcess/Network/NetworkProcessProxy.cpp:
222         (WebKit::NetworkProcessProxy::removeStorageAccess):
223         * UIProcess/Network/NetworkProcessProxy.h:
224         * UIProcess/WebPageProxy.cpp:
225         (WebKit::WebPageProxy::removeStorageAccess):
226         * UIProcess/WebPageProxy.h:
227         * UIProcess/WebPageProxy.messages.in:
228         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
229         (WebKit::WebsiteDataStore::hasStorageAccess):
230         (WebKit::WebsiteDataStore::requestStorageAccess):
231         (WebKit::WebsiteDataStore::removeStorageAccess):
232         * UIProcess/WebsiteData/WebsiteDataStore.h:
233         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
234         * WebProcess/WebCoreSupport/WebChromeClient.h:
235         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
236         (WebKit::WebFrameLoaderClient::detachedFromParent2):
237         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
238         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
239         * WebProcess/WebPage/WebPage.cpp:
240         * WebProcess/WebPage/WebPage.h:
241         * WebProcess/WebPage/WebPage.messages.in:
242
243 2017-12-21  Jeremy Jones  <jeremyj@apple.com>
244
245         Second Build fix after r226223
246         https://bugs.webkit.org/show_bug.cgi?id=181089
247
248         Unreviewed.
249
250         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
251         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
252         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
253
254 2017-12-21  Jer Noble  <jer.noble@apple.com>
255
256         Add initial DOM support for Media Capabilities
257         https://bugs.webkit.org/show_bug.cgi?id=181064
258
259         Reviewed by Eric Carlson.
260
261         Add a new preference to enable the (disabled-by-default) Media Capabilities API.
262
263         * Shared/WebPreferences.yaml:
264         * UIProcess/API/C/WKPreferences.cpp:
265         (WKPreferencesSetMediaCapabilitiesEnabled):
266         (WKPreferencesGetMediaCapabilitiesEnabled):
267         * UIProcess/API/C/WKPreferencesRef.h:
268
269 2017-12-21  Keith Rollin  <krollin@apple.com>
270
271         Add optional logging of per-resource cookie information
272         https://bugs.webkit.org/show_bug.cgi?id=180883
273         <rdar://problem/35802295>
274
275         Reviewed by Brent Fulgham.
276
277         In order to support the tracking of the efficacy of Intelligent
278         Tracking Protection, add some logging of the cookie information
279         associated with each loaded resource. This logging is off by default
280         and is enabled with `defaults write -g WebKitLogCookieInformation
281         -bool true`.
282
283         * NetworkProcess/NetworkProcess.cpp:
284         (WebKit::NetworkProcess::initializeNetworkProcess):
285         * NetworkProcess/NetworkProcess.h:
286         (WebKit::NetworkProcess::shouldLogCookieInformation const):
287         * NetworkProcess/NetworkProcessCreationParameters.cpp:
288         (WebKit::NetworkProcessCreationParameters::encode const):
289         (WebKit::NetworkProcessCreationParameters::decode):
290         * NetworkProcess/NetworkProcessCreationParameters.h:
291         * NetworkProcess/NetworkResourceLoader.cpp:
292         (WebKit::NetworkResourceLoader::didFinishLoading):
293         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
294         (WebKit::NetworkResourceLoader::shouldLogCookieInformation const):
295         (WebKit::NetworkResourceLoader::logCookieInformation const):
296         * NetworkProcess/NetworkResourceLoader.h:
297         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
298         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
299
300 2017-12-21  Brent Fulgham  <bfulgham@apple.com>
301
302         Unreviewed Debug build fix after r226217
303
304         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
305
306 2017-12-21  Jeremy Jones  <jeremyj@apple.com>
307
308         Element fullscreen interface should display the location
309         https://bugs.webkit.org/show_bug.cgi?id=181006
310         rdar://problem/36143176
311
312         Reviewed by Simon Fraser.
313
314         Show a short user visible location string with a lock if secure and green when trusted.
315
316         Includes other interface cleanup and tweaks.
317
318         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
319         (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
320         (-[_WKFullScreenViewController visualEffectViewWithFrame:]):
321         (mirrorEdgeInsets):
322         (-[_WKFullScreenViewController _updateLayoutMargins]):
323         (-[_WKFullScreenViewController viewDidLayoutSubviews]):
324         (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]):
325         (-[_WKFullScreenViewController createSubviews]):
326         (-[_WKFullScreenViewController loadView]):
327         (-[_WKFullScreenViewController viewDidAppear:]):
328         (-[_WKFullScreenViewController hideCancelButton]):
329         (-[_WKFullScreenViewController showCancelButton:]):
330         (-[_WKFullscreenRootViewController setShowsStatusBar:]):
331         (-[_WKFullscreenRootViewController prefersStatusBarHidden]):
332         (-[WKFullScreenWindowController _invalidateEVOrganizationName]):
333         (-[WKFullScreenWindowController isSecure]):
334         (-[WKFullScreenWindowController _serverTrust]):
335         (-[WKFullScreenWindowController _EVOrganizationName]):
336         (-[WKFullScreenWindowController updateLocationInfo]):
337         (-[WKFullScreenWindowController enterFullScreen]):
338         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
339         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
340         (-[_WKFullScreenViewController prefersStatusBarHidden]): Deleted.
341         * WebKit.xcassets/Done.imageset/Contents.json: Removed.
342         * WebKit.xcassets/LockMini.imageset/Contents.json: Added.
343         * WebKit.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Copied from Source/WebKit/WebKit.xcassets/Done.imageset/Done.pdf.
344         * WebKit.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Renamed from Source/WebKit/WebKit.xcassets/Done.imageset/Done.pdf.
345
346 2017-12-21  Jeremy Jones  <jeremyj@apple.com>
347
348         Enable picture-in-picture from inline element on suspend.
349         https://bugs.webkit.org/show_bug.cgi?id=180942
350         rdar://problem/34745234
351
352         Reviewed by Jer Noble.
353
354         Add support for video fullscreen standby and imporved fullscreen state transition process.
355
356         Video fullscreen standby allows a video element to have its fullscreen interface state created and
357         continuously updated so that it can quickly change presentation state on application state.
358
359         In order to accomplish this, this change allows the fullscreen presentation to decide when it needs
360         an updated inline rect, or the presence of the video layer. 
361
362         This is conditionalized until mac supports this model.
363
364         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
365         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
366         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
367         (WebKit::VideoFullscreenModelContext::requestUpdateInlineRect):
368         (WebKit::VideoFullscreenModelContext::requestVideoContentLayer):
369         (WebKit::VideoFullscreenModelContext::returnVideoContentLayer):
370         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
371         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
372         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
373         (WebKit::VideoFullscreenManagerProxy::requestUpdateInlineRect):
374         (WebKit::VideoFullscreenManagerProxy::requestVideoContentLayer):
375         (WebKit::VideoFullscreenManagerProxy::returnVideoContentLayer):
376         * WebProcess/FullScreen/WebFullScreenManager.cpp:
377         (WebKit::WebFullScreenManager::didEnterFullScreen):
378         (WebKit::WebFullScreenManager::willExitFullScreen):
379         * WebProcess/FullScreen/WebFullScreenManager.h:
380         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
381         (WebKit::WebChromeClient::supportsVideoFullscreenStandby):
382         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
383         * WebProcess/WebCoreSupport/WebChromeClient.h:
384         * WebProcess/cocoa/VideoFullscreenManager.h:
385         (WebKit::VideoFullscreenInterfaceContext::fullscreenStandby const):
386         (WebKit::VideoFullscreenInterfaceContext::setFullscreenStandby):
387         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
388         * WebProcess/cocoa/VideoFullscreenManager.mm:
389         (WebKit::VideoFullscreenManager::supportsVideoFullscreenStandby const):
390         (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
391         (WebKit::VideoFullscreenManager::requestUpdateInlineRect):
392         (WebKit::VideoFullscreenManager::requestVideoContentLayer):
393         (WebKit::VideoFullscreenManager::returnVideoContentLayer):
394         (WebKit::VideoFullscreenManager::didSetupFullscreen):
395         (WebKit::VideoFullscreenManager::didExitFullscreen):
396         (WebKit::VideoFullscreenManager::didCleanupFullscreen):
397
398 2017-12-20  Eric Carlson  <eric.carlson@apple.com>
399
400         [MediaStream] Add screen capture IDL and stub functions
401         https://bugs.webkit.org/show_bug.cgi?id=181070
402         <rdar://problem/35555184>
403
404         Reviewed by Youenn Fablet.
405
406         * Shared/WebPreferences.yaml:
407         * UIProcess/API/Cocoa/WKPreferences.mm:
408         (-[WKPreferences _screenCaptureEnabled]):
409         (-[WKPreferences _setScreenCaptureEnabled:]):
410         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
411         * WebProcess/InjectedBundle/InjectedBundle.cpp:
412         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
413
414 2017-12-20  Youenn Fablet  <youenn@apple.com>
415
416         Crash when clearing std::optional<WebKit::WebServiceWorkerFetchTaskClient::BlobLoader>
417         https://bugs.webkit.org/show_bug.cgi?id=181061
418
419         Reviewed by Alex Christensen.
420
421         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
422         (WebKit::WebServiceWorkerFetchTaskClient::didFinishBlobLoading): moving the object to not destroy 'this' too soon.
423
424 2017-12-20  Youenn Fablet  <youenn@apple.com>
425
426         Support service worker interception of request with blob body
427         https://bugs.webkit.org/show_bug.cgi?id=181035
428
429         Reviewed by Chris Dumez.
430
431         In case of service worker, remove the connection check to get access to the blob registry.
432         Apply this for cloning blobs registered by another process.
433
434         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
435         (WebKit::NetworkBlobRegistry::registerBlobURL):
436         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
437         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
438         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
439         * NetworkProcess/NetworkConnectionToWebProcess.h:
440         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
441         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
442         (WebKit::BlobRegistryProxy::registerBlobURL):
443
444 2017-12-20  Daniel Bates  <dabates@apple.com>
445
446         Remove Alternative Presentation Button
447         https://bugs.webkit.org/show_bug.cgi?id=180500
448         <rdar://problem/35891047>
449
450         Reviewed by Simon Fraser.
451
452         We no longer need the alternative presentation button.
453
454         * Configurations/FeatureDefines.xcconfig:
455         * UIProcess/API/APIUIClient.h:
456         (API::UIClient::didClickAlternativePresentationButton): Deleted.
457         * UIProcess/API/C/WKPageUIClient.h:
458         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
459         * UIProcess/Cocoa/UIDelegate.h:
460         * UIProcess/Cocoa/UIDelegate.mm:
461         (WebKit::UIDelegate::setDelegate):
462         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Deleted.
463         * UIProcess/WebPageProxy.cpp:
464         (WebKit::WebPageProxy::handleAutoFillButtonClick):
465         (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Deleted.
466         * UIProcess/WebPageProxy.h:
467         * UIProcess/WebPageProxy.messages.in:
468         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
469         (API::InjectedBundle::PageUIClient::didClickAutoFillButton):
470         (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Deleted.
471         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
472         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
473         (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Deleted.
474         (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Deleted.
475         (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Deleted.
476         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
477         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
478         (WKBundleFrameFocus):
479         (WKBundleSubstituteWithAlternativePresentationButton): Deleted.
480         (WKBundleRemoveAlternativePresentationButton): Deleted.
481         (WKBundleElementsReplacedByAlternativePresentationButton): Deleted.
482         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
483         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
484         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
485         (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Deleted.
486         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
487         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
488         (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Deleted.
489         * WebProcess/WebCoreSupport/WebChromeClient.h:
490
491 2017-12-20  Andy Estes  <aestes@apple.com>
492
493         [Apple Pay] Tell PassKit whether Apple Pay JS or Payment Request was used to start an Apple Pay session
494         https://bugs.webkit.org/show_bug.cgi?id=181001
495         <rdar://problem/35479106>
496
497         Reviewed by Tim Horton.
498
499         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
500         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
501         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
502         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
503         (WebKit::toAPIType):
504         (WebKit::toPKPaymentRequest):
505
506 2017-12-20  Ms2ger  <Ms2ger@igalia.com>
507
508         REGRESSION(r226160) Build broken when MEDIA_STREAM is disabled with MediaStreamRequest namespace confusion
509         https://bugs.webkit.org/show_bug.cgi?id=181026
510
511         Unreviewed build fix.
512
513         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
514         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
515           Remove UNUSED_PARAM macros that check for (undefined) members rather than params.
516
517 2017-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
518
519         Refactor user-installed font setting for clarity
520         https://bugs.webkit.org/show_bug.cgi?id=181013
521
522         Reviewed by Simon Fraser.
523
524         There are no clients of this SPI yet, so we can rename it to remove the
525         grammatical negative.
526
527         * Shared/WebPreferences.yaml:
528         * UIProcess/API/C/WKPreferences.cpp:
529         (WKPreferencesSetShouldAllowUserInstalledFonts):
530         (WKPreferencesGetShouldAllowUserInstalledFonts):
531         (WKPreferencesSetShouldDisallowUserInstalledFonts): Deleted.
532         (WKPreferencesGetShouldDisallowUserInstalledFonts): Deleted.
533         * UIProcess/API/C/WKPreferencesRefPrivate.h:
534         * UIProcess/API/Cocoa/WKPreferences.mm:
535         (-[WKPreferences _shouldAllowUserInstalledFonts]):
536         (-[WKPreferences _setShouldAllowUserInstalledFonts:]):
537         (-[WKPreferences _shouldDisallowUserInstalledFonts]): Deleted.
538         (-[WKPreferences _setShouldDisallowUserInstalledFonts:]): Deleted.
539         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
540
541 2017-12-19  Eric Carlson  <eric.carlson@apple.com>
542
543         [MediaStream] Clean up RealtimeMediaSource interfaces
544         https://bugs.webkit.org/show_bug.cgi?id=180934
545         <rdar://problem/36108648>
546
547         Reviewed by Youenn Fablet.
548
549         * Shared/WebCoreArgumentCoders.h: Update CaptureDevice encoder.
550
551         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
552         (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Renamed from createRequest.
553         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Update for
554         API change.
555         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter the 
556         vector returned by getMediaStreamDevices.
557         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Deleted.
558         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
559
560         * UIProcess/UserMediaPermissionRequestProxy.cpp:
561         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): Update for API change.
562         (WebKit::UserMediaPermissionRequestProxy::allow): Ditto.
563         * UIProcess/UserMediaPermissionRequestProxy.h:
564         (WebKit::UserMediaPermissionRequestProxy::create):
565         (WebKit::UserMediaPermissionRequestProxy::requestType const):
566
567         * UIProcess/WebPageProxy.cpp:
568         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Ditto.
569         * UIProcess/WebPageProxy.h:
570         * UIProcess/WebPageProxy.messages.in:
571
572         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
573         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): m_blockedRequests -> m_blockedUserMediaRequests.
574         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest): Ditto.
575         (WebKit::UserMediaPermissionRequestManager::mediaCanStart): Ditto.
576         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps): Ditto.
577         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
578
579 2017-12-19  Jer Noble  <jer.noble@apple.com>
580
581         Playing media elements which call "pause(); play()" will have the play promise rejected.
582         https://bugs.webkit.org/show_bug.cgi?id=180781
583         <rdar://problem/33191377>
584
585         Reviewed by Eric Carlson.
586
587         shouldRequireUserGestureToLoadVideo() should default to false on Mac.
588
589         * UIProcess/API/Cocoa/WKWebView.mm:
590         (shouldRequireUserGestureToLoadVideo):
591
592 2017-12-19  Chris Dumez  <cdumez@apple.com>
593
594         Handle Fetch should wait for the service worker's state to become activated
595         https://bugs.webkit.org/show_bug.cgi?id=180959
596
597         Reviewed by Youenn Fablet.
598
599         Handle Fetch should wait for the service worker's state to become activated when
600         it is currently activating.
601
602         Specification:
603         - https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (Step 16)
604
605         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
606         (WebKit::WebSWServerConnection::startFetch):
607
608 2017-12-19  Youenn Fablet  <youenn@apple.com>
609
610         Service Worker should not clean HTTP headers added by the application or by fetch specification before service worker interception
611         https://bugs.webkit.org/show_bug.cgi?id=180939
612
613         Reviewed by Chris Dumez.
614
615         Passing referrer as an explicit parameter of StartFetch.
616
617         Cleaning request headers based on ResourceLoaderOptions.httpHeadersToKeep.
618
619         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
620         (WebKit::WebSWServerConnection::startFetch):
621         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
622         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
623         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
624         (WebKit::ServiceWorkerClientFetch::start):
625         * WebProcess/Storage/WebSWClientConnection.cpp:
626         (WebKit::WebSWClientConnection::startFetch):
627         * WebProcess/Storage/WebSWClientConnection.h:
628         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
629         (WebKit::WebSWContextManagerConnection::startFetch):
630         * WebProcess/Storage/WebSWContextManagerConnection.h:
631         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
632
633 2017-12-19  Andy Estes  <aestes@apple.com>
634
635         [Apple Pay] Stop maintaining a list of payment networks
636         https://bugs.webkit.org/show_bug.cgi?id=180965
637         <rdar://problem/34696560>
638
639         Reviewed by Tim Horton.
640
641         * Shared/WebPageCreationParameters.cpp:
642         (WebKit::WebPageCreationParameters::encode const):
643         (WebKit::WebPageCreationParameters::decode):
644         * Shared/WebPageCreationParameters.h: Defined availablePaymentNetworks.
645         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
646         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
647         (WebKit::toSupportedNetworks):
648         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks): Called
649         +[PKPaymentRequest availableNetworks].
650         (WebKit::toSupportedNetwork): Deleted.
651         * UIProcess/WebPageProxy.cpp:
652         (WebKit::WebPageProxy::creationParameters): Set parameters.availablePaymentNetworks by
653         calling WebPaymentCoordinatorProxy::availablePaymentNetworks.
654         * WebProcess/WebPage/WebPage.cpp:
655         (WebKit::WebPage::WebPage): Set pageConfiguration.availablePaymentNetworks to
656         parameters.availablePaymentNetworks.
657
658 2017-12-18  Brady Eidson  <beidson@apple.com>
659
660         Add ability to API test Service Workers via a custom protocol.
661         https://bugs.webkit.org/show_bug.cgi?id=180911
662
663         Reviewed by Chris Dumez.
664
665         This adds a set of "Service Workers can handle this" schemes to the scheme registry
666         and most of these WebKit changes are to support getting those values out to all processes.
667         
668         Additionally, WebsiteDataRecords used to be file/http(s)-only. That seems bizarre and definitely
669         got in the way of testing. So I also added a way to allow any scheme to result in a valid record.
670
671         * Shared/ChildProcess.cpp:
672         (WebKit::ChildProcess::registerURLSchemeServiceWorkersCanHandle const):
673         * Shared/ChildProcess.h:
674         * Shared/ChildProcess.messages.in:
675         
676         * Shared/Storage/StorageProcessCreationParameters.cpp:
677         (WebKit::StorageProcessCreationParameters::encode const):
678         (WebKit::StorageProcessCreationParameters::decode):
679         * Shared/Storage/StorageProcessCreationParameters.h:
680         
681         * Shared/WebProcessCreationParameters.cpp:
682         (WebKit::WebProcessCreationParameters::encode const):
683         (WebKit::WebProcessCreationParameters::decode):
684         * Shared/WebProcessCreationParameters.h:
685         
686         * StorageProcess/StorageProcess.cpp:
687         (WebKit::StorageProcess::initializeWebsiteDataStore):
688         
689         * UIProcess/API/Cocoa/WKProcessPool.mm:
690         (-[WKProcessPool _registerURLSchemeServiceWorkersCanHandle:]):
691         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
692         
693         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
694         (+[WKWebsiteDataStore _allowWebsiteDataRecordsForAllOrigins]):
695         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
696         
697         * UIProcess/WebProcessPool.cpp:
698         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
699         (WebKit::WebProcessPool::initializeNewWebProcess):
700         (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle):
701         * UIProcess/WebProcessPool.h:
702         
703         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
704         (WebKit::WebsiteDataStore::allowWebsiteDataRecordsForAllOrigins):
705         (WebKit::WebsiteDataStore::fetchDataAndApply):
706         * UIProcess/WebsiteData/WebsiteDataStore.h:
707         
708         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
709         (WebKit::WebServiceWorkerProvider::handleFetch):
710         
711         * WebProcess/WebProcess.cpp:
712         (WebKit::WebProcess::initializeWebProcess):
713
714 2017-12-18  Brady Eidson  <beidson@apple.com>
715
716         Apps that use both WK1 and WK2 can crash creating a WKWebsiteDataStore.
717         https://bugs.webkit.org/show_bug.cgi?id=180953
718
719         Reviewed by Chris Dumez.
720
721         * UIProcess/WebsiteData/WebsiteDataStore.cpp: Make an isMainThread() asset be an isUIThread() assert.
722
723 2017-12-18  Brent Fulgham  <bfulgham@apple.com>
724
725         [macOS, iOS] Add new mach lookup port for CoreMedia remote control
726         https://bugs.webkit.org/show_bug.cgi?id=180938
727         <rdar://problem/35447664>
728
729         Reviewed by Eric Carlson.
730
731         Update the app sandbox to support a new XPC endpoint for CoreMedia. This endpoint exposes
732         existing functions through a new, more-focused interface. This will (hopefully) allow us
733         to remove the more generic endpoints in a future update.
734
735         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
736         * WebProcess/com.apple.WebProcess.sb.in:
737
738 2017-12-18  Megan Gardner  <megan_gardner@apple.com>
739
740         Support Autoscrolling in contenteditable for WK2
741         https://bugs.webkit.org/show_bug.cgi?id=180789
742
743         Reviewed by Simon Frasier and Wenson Hsieh.
744
745         Implements the UIKit protocol for autoscrolling and alerts the Web Process to start
746         (or stop) an autoscroll to the specified position. Allows for scrolling in contenteditable
747         in WebKit2.
748
749         * Platform/spi/ios/UIKitSPI.h:
750         * UIProcess/WebPageProxy.h:
751         * UIProcess/ios/WKContentViewInteraction.h:
752         * UIProcess/ios/WKContentViewInteraction.mm:
753         (-[WKContentView startAutoscroll:]):
754         (-[WKContentView cancelAutoscroll]):
755         (-[WKContentView scrollSelectionToVisible:]):
756         * UIProcess/ios/WebPageProxyIOS.mm:
757         (WebKit::WebPageProxy::startAutoscrollAtPosition):
758         (WebKit::WebPageProxy::cancelAutoscroll):
759         * WebProcess/WebPage/WebPage.h:
760         * WebProcess/WebPage/WebPage.messages.in:
761         * WebProcess/WebPage/ios/WebPageIOS.mm:
762         (WebKit::WebPage::startAutoscrollAtPosition):
763         (WebKit::WebPage::cancelAutoscroll):
764
765 2017-12-18  Youenn Fablet  <youenn@apple.com>
766
767         Add support for response blob given to fetch events
768         https://bugs.webkit.org/show_bug.cgi?id=180894
769
770         Reviewed by Darin Adler.
771
772         In case of blob data, read it from Service Worker process and send it to WebProcess.
773         At some point, web process should be able to read it directly from NetworkProcess.
774
775         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
776         (WebKit::WebSWContextManagerConnection::startFetch):
777         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
778         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
779         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
780         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
781         (WebKit::WebServiceWorkerFetchTaskClient::didFinishBlobLoading):
782         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
783         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
784
785 2017-12-18  Daniel Bates  <dabates@apple.com>
786
787         Add SPI to query for the current and last auto fill button type and pass user data object to _webView:focusShouldStartInputSession:
788         https://bugs.webkit.org/show_bug.cgi?id=180774
789         <rdar://problem/36033832>
790
791         Reviewed by Tim Horton.
792
793         Have WKFocusedElementInfo own the optional user data object associated with the focused
794         element as opposed to having WKFormInputSession own it. This allows the Injected Bundle's
795         _webView:focusShouldStartInputSession: delegate callback to make use of this user data
796         to determine whether focus should start a new input session.
797
798         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
799         * UIProcess/ios/WKContentViewInteraction.mm:
800         (-[WKFormInputSession initWithContentView:focusedElementInfo:]):
801         (-[WKFormInputSession userObject]):
802         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
803         (-[WKFocusedElementInfo userObject]):
804         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
805         (-[WKFormInputSession initWithContentView:focusedElementInfo:userObject:]): Deleted.
806         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:]): Deleted.
807         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
808         (toWKAutoFillButtonType):
809         (-[WKWebProcessPlugInNodeHandle htmlInputElementAutoFillButtonType]):
810         (-[WKWebProcessPlugInNodeHandle htmlInputElementLastAutoFillButtonType]):
811         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
812         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
813         (toWKAutoFillButtonType):
814         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonType):
815         (WKBundleNodeHandleGetHTMLInputElementLastAutoFillButtonType):
816         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
817         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
818         (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonType const):
819         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastAutoFillButtonType const):
820         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
821
822 2017-12-18  Carlos Garcia Campos  <cgarcia@igalia.com>
823
824         [GTK][WPE] Add WebKitWebView::web-process-terminated signal and deprecate web-process-crashed
825         https://bugs.webkit.org/show_bug.cgi?id=180862
826
827         Reviewed by Michael Catanzaro.
828
829         Once the memory pressure web process monitor is enabled in bug #180861 the web process can be killed due to
830         memory limits. We need to expose the reason of the web process termination to allow applications handle the
831         memory limit case.
832
833         * UIProcess/API/glib/WebKitNavigationClient.cpp:
834         * UIProcess/API/glib/WebKitWebView.cpp:
835         (webkit_web_view_class_init):
836         (webkitWebViewWebProcessTerminated):
837         (webkitWebViewWebProcessCrashed): Deleted.
838         * UIProcess/API/glib/WebKitWebViewPrivate.h:
839         * UIProcess/API/gtk/WebKitWebView.h:
840         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
841         * UIProcess/API/wpe/WebKitWebView.h:
842
843 2017-12-18  Carlos Garcia Campos  <cgarcia@igalia.com>
844
845         [GTK][WPE] Enable WebProcess memory monitor
846         https://bugs.webkit.org/show_bug.cgi?id=180861
847
848         Reviewed by Michael Catanzaro.
849
850         For some reason this is only enabled in mac. We want to enable it also in GTK and WPE ports. This runs every 30
851         seconds to release memory or even kill the process if necessary. Carlos López has realized that in some
852         applications using video tags, the memory grows a lot and it's never released. It seems it's not memory leaked,
853         but simply large memory allocations (I guess it's gst allocating video frames) that make the heap grow. The
854         memory pressure calls malloc_trim that releases all that memory keeping the web process footprint stable.
855
856         * WebProcess/WebProcess.cpp:
857         (WebKit::WebProcess::initializeWebProcess):
858
859 2017-12-17  John Wilander  <wilander@apple.com>
860
861         Storage Access API: Make document.hasStorageAccess() retrieve current status from the network process
862         https://bugs.webkit.org/show_bug.cgi?id=180681
863         <rdar://problem/35982161>
864
865         Reviewed by Alex Christensen.
866
867         This change makes an asynchronous request to the network process
868         to see if storage access has been granted for this frame, on this
869         page, for this domain.
870
871         * NetworkProcess/NetworkProcess.cpp:
872         (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains):
873         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
874         * NetworkProcess/NetworkProcess.h:
875         * NetworkProcess/NetworkProcess.messages.in:
876         * UIProcess/Network/NetworkProcessProxy.cpp:
877         (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains):
878         * UIProcess/Network/NetworkProcessProxy.h:
879         * UIProcess/WebPageProxy.cpp:
880         (WebKit::WebPageProxy::hasStorageAccess):
881         * UIProcess/WebPageProxy.h:
882         * UIProcess/WebPageProxy.messages.in:
883         * UIProcess/WebResourceLoadStatisticsStore.cpp:
884         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
885         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
886         * UIProcess/WebResourceLoadStatisticsStore.h:
887         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
888         (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler):
889         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
890         (WebKit::WebsiteDataStore::hasStorageAccess):
891         * UIProcess/WebsiteData/WebsiteDataStore.h:
892         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
893         (WebKit::WebChromeClient::hasStorageAccess):
894         * WebProcess/WebCoreSupport/WebChromeClient.h:
895         * WebProcess/WebPage/WebPage.cpp:
896         (WebKit::WebPage::hasStorageAccess):
897         * WebProcess/WebPage/WebPage.h:
898
899 2017-12-16  Dan Bernstein  <mitz@apple.com>
900
901         WKWebView has no equivalent of -[WebView setAlwaysShowVerticalScroller:]
902         https://bugs.webkit.org/show_bug.cgi?id=180613
903         <rdar://problem/35946124>
904
905         Reviewed by Geoff Garen.
906
907         Added _alwaysShowsHorizontalScroller and _alwaysShowsVerticalScroller properties to
908         WKWebView.
909
910         * Shared/WebPageCreationParameters.cpp:
911         (WebKit::WebPageCreationParameters::encode const): Encode new alwaysShowsHorizontalScroller
912           and alwaysShowsVerticalScroller parameters.
913         (WebKit::WebPageCreationParameters::decode): Decode new parameters.
914
915         * Shared/WebPageCreationParameters.h: Added new alwaysShowsHorizontalScroller and
916           alwaysShowsVerticalScroller boolean parameters.
917
918         * UIProcess/API/Cocoa/WKWebView.mm:
919         (-[WKWebView _alwaysShowsHorizontalScroller]): New accessor that calls through to the
920           WebPageProxy.
921         (-[WKWebView _setAlwaysShowsHorizontalScroller:]): Ditto.
922         (-[WKWebView _alwaysShowsVerticalScroller]): Ditto.
923         (-[WKWebView _setAlwaysShowsVerticalScroller:]): Ditto.
924
925         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declare new properties.
926
927         * UIProcess/WebPageProxy.cpp:
928         (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller): Update member variable and send
929           a message to the page.
930         (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller): Ditto.
931         (WebKit::WebPageProxy::creationParameters): Initialize new parameters from the new member
932           variables.
933
934         * UIProcess/WebPageProxy.h:
935         (WebKit::WebPageProxy::alwaysShowsHorizontalScroller const): New getter.
936         (WebKit::WebPageProxy::alwaysShowsVerticalScroller const): Ditto.
937
938         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
939         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Factor
940           alwaysShowsHorizontalScroller and alwaysShowsVerticalScroller into the initial scroller
941           modes and scroller locks when creating the FrameView.
942
943         * WebProcess/WebPage/WebPage.cpp:
944         (WebKit::WebPage::WebPage): Initialize new m_alwaysShowsHorizontalScroller and
945           m_alwaysShowsVerticalScroller member variables from the corresponding new creation
946           parameters.
947         (WebKit::WebPage::setAlwaysShowsHorizontalScroller): Update the member variable and set
948           new scrollbar mode on the frame view if needed.
949         (WebKit::WebPage::setAlwaysShowsVerticalScroller): Ditto.
950
951         * WebProcess/WebPage/WebPage.h:
952         (WebKit::WebPage::alwaysShowsHorizontalScroller const): New getter.
953         (WebKit::WebPage::alwaysShowsVerticalScroller const): Ditto.
954
955         * WebProcess/WebPage/WebPage.messages.in: Added new messages.
956
957 2017-12-16  Brady Eidson  <beidson@apple.com>
958
959         Implement getting ServiceWorker registrations for the WKWebsiteDataStore API
960         https://bugs.webkit.org/show_bug.cgi?id=180886
961
962         Reviewed by Chris Dumez.
963
964         * StorageProcess/StorageProcess.cpp:
965         (WebKit::StorageProcess::fetchWebsiteData):
966
967 2017-12-16  Brent Fulgham  <bfulgham@apple.com>
968
969         Plugin processes are repeatedly spun up to do nothing
970         https://bugs.webkit.org/show_bug.cgi?id=180885
971         <rdar://problem/36082564>
972
973         Reviewed by Geoffrey Garen.
974
975         Tested by TestWebKitAPI.
976
977         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
978         (WebKit::WebsiteDataStore::removeData): Don't ask plugins to remove data when no websites are
979         passed to the function.
980
981 2017-12-15  Chris Dumez  <cdumez@apple.com>
982
983         Support updating a service worker registration's updateViaCache flag
984         https://bugs.webkit.org/show_bug.cgi?id=180888
985
986         Reviewed by Brady Eidson.
987
988         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
989         (WebKit::WebSWServerConnection::setRegistrationUpdateViaCache):
990         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
991         * WebProcess/Storage/WebSWClientConnection.messages.in:
992
993 2017-12-15  Alex Christensen  <achristensen@webkit.org>
994
995         Introduce SPI _WKWebsitePolicies.websiteDataStore
996         https://bugs.webkit.org/show_bug.cgi?id=180880
997         <rdar://problem/35535328>
998
999         Reviewed by Andy Estes.
1000
1001         The SPI doesn't do anything yet, but it already has some restrictions and tests!
1002         WKWebView._updateWebsitePolicies can't be used to update a WKWebsiteDataStore.  Only during navigation.
1003         Even during navigation, we are only supporting the default and ephemeral data stores right now.
1004         This functionality won't be supported in the C API.  This is enforced with RELEASE_ASSERTs.
1005         If we change our minds, we can change them and add restrictions similar to the ObjC restrictions.
1006
1007         * Shared/WebsitePoliciesData.cpp:
1008         (WebKit::WebsitePoliciesData::encode const):
1009         (WebKit::WebsitePoliciesData::decode):
1010         * Shared/WebsitePoliciesData.h:
1011         * UIProcess/API/APIWebsitePolicies.cpp:
1012         (API::WebsitePolicies::WebsitePolicies):
1013         (API::WebsitePolicies::setWebsiteDataStore):
1014         (API::WebsitePolicies::data):
1015         * UIProcess/API/APIWebsitePolicies.h:
1016         * UIProcess/API/C/WKFramePolicyListener.cpp:
1017         (WKFramePolicyListenerUseWithPolicies):
1018         * UIProcess/API/C/WKPage.cpp:
1019         (WKPageUpdateWebsitePolicies):
1020         * UIProcess/API/Cocoa/WKWebView.mm:
1021         (-[WKWebView _updateWebsitePolicies:]):
1022         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1023         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1024         (-[_WKWebsitePolicies websiteDataStore]):
1025         (-[_WKWebsitePolicies setWebsiteDataStore:]):
1026         * UIProcess/Cocoa/NavigationState.mm:
1027         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1028
1029 2017-12-15  Alex Christensen  <achristensen@webkit.org>
1030
1031         Fix GTK build.
1032
1033         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
1034         (webkit_policy_decision_use):
1035
1036 2017-12-15  Brent Fulgham  <bfulgham@apple.com>
1037
1038         Avoid waking plugin process up unnecessarily
1039         https://bugs.webkit.org/show_bug.cgi?id=180819
1040         <rdar://problem/36051548>
1041
1042         Reviewed by Geoffrey Garen.
1043
1044         WebKit purges data from origins marked as prevalent on an hourly interval. This includes waking up plugins
1045         and removing relevant data stored in those plugins. This causes multiple plugin processes to be spawned,
1046         even though the user is not interacting with any plugins.
1047
1048         Instead, we should delay removing data from plugins until they are loaded due to the user interacting with
1049         a website using a plugin.
1050
1051         Make the following changes:
1052         1. When looking for plugin data related to prevalent sites, only examine plugin data if the relevant plugin
1053            is already running.
1054         2. When the state of the active plugins changes, trigger a data removal check.
1055
1056         * Shared/WebsiteData/WebsiteDataFetchOption.h: Add a new option 'DoNotCreateProcesses'
1057         * UIProcess/Plugins/PluginProcessManager.cpp:
1058         (WebKit::PluginProcessManager::getPluginProcessConnection): Pass new argument 'Launch', since we always
1059         want to launch processes in this case.
1060         (WebKit::PluginProcessManager::fetchWebsiteData): Pass a new parameter 'processAccessType' so that the
1061         caller can specify if they only want to examine already-active plugins, or if they want to spawn new
1062         processes. Call the completion handler if we need to exit early when no process exists.
1063         (WebKit::PluginProcessManager::deleteWebsiteData): Always launch new processes.
1064         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames): Ditto.
1065         (WebKit::PluginProcessManager::getOrCreatePluginProcess): Accept new parameter indicating if new processes
1066         shoudl be launched. Also switch to C++ style loops.
1067         * UIProcess/Plugins/PluginProcessManager.h:
1068         * UIProcess/WebProcessProxy.cpp:
1069         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Use the
1070         new 'DoNotCreatePrcesses' access type.
1071         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1072         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Update the active plugin count when we
1073         remove data.
1074         (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords const): Return true if the active plugin
1075         process count changed since the last time data was removed.
1076         * UIProcess/WebResourceLoadStatisticsStore.h:
1077         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1078         (WebKit::WebsiteDataStore::fetchDataAndApply): Check fetch option for new 'DoNotCreateProcesses' flag,
1079         and tell the PluginProcessManager which mode we are using.
1080
1081 2017-12-15  Brady Eidson  <beidson@apple.com>
1082
1083         Make sure only WebsiteDataStores with valid SessionIDs register themselves.
1084         https://bugs.webkit.org/show_bug.cgi?id=180869
1085
1086         Reviewed by Chris Dumez.
1087
1088         Some code in WebsiteDataStore assumes an invalid SessionID is a possibility,
1089         but we didn't account for that in the map added in r225935.
1090
1091         Seems prudent to make sure we're not doing hash table operations with invalid keys.
1092
1093         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1094         (WebKit::WebsiteDataStore::WebsiteDataStore):
1095         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1096         (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap):
1097         (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID):
1098         * UIProcess/WebsiteData/WebsiteDataStore.h:
1099
1100 2017-12-14  Simon Fraser  <simon.fraser@apple.com>
1101
1102         Rotating when zoomed in with fingers down can result in a broken tab
1103         https://bugs.webkit.org/show_bug.cgi?id=180859
1104         rdar://problem/34532817
1105
1106         Reviewed by Tim Horton.
1107
1108         If you zoom in fully, then, with two fingers down, rotate the iPhone and rotate back,
1109         then the tab can get into a broken state where the WKContentView has a non-zero position
1110         which may push it entirely off-screen. The tab never recovers.
1111
1112         This is caused by a bug in UIKit (rdar://problem/36065495) so work around it by always
1113         re-setting the position of the content view after zooming. We initialize contentView.frame
1114         from self.bounds, so setting the position (via "center") to the bounds origin should always be safe.
1115
1116         * UIProcess/API/Cocoa/WKWebView.mm:
1117         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1118
1119 2017-12-15  Brady Eidson  <beidson@apple.com>
1120
1121         API test WebKit.WebsiteDataStoreCustomPaths is failing
1122         https://bugs.webkit.org/show_bug.cgi?id=180870
1123
1124         Reviewed by Chris Dumez.
1125
1126         To avoid unintentionally creating the default WebsiteDataStore we need to pass around the
1127         relevant SessionID to more places.
1128
1129         * UIProcess/ServiceWorkerProcessProxy.cpp:
1130         (WebKit::ServiceWorkerProcessProxy::start):
1131         * UIProcess/ServiceWorkerProcessProxy.h:
1132
1133         * UIProcess/WebProcessPool.cpp:
1134         (WebKit::WebProcessPool::getStorageProcessConnection):
1135         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1136         * UIProcess/WebProcessPool.h:
1137
1138         * UIProcess/WebProcessProxy.cpp:
1139         (WebKit::WebProcessProxy::getStorageProcessConnection):
1140         * UIProcess/WebProcessProxy.h:
1141         * UIProcess/WebProcessProxy.messages.in:
1142
1143         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1144         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
1145
1146         * WebProcess/Databases/WebDatabaseProvider.cpp:
1147         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
1148
1149         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1150         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
1151         (WebKit::WebServiceWorkerProvider::handleFetch):
1152
1153         * WebProcess/WebProcess.cpp:
1154         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
1155         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
1156         * WebProcess/WebProcess.h:
1157         * WebProcess/WebProcess.messages.in:
1158
1159 2017-12-15  Alex Christensen  <achristensen@webkit.org>
1160
1161         Move WebKit::WebsitePolicies to API::WebsitePolicies
1162         https://bugs.webkit.org/show_bug.cgi?id=180873
1163
1164         Reviewed by Joseph Pecoraro.
1165
1166         It's just an API data object now.  I need it to be in the API namespace so we can
1167         give it references to other API namespace objects without weird layering violations.
1168
1169         * CMakeLists.txt:
1170         * Shared/WebsiteAutoplayPolicy.h: Added.
1171         * Shared/WebsiteAutoplayQuirk.h: Added.
1172         * Shared/WebsitePoliciesData.cpp:
1173         (WebKit::WebsitePoliciesData::fromWebsitePolicies): Deleted.
1174         * Shared/WebsitePoliciesData.h:
1175         * UIProcess/API/APIWebsitePolicies.cpp: Added.
1176         (API::WebsitePolicies::~WebsitePolicies):
1177         (API::WebsitePolicies::data):
1178         * UIProcess/API/APIWebsitePolicies.h: Copied from Source/WebKit/UIProcess/WebsitePolicies.h.
1179         * UIProcess/API/C/WKAPICast.h:
1180         * UIProcess/API/C/WKFramePolicyListener.cpp:
1181         (WKFramePolicyListenerUseWithPolicies):
1182         * UIProcess/API/C/WKPage.cpp:
1183         (WKPageUpdateWebsitePolicies):
1184         * UIProcess/API/C/WKWebsitePolicies.cpp:
1185         (WKWebsitePoliciesGetTypeID):
1186         (WKWebsitePoliciesCreate):
1187         * UIProcess/API/Cocoa/WKWebView.mm:
1188         (-[WKWebView _updateWebsitePolicies:]):
1189         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1190         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1191         (-[_WKWebsitePolicies dealloc]):
1192         (-[_WKWebsitePolicies init]):
1193         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
1194         (WebKit::wrapper): Deleted.
1195         * UIProcess/Cocoa/NavigationState.mm:
1196         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1197         * UIProcess/WebFormSubmissionListenerProxy.cpp:
1198         * UIProcess/WebsitePolicies.h: Removed.
1199         * WebKit.xcodeproj/project.pbxproj:
1200         * WebProcess/WebPage/WebPage.cpp:
1201
1202 2017-12-14  Zan Dobersek  <zdobersek@igalia.com>
1203
1204         Unreviewed GTK+ build fix after r225954.
1205
1206         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
1207         Explicitly include the WebsitePoliciesData.h header, avoiding build
1208         failures due to incomplete WebsitePoliciesData type.
1209
1210 2017-12-14  David Kilzer  <ddkilzer@apple.com>
1211
1212         Enable -Wstrict-prototypes for WebKit
1213         <https://webkit.org/b/180757>
1214         <rdar://problem/36024132>
1215
1216         Rubber-stamped by Joseph Pecoraro.
1217
1218         * Configurations/Base.xcconfig:
1219         (CLANG_WARN_STRICT_PROTOTYPES): Add. Set to YES.
1220         * Platform/spi/ios/UIKitSPI.h:
1221         (_UIDragInteractionDefaultLiftDelay): Add 'void' to C function declaration.
1222         (UIKeyboardEnabledInputModesAllowOneToManyShortcuts): Ditto.
1223
1224 2017-12-14  Alex Christensen  <achristensen@webkit.org>
1225
1226         Serialize WebsitePoliciesData instead of WebsitePolicies
1227         https://bugs.webkit.org/show_bug.cgi?id=180847
1228
1229         Reviewed by Joseph Pecoraro.
1230
1231         No change in behavior.  This will allow me to add things to WebsitePolicies that have 
1232         a different form when serialized to another process.
1233         
1234         Also, remove API::WebsitePolicies because the wrapper isn't necessary.
1235         WebsitePolicies is now the API type that only exists in the UIProcess.
1236
1237         * Shared/WebsitePolicies.cpp: Removed.
1238         * Shared/WebsitePolicies.h:
1239         (WebKit::WebsitePolicies::contentBlockersEnabled const): Deleted.
1240         (WebKit::WebsitePolicies::setContentBlockersEnabled): Deleted.
1241         (WebKit::WebsitePolicies::allowedAutoplayQuirks const): Deleted.
1242         (WebKit::WebsitePolicies::setAllowedAutoplayQuirks): Deleted.
1243         (WebKit::WebsitePolicies::autoplayPolicy const): Deleted.
1244         (WebKit::WebsitePolicies::setAutoplayPolicy): Deleted.
1245         (WebKit::WebsitePolicies::customHeaderFields): Deleted.
1246         (WebKit::WebsitePolicies::takeCustomHeaderFields): Deleted.
1247         (WebKit::WebsitePolicies::setCustomHeaderFields): Deleted.
1248         * Shared/WebsitePoliciesData.cpp: Copied from Source/WebKit/Shared/WebsitePolicies.cpp.
1249         (WebKit::WebsitePoliciesData::fromWebsitePolicies):
1250         (WebKit::WebsitePoliciesData::encode const):
1251         (WebKit::WebsitePoliciesData::decode):
1252         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1253         (WebKit::WebsitePolicies::WebsitePolicies): Deleted.
1254         (WebKit::WebsitePolicies::encode const): Deleted.
1255         (WebKit::WebsitePolicies::decode): Deleted.
1256         (WebKit::WebsitePolicies::applyToDocumentLoader): Deleted.
1257         * Shared/WebsitePoliciesData.h: Added.
1258         * UIProcess/API/APINavigationClient.h:
1259         (API::NavigationClient::decidePolicyForNavigationAction):
1260         (API::NavigationClient::decidePolicyForNavigationResponse):
1261         * UIProcess/API/APIPolicyClient.h:
1262         (API::PolicyClient::decidePolicyForNavigationAction):
1263         (API::PolicyClient::decidePolicyForNewWindowAction):
1264         (API::PolicyClient::decidePolicyForResponse):
1265         * UIProcess/API/APIWebsitePolicies.cpp: Removed.
1266         * UIProcess/API/APIWebsitePolicies.h: Removed.
1267         * UIProcess/API/C/WKAPICast.h:
1268         * UIProcess/API/C/WKFramePolicyListener.cpp:
1269         (WKFramePolicyListenerUse):
1270         (WKFramePolicyListenerUseWithPolicies):
1271         * UIProcess/API/C/WKPage.cpp:
1272         (WKPageUpdateWebsitePolicies):
1273         (WKPageSetPagePolicyClient):
1274         (WKPageSetPageNavigationClient):
1275         * UIProcess/API/C/WKWebsitePolicies.cpp:
1276         (WKWebsitePoliciesGetTypeID):
1277         (WKWebsitePoliciesCreate):
1278         * UIProcess/API/Cocoa/WKWebView.mm:
1279         (-[WKWebView _updateWebsitePolicies:]):
1280         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1281         (-[_WKWebsitePolicies dealloc]):
1282         (-[_WKWebsitePolicies init]):
1283         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
1284         (WebKit::wrapper):
1285         * UIProcess/Cocoa/NavigationState.mm:
1286         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1287         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1288         * UIProcess/WebFrameListenerProxy.cpp:
1289         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
1290         * UIProcess/WebFrameListenerProxy.h:
1291         * UIProcess/WebFramePolicyListenerProxy.cpp:
1292         (WebKit::WebFramePolicyListenerProxy::use):
1293         (WebKit::WebFramePolicyListenerProxy::download):
1294         (WebKit::WebFramePolicyListenerProxy::ignore):
1295         * UIProcess/WebFramePolicyListenerProxy.h:
1296         * UIProcess/WebFrameProxy.cpp:
1297         (WebKit::WebFrameProxy::receivedPolicyDecision):
1298         * UIProcess/WebFrameProxy.h:
1299         * UIProcess/WebPageProxy.cpp:
1300         (WebKit::WebPageProxy::receivedPolicyDecision):
1301         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1302         (WebKit::WebPageProxy::updateWebsitePolicies):
1303         * UIProcess/WebPageProxy.h:
1304         * UIProcess/WebPageProxy.messages.in:
1305         * WebKit.xcodeproj/project.pbxproj:
1306         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1307         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1308         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1309         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1310         * WebProcess/WebPage/WebFrame.cpp:
1311         (WebKit::WebFrame::didReceivePolicyDecision):
1312         * WebProcess/WebPage/WebFrame.h:
1313         * WebProcess/WebPage/WebPage.cpp:
1314         (WebKit::WebPage::didReceivePolicyDecision):
1315         (WebKit::WebPage::updateWebsitePolicies):
1316         * WebProcess/WebPage/WebPage.h:
1317         * WebProcess/WebPage/WebPage.messages.in:
1318
1319 2017-12-14  Ryan Haddad  <ryanhaddad@apple.com>
1320
1321         Unreviewed, rolling out r225931.
1322
1323         Breaks internal builds.
1324
1325         Reverted changeset:
1326
1327         "Fix Mac CMake build"
1328         https://bugs.webkit.org/show_bug.cgi?id=180835
1329         https://trac.webkit.org/changeset/225931
1330
1331 2017-12-14  Chris Dumez  <cdumez@apple.com>
1332
1333         Clearing WebSite data on iOS does not clear the Fetch Cache
1334         https://bugs.webkit.org/show_bug.cgi?id=180846
1335         <rdar://problem/36060129>
1336
1337         Reviewed by Youenn Fablet.
1338
1339         When clearing WebSite data, construct the engine for the given sessionID
1340         if missing, instead of not clearing anything when the engine is missing.
1341
1342         * NetworkProcess/NetworkProcess.cpp:
1343         (WebKit::NetworkProcess::deleteWebsiteData):
1344         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1345
1346 2017-12-14  Chris Dumez  <cdumez@apple.com>
1347
1348         self.importScripts() should obey updateViaCache inside service workers
1349         https://bugs.webkit.org/show_bug.cgi?id=180826
1350
1351         Reviewed by Youenn Fablet.
1352
1353         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1354         (WebKit::WebSWServerConnection::setRegistrationLastUpdateTime):
1355         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1356         * WebProcess/Storage/WebSWClientConnection.messages.in:
1357
1358 2017-12-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1359
1360         Drop Thread::tryCreate
1361         https://bugs.webkit.org/show_bug.cgi?id=180808
1362
1363         Reviewed by Darin Adler.
1364
1365         We still return bool since IconDatabase::open returns `false` if it is opened twice.
1366
1367         * UIProcess/API/glib/IconDatabase.cpp:
1368         (WebKit::IconDatabase::open):
1369         * UIProcess/API/glib/IconDatabase.h:
1370
1371 2017-12-14  Brady Eidson  <beidson@apple.com>
1372
1373         REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing.
1374         https://bugs.webkit.org/show_bug.cgi?id=180722
1375
1376         Reviewed by Chris Dumez.
1377
1378         - Add a test-only accessor to get the number of WebProcesses hosting WebPages
1379         - Have WebsiteDataStore keep track of all instances so they can be looked up by SessionID
1380         - When the StorageProcess needs to establish a SW context connection on behalf of a specific SessionID,
1381           the UI process will now prefer using the WebsiteDataStore associated with that SessionID. This allows
1382           us to continue deferring creation of the default data store if it's not needed.
1383
1384         * StorageProcess/StorageProcess.cpp:
1385         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1386         (WebKit::StorageProcess::createServerToContextConnection):
1387         * StorageProcess/StorageProcess.h:
1388
1389         * StorageProcess/StorageToWebProcessConnection.cpp:
1390         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1391
1392         * UIProcess/API/Cocoa/WKProcessPool.mm:
1393         (-[WKProcessPool _webPageContentProcessCount]):
1394         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1395
1396         * UIProcess/Storage/StorageProcessProxy.cpp:
1397         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
1398         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
1399         * UIProcess/Storage/StorageProcessProxy.h:
1400         * UIProcess/Storage/StorageProcessProxy.messages.in:
1401
1402         * UIProcess/WebProcessPool.cpp:
1403         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1404         * UIProcess/WebProcessPool.h:
1405
1406         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1407         (WebKit::WebsiteDataStore::WebsiteDataStore):
1408         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1409         (WebKit::WebsiteDataStore::existingDataStoreForSessionID):
1410         * UIProcess/WebsiteData/WebsiteDataStore.h:
1411
1412 2017-12-14  John Wilander  <wilander@apple.com>
1413
1414         Storage Access API: Implement frame-specific access in the document.cookie layer
1415         https://bugs.webkit.org/show_bug.cgi?id=180682
1416         <rdar://problem/35982257>
1417
1418         Reviewed by Alex Christensen.
1419
1420         CookiesStrategy::cookiesForDOM(), CookiesStrategy::setCookiesFromDOM(),
1421         CookiesStrategy::cookieRequestHeaderFieldValue(), and
1422         CookiesStrategy::getRawCookies() now take optional parameters for
1423         frameID and pageID to allow frame-specific scoping of cookies.
1424
1425         This change makes the return values of FrameLoaderClient::frameID()
1426         and FrameLoaderClient::pageID() std::optional<uint64_t> so that
1427         WebCore can call those getters and get the right return values in
1428         WebKit and std:nullopt in WebKitLegacy.
1429
1430         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1431         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1432         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1433         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1434         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1435         * NetworkProcess/NetworkConnectionToWebProcess.h:
1436         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1437         * Shared/mac/CookieStorageShim.mm:
1438         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
1439         * WebProcess/Network/WebLoaderStrategy.cpp:
1440         (WebKit::WebLoaderStrategy::scheduleLoad):
1441             Now handles the fact that FrameLoaderClient::frameID() and
1442             FrameLoaderClient::pageID() return an optional.
1443         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1444         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1445         (WebKit::WebFrameLoaderClient::pageID const):
1446         (WebKit::WebFrameLoaderClient::frameID const):
1447             Now return an optional.
1448         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1449         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1450         (WebKit::WebPlatformStrategies::cookiesForDOM):
1451         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
1452         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1453         (WebKit::WebPlatformStrategies::getRawCookies):
1454         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1455
1456 2017-12-14  Alex Christensen  <achristensen@webkit.org>
1457
1458         Fix Mac CMake build
1459         https://bugs.webkit.org/show_bug.cgi?id=180835
1460
1461         Reviewed by Andy Estes.
1462
1463         * PlatformMac.cmake:
1464         * Shared/WebsiteDataStoreParameters.cpp:
1465         (WebKit::WebsiteDataStoreParameters::ephemeralParametersWithSessionID):
1466         * Shared/WebsiteDataStoreParameters.h:
1467         * UIProcess/API/APIAttachment.h:
1468         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1469         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1470         * WebProcess/WebPage/WebPage.cpp:
1471         (WebKit::WebPage::setSessionID):
1472
1473 2017-12-14  Alex Christensen  <achristensen@webkit.org>
1474
1475         Use move semantics for SandboxExtension::Handle
1476         https://bugs.webkit.org/show_bug.cgi?id=180792
1477
1478         Reviewed by Andy Estes.
1479         
1480         Passing them around as const SandboxExtension::Handle& is wrong because ownership is transferred and they are consumed.
1481         It only works now because their contents are mutable, which isn't a good use of mutable.
1482
1483         * NetworkProcess/Downloads/Download.cpp:
1484         (WebKit::Download::decideDestinationWithSuggestedFilename):
1485         (WebKit::Download::didDecideDownloadDestination):
1486         * NetworkProcess/Downloads/Download.h:
1487         * NetworkProcess/Downloads/DownloadManager.cpp:
1488         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1489         (WebKit::DownloadManager::resumeDownload):
1490         * NetworkProcess/Downloads/DownloadManager.h:
1491         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1492         (WebKit::Download::resume):
1493         * NetworkProcess/Downloads/ios/DownloadIOS.mm:
1494         (WebKit::Download::resume):
1495         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1496         (WebKit::Download::resume):
1497         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1498         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
1499         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob):
1500         * NetworkProcess/NetworkConnectionToWebProcess.h:
1501         * NetworkProcess/NetworkDataTask.h:
1502         (WebKit::NetworkDataTask::setPendingDownloadLocation):
1503         * NetworkProcess/NetworkDataTaskBlob.cpp:
1504         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
1505         * NetworkProcess/NetworkDataTaskBlob.h:
1506         * NetworkProcess/NetworkProcess.cpp:
1507         (WebKit::NetworkProcess::resumeDownload):
1508         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
1509         * NetworkProcess/NetworkProcess.h:
1510         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1511         (WebKit::NetworkResourceLoadParameters::decode):
1512         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1513         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1514         (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
1515         * Shared/SandboxExtension.h:
1516         (WebKit::SandboxExtension::create):
1517         * Shared/WebMemorySampler.cpp:
1518         (WebKit::WebMemorySampler::start):
1519         (WebKit::WebMemorySampler::initializeSandboxedLogFile):
1520         * Shared/WebMemorySampler.h:
1521         * Shared/mac/SandboxExtensionMac.mm:
1522         (WebKit::SandboxExtension::create):
1523         * StorageProcess/StorageProcess.cpp:
1524         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs):
1525         * StorageProcess/StorageProcess.h:
1526         * UIProcess/Cocoa/WebViewImpl.mm:
1527         (WebKit::WebViewImpl::performDragOperation):
1528         * UIProcess/WebPageProxy.cpp:
1529         (WebKit::WebPageProxy::dragEntered):
1530         (WebKit::WebPageProxy::dragUpdated):
1531         (WebKit::WebPageProxy::dragExited):
1532         (WebKit::WebPageProxy::performDragOperation):
1533         (WebKit::WebPageProxy::performDragControllerAction):
1534         * UIProcess/WebPageProxy.h:
1535         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1536         (WebKit::InjectedBundle::create):
1537         * WebProcess/InjectedBundle/InjectedBundle.h:
1538         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp:
1539         (WebKit::MediaDeviceSandboxExtensions::operator[]):
1540         (WebKit::MediaDeviceSandboxExtensions::operator[] const): Deleted.
1541         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:
1542         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1543         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions):
1544         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1545         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1546         (WebKit::WebPlatformStrategies::getPathnamesForType):
1547         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1548         (WebKit::WebBackForwardListProxy::goToItem):
1549         * WebProcess/WebPage/WebPage.cpp:
1550         (WebKit::WebPage::loadRequest):
1551         (WebKit::WebPage::reload):
1552         (WebKit::WebPage::performDragControllerAction):
1553         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
1554         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
1555         * WebProcess/WebPage/WebPage.h:
1556         * WebProcess/WebProcess.cpp:
1557         (WebKit::WebProcess::startMemorySampler):
1558         * WebProcess/WebProcess.h:
1559
1560 2017-12-14  Alex Christensen  <achristensen@webkit.org>
1561
1562         Make WebsitePolicies a proper class with getters and setters
1563         https://bugs.webkit.org/show_bug.cgi?id=180788
1564
1565         Reviewed by Andy Estes.
1566
1567         Also introduce WebsitePolicies::applyToDocumentLoader to reduce duplicate code.
1568         This has a side-effect of now applying custom http header fields and content blocking enabled status
1569         when updating WebsitePolicies.  This will result in these being applied when a user updates
1570         the per-site settings, and they weren't before.
1571
1572         * CMakeLists.txt:
1573         * Shared/WebsitePolicies.cpp: Added.
1574         (WebKit::WebsitePolicies::WebsitePolicies):
1575         (WebKit::WebsitePolicies::encode const):
1576         (WebKit::WebsitePolicies::decode):
1577         (WebKit::WebsitePolicies::applyToDocumentLoader):
1578         * Shared/WebsitePolicies.h:
1579         (WebKit::WebsitePolicies::contentBlockersEnabled const):
1580         (WebKit::WebsitePolicies::setContentBlockersEnabled):
1581         (WebKit::WebsitePolicies::allowedAutoplayQuirks const):
1582         (WebKit::WebsitePolicies::setAllowedAutoplayQuirks):
1583         (WebKit::WebsitePolicies::autoplayPolicy const):
1584         (WebKit::WebsitePolicies::setAutoplayPolicy):
1585         (WebKit::WebsitePolicies::customHeaderFields):
1586         (WebKit::WebsitePolicies::takeCustomHeaderFields):
1587         (WebKit::WebsitePolicies::setCustomHeaderFields):
1588         (WebKit::WebsitePolicies::encode const): Deleted.
1589         (WebKit::WebsitePolicies::decode): Deleted.
1590         * UIProcess/API/APIWebsitePolicies.h:
1591         * WebKit.xcodeproj/project.pbxproj:
1592         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1593         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1594         * WebProcess/WebPage/WebPage.cpp:
1595         (WebKit::WebPage::updateWebsitePolicies):
1596         * WebProcess/WebPage/WebPage.h:
1597
1598 2017-12-14  Chris Dumez  <cdumez@apple.com>
1599
1600         Enable Service Workers on iOS
1601         https://bugs.webkit.org/show_bug.cgi?id=180836
1602
1603         Reviewed by Alex Christensen.
1604
1605         * Shared/WebPreferencesDefaultValues.h:
1606         * UIProcess/WebProcessPool.cpp:
1607         Enable Service Workers on iOS.
1608
1609         (WebKit::WebProcessPool::ensureNetworkProcess):
1610         Fall back to defaultCacheStorageDirectory() instead of the empty string
1611         for the cache storage directory, when we do not have a store.
1612
1613 2017-12-14  Chris Dumez  <cdumez@apple.com>
1614
1615         Service worker script fetching currently always uses the network cache
1616         https://bugs.webkit.org/show_bug.cgi?id=180816
1617
1618         Reviewed by Alex Christensen.
1619
1620         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1621         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1622         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1623         * WebProcess/Storage/WebSWClientConnection.messages.in:
1624
1625 2017-12-14  Chris Dumez  <cdumez@apple.com>
1626
1627         StorageProcess::deleteWebsiteData() should ensure there is a SWServer for the given sessionID
1628         https://bugs.webkit.org/show_bug.cgi?id=180784
1629
1630         Reviewed by Youenn Fablet.
1631
1632         StorageProcess::deleteWebsiteData() should ensure there is a SWServer for the given sessionID
1633         instead of not clearing anything when no such SWServer exists.
1634
1635         This will be useful on iOS once <rdar://problem/36034667> is fully fixed.
1636
1637         * StorageProcess/StorageProcess.cpp:
1638         (WebKit::StorageProcess::deleteWebsiteData):
1639         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1640         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1641         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1642
1643 2017-12-14  Chris Dumez  <cdumez@apple.com>
1644
1645         WebsiteDataStore::defaultDataStoreConfiguration() fails to set default value for serviceWorkerRegistrationDirectory
1646         https://bugs.webkit.org/show_bug.cgi?id=180794
1647         <rdar://problem/36034667>
1648
1649         Reviewed by Youenn Fablet.
1650
1651         Set the default IndexedDB and ServiceWorker database paths in WebsiteDataStore::defaultDataStoreConfiguration().
1652         Without this, the client is forced to set the expected path.
1653
1654         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1655         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1656         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1657         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1658
1659 2017-12-14  Joseph Pecoraro  <pecoraro@apple.com>
1660
1661         Web Inspector: Cmd-Option-R in docked inspector causes the inspector to reload instead of the inspected page
1662         https://bugs.webkit.org/show_bug.cgi?id=180775
1663         <rdar://problem/35964592>
1664
1665         Reviewed by Brian Burg.
1666
1667         * WebKit.xcodeproj/project.pbxproj:
1668         Remove old files add new files.
1669
1670         * PlatformMac.cmake:
1671         * UIProcess/mac/WKWebInspectorWKWebView.h: Removed.
1672         * UIProcess/mac/WKWebInspectorWKWebView.mm: Removed.
1673         Remove unused WKWebInspectorWKWebView.
1674
1675         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
1676         * UIProcess/mac/WKInspectorViewController.mm:
1677         (-[WKInspectorViewController dealloc]):
1678         (-[WKInspectorViewController webView]):
1679         (-[WKInspectorViewController inspectorWKWebViewReload:]):
1680         (-[WKInspectorViewController inspectorWKWebViewReloadFromOrigin:]):
1681         Handle WKWebView IBActions sent to the inspector frontend WKWebView.
1682
1683         * UIProcess/mac/WKInspectorWKWebView.h:
1684         * UIProcess/mac/WKInspectorWKWebView.mm:
1685         (-[WKInspectorWKWebView tag]):
1686         (-[WKInspectorWKWebView inspectorWKWebViewDelegate]):
1687         (-[WKInspectorWKWebView setInspectorWKWebViewDelegate:]):
1688         (-[WKInspectorWKWebView reload:]):
1689         (-[WKInspectorWKWebView reloadFromOrigin:]):
1690         Move WKInspectorWKWebView into its own file. Include a delegate
1691         to handle reload IBActions that will want to override.
1692
1693 2017-12-13  Chris Dumez  <cdumez@apple.com>
1694
1695         Fix copy/paste error in ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration()
1696         https://bugs.webkit.org/show_bug.cgi?id=180782
1697
1698         Reviewed by Youenn Fablet.
1699
1700         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1701         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1702
1703 2017-12-13  Daniel Bates  <dabates@apple.com>
1704
1705         Add more auto fill button types
1706         https://bugs.webkit.org/show_bug.cgi?id=180651
1707         <rdar://problem/35891125>
1708         And
1709         <rdar://problem/35977943>
1710
1711         Reviewed by Brent Fulgham.
1712
1713         Adds enumerators for the new auto fill button types.
1714
1715         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
1716         (toAutoFillButtonType):
1717         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
1718         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1719         (toAutoFillButtonType):
1720         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1721
1722 2017-12-13  Matt Lewis  <jlewis3@apple.com>
1723
1724         Unreviewed, rolling out r225864.
1725
1726         This caused the Layout test step to crash out on Debug testers
1727
1728         Reverted changeset:
1729
1730         "REGRESSION (r225789): API tests
1731         WKProcessPool.InitialWarmedProcessUsed and
1732         WebKit.WebsiteDataStoreCustomPaths are failing."
1733         https://bugs.webkit.org/show_bug.cgi?id=180722
1734         https://trac.webkit.org/changeset/225864
1735
1736 2017-12-13  Brady Eidson  <beidson@apple.com>
1737
1738         REGRESSION (r225789): API tests WKProcessPool.InitialWarmedProcessUsed and WebKit.WebsiteDataStoreCustomPaths are failing.
1739         https://bugs.webkit.org/show_bug.cgi?id=180722
1740
1741         Reviewed by Chris Dumez.
1742
1743         - Add a test-only accessor to get the number of WebProcesses hosting WebPages
1744         - Have WebsiteDataStore keep track of all instances so they can be looked up by SessionID
1745         - When the StorageProcess needs to establish a SW context connection on behalf of a specific SessionID,
1746           the UI process will now prefer using the WebsiteDataStore associated with that SessionID. This allows
1747           us to continue deferring creation of the default data store if it's not needed.
1748
1749         * StorageProcess/StorageProcess.cpp:
1750         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1751         (WebKit::StorageProcess::createServerToContextConnection):
1752         * StorageProcess/StorageProcess.h:
1753
1754         * StorageProcess/StorageToWebProcessConnection.cpp:
1755         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1756
1757         * UIProcess/API/Cocoa/WKProcessPool.mm:
1758         (-[WKProcessPool _webPageContentProcessCount]):
1759         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1760
1761         * UIProcess/Storage/StorageProcessProxy.cpp:
1762         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
1763         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
1764         * UIProcess/Storage/StorageProcessProxy.h:
1765         * UIProcess/Storage/StorageProcessProxy.messages.in:
1766
1767         * UIProcess/WebProcessPool.cpp:
1768         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1769         * UIProcess/WebProcessPool.h:
1770
1771         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1772         (WebKit::WebsiteDataStore::WebsiteDataStore):
1773         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1774         (WebKit::WebsiteDataStore::existingDataStoreForSessionID):
1775         * UIProcess/WebsiteData/WebsiteDataStore.h:
1776
1777 2017-12-13  Per Arne Vollan  <pvollan@apple.com>
1778
1779         REGRESSION(225597): Can't select a text box or web view on a page when VO is on.
1780         https://bugs.webkit.org/show_bug.cgi?id=180756
1781         <rdar://problem/35996158>
1782
1783         Reviewed by Brent Fulgham.
1784
1785         * Platform/IPC/mac/ConnectionMac.mm:
1786         (IPC::AccessibilityProcessSuspendedNotification):
1787         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1788         (WebKit::shouldLeakBoost):
1789         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
1790         * WebProcess/WebProcess.cpp:
1791         (WebKit::WebProcess::initializeProcess):
1792
1793 2017-12-13  Brent Fulgham  <bfulgham@apple.com>
1794
1795         [iOS] Further Trim WebContent Process sandbox
1796         https://bugs.webkit.org/show_bug.cgi?id=180727
1797         <rdar://problem/18899506>
1798
1799         Reviewed by Eric Carlson.
1800
1801         Take another pass over the contents of the file and remove addition items that
1802         don't have call sites in WebKit.
1803
1804         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1805
1806 2017-12-13  Daniel Bates  <dabates@apple.com>
1807
1808         Move out-parameter in API::FormClient::willBeginInputSession() to the end of the parameter list
1809         https://bugs.webkit.org/show_bug.cgi?id=180754
1810
1811         Reviewed by Wenson Hsieh.
1812
1813         Group all in-parameters in the signature of API::FormClient::willBeginInputSession() at
1814         the front of the parameter list instead of interspersing in- and out- parameters.
1815
1816         No functionality changed. So, no new tests.
1817
1818         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1819         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1820         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
1821         (API::InjectedBundle::FormClient::willBeginInputSession):
1822         * WebProcess/WebPage/WebPage.cpp:
1823         (WebKit::WebPage::elementDidFocus):
1824
1825 2017-12-13  Chris Dumez  <cdumez@apple.com>
1826
1827         [iOS] Take process assertion to prevent the service worker process from getting suspended
1828         https://bugs.webkit.org/show_bug.cgi?id=180735
1829
1830         Reviewed by Brady Eidson.
1831
1832         Take process assertion to prevent the service worker process from getting suspended while
1833         it is still needed. We use the same policy as for the network process, meaning that
1834         unsuspended WebContent processes prevent the service worker process from getting suspended.
1835
1836         This patch still does not enable service workers on iOS. The demo at https://mdn.github.io/sw-test/
1837         appears to work. However, things are not working as expected for mobile.twitter.com where I
1838         see the fetches intercepted by the service worker fail when offline for some reason (unrelated
1839         to process suspension).
1840
1841         * UIProcess/WebProcessPool.cpp:
1842         (WebKit::m_foregroundWebProcessCounter):
1843         (WebKit::m_backgroundWebProcessCounter):
1844         (WebKit::WebProcessPool::ensureNetworkProcess):
1845         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1846         (WebKit::WebProcessPool::disconnectProcess):
1847         (WebKit::WebProcessPool::updateProcessAssertions):
1848         (WebKit::WebProcessPool::reinstateNetworkProcessAssertionState):
1849         * UIProcess/WebProcessPool.h:
1850         * UIProcess/WebProcessProxy.cpp:
1851         (WebKit::WebProcessProxy::didSetAssertionState):
1852         * UIProcess/WebProcessProxy.h:
1853
1854 2017-12-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1855
1856         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.3 release.
1857
1858         * gtk/NEWS: Add release notes for 2.19.3.
1859
1860 2017-12-12  Daniel Bates  <dabates@apple.com>
1861
1862         [WK] Add modern WebKit SPI to set auto fill button type and query if the auto fill button is enabled
1863         https://bugs.webkit.org/show_bug.cgi?id=180686
1864
1865         Reviewed by Alex Christensen.
1866
1867         * WebKit.xcodeproj/project.pbxproj:
1868         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
1869         (-[WKWebProcessPlugInNodeHandle isHTMLInputElementAutoFillButtonEnabled]):
1870         (toAutoFillButtonType):
1871         (-[WKWebProcessPlugInNodeHandle setHTMLInputElementAutoFillButtonEnabledWithButtonType:]):
1872         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h:
1873         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
1874
1875 2017-12-12  John Wilander  <wilander@apple.com>
1876
1877         Storage Access API: Implement frame-specific access in the network storage session layer
1878         https://bugs.webkit.org/show_bug.cgi?id=180679
1879         <rdar://problem/35982116>
1880
1881         Reviewed by Alex Christensen.
1882
1883         This changes adds frameID and pageID to what is communicated for
1884         storage access and also stored in the network process' table of
1885         partitioning exceptions.
1886
1887         * NetworkProcess/NetworkDataTask.cpp:
1888         (WebKit::NetworkDataTask::create):
1889             Now stores frameID and pageID for the task for easy retrieval
1890             in the HSTS checks.
1891         * NetworkProcess/NetworkProcess.cpp:
1892         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
1893         * NetworkProcess/NetworkProcess.h:
1894         * NetworkProcess/NetworkProcess.messages.in:
1895         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1896         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1897         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1898         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1899             These two methods now submit frameID and pageID to the
1900             partitioning query call.
1901         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1902         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1903         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1904             These two methods now submit frameID and pageID to the
1905             partitioning query call.
1906         * UIProcess/Network/NetworkProcessProxy.cpp:
1907         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains):
1908         * UIProcess/Network/NetworkProcessProxy.h:
1909         * UIProcess/WebPageProxy.cpp:
1910         (WebKit::WebPageProxy::requestStorageAccess):
1911         * UIProcess/WebPageProxy.h:
1912         * UIProcess/WebPageProxy.messages.in:
1913         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1914         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1915         * UIProcess/WebResourceLoadStatisticsStore.h:
1916         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1917         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler):
1918         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1919         (WebKit::WebsiteDataStore::requestStorageAccess):
1920         * UIProcess/WebsiteData/WebsiteDataStore.h:
1921         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1922         (WebKit::WebChromeClient::requestStorageAccess):
1923         * WebProcess/WebCoreSupport/WebChromeClient.h:
1924         * WebProcess/WebPage/WebPage.cpp:
1925         (WebKit::WebPage::requestStorageAccess):
1926         * WebProcess/WebPage/WebPage.h:
1927
1928 2017-12-12  Alex Christensen  <achristensen@webkit.org>
1929
1930         Modernize WebsiteDataStoreParameters and SandboxExtension::Handle decoding
1931         https://bugs.webkit.org/show_bug.cgi?id=180621
1932
1933         Reviewed by Youenn Fablet.
1934
1935         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1936         (WebKit::NetworkProcessCreationParameters::decode):
1937         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1938         (WebKit::NetworkResourceLoadParameters::decode):
1939         * Shared/LoadParameters.cpp:
1940         (WebKit::LoadParameters::decode):
1941         * Shared/SandboxExtension.h:
1942         (WebKit::decode):
1943         (WebKit::SandboxExtension::Handle::decode): Deleted.
1944         * Shared/Storage/StorageProcessCreationParameters.cpp:
1945         (WebKit::StorageProcessCreationParameters::decode):
1946         * Shared/WebProcessCreationParameters.cpp:
1947         (WebKit::WebProcessCreationParameters::decode):
1948         * Shared/WebsiteDataStoreParameters.cpp:
1949         (WebKit::WebsiteDataStoreParameters::decode):
1950         * Shared/WebsiteDataStoreParameters.h:
1951         * Shared/mac/SandboxExtensionMac.mm:
1952         (WebKit::SandboxExtension::Handle::decode):
1953         (WebKit::SandboxExtension::HandleArray::HandleArray):
1954         (WebKit::SandboxExtension::HandleArray::encode const):
1955         (WebKit::SandboxExtension::HandleArray::decode):
1956         (WebKit::SandboxExtension::SandboxExtension):
1957
1958 2017-12-12  John Wilander  <wilander@apple.com>
1959
1960         Dispatch resource load statistics telemetry on the main thread
1961         https://bugs.webkit.org/show_bug.cgi?id=180602
1962         <rdar://problem/35942205>
1963
1964         Reviewed by Brent Fulgham.
1965
1966         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1967         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1968             Now switches to the main thread for the telemetry submission
1969             through a webpage proxy. The reason is that the webpage we
1970             use may go away while we're still using it. This kind of
1971             telemetry isn't associated with a specific webpage but the
1972             infrastructure requires a webpage proxy.
1973
1974 2017-12-12  Myles C. Maxfield  <mmaxfield@apple.com>
1975
1976         IPC code doesn't understand NSDictionaries with non-NSString keys
1977         https://bugs.webkit.org/show_bug.cgi?id=180307
1978         <rdar://problem/35812382>
1979
1980         Reviewed by Alex Christensen.
1981
1982         Variable fonts have a dictionary inside its descriptor which represents the values
1983         of all the axes of the variable font. Our IPC code wasn't expecting this.
1984
1985         * Shared/mac/ArgumentCodersMac.mm:
1986         (IPC::encode):
1987         (IPC::decode):
1988
1989 2017-12-12  Brent Fulgham  <bfulgham@apple.com>
1990
1991         Unreviewed build fix after r225763.
1992
1993         Remove dangling close-parentheses character.
1994
1995         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1996
1997 2017-12-12  Zach Li  <zachli@apple.com>
1998
1999         [WK2] Expose image via WKBundleHitTestResult API.
2000         https://bugs.webkit.org/show_bug.cgi?id=180552.
2001         rdar://problem/23951521
2002
2003         Reviewed by Simon Fraser.
2004
2005         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2006         (WKBundleHitTestResultGetImage):
2007         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
2008
2009         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2010         (WebKit::InjectedBundleHitTestResult::image const):
2011         Convert from WebCore::Image to WebImage by creating a WebImage
2012         and paint the WebCore::Image into its graphics context. For now,
2013         only handle bitmap images.
2014         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2015
2016 2017-12-12  Simon Fraser  <simon.fraser@apple.com>
2017
2018         Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace
2019         https://bugs.webkit.org/show_bug.cgi?id=180689
2020
2021         Reviewed by Tim Horton.
2022
2023         Remove encoding of ColorSpaceDeviceRGB.
2024
2025         * Shared/WebCoreArgumentCoders.h:
2026
2027 2017-12-12  Brent Fulgham  <bfulgham@apple.com>
2028
2029         REGRESSION(r216941): Plugin Process can't access AppStore Plugin Service
2030         https://bugs.webkit.org/show_bug.cgi?id=180701
2031         <rdar://problem/35940948>
2032
2033         Reviewed by Daniel Bates.
2034
2035         The PluginProcess needs access to the AppStore Plugin XPC service.
2036
2037         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2038
2039 2017-12-12  Brady Eidson  <beidson@apple.com>
2040
2041         Make ServiceWorkers follow the DEFAULT_EXPERIMENTAL_FEATURES_ENABLED flag on Mac.
2042         <rdar://problem/35978311> and https://bugs.webkit.org/show_bug.cgi?id=180697
2043
2044         Reviewed by Chris Dumez.
2045
2046         * Shared/WebPreferences.yaml:
2047         * Shared/WebPreferencesDefaultValues.h:
2048
2049 2017-12-12  Chris Dumez  <cdumez@apple.com>
2050
2051         Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage()
2052         https://bugs.webkit.org/show_bug.cgi?id=180683
2053
2054         Reviewed by Brady Eidson.
2055
2056         Merge the 2 code paths from calling postMessage() from a ServiceWorkerClient and from
2057         a ServiceWorker. Also, postMessage() now only IPCs an identifier from the WebContent
2058         process to the StorageProcess. The ServiceWorkerClientData is looked up on Storage
2059         process side from the identifier before being sent to the context process.
2060
2061         * Scripts/webkit/messages.py:
2062         (forward_declarations_and_headers):
2063         (headers_for_type):
2064         * Shared/WebCoreArgumentCoders.cpp:
2065         (IPC::ArgumentCoder<ServiceWorkerOrClientIdentifier>::encode):
2066         (IPC::ArgumentCoder<ServiceWorkerOrClientIdentifier>::decode):
2067         * Shared/WebCoreArgumentCoders.h:
2068         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2069         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2070         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2071         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2072         * WebProcess/Storage/WebSWClientConnection.cpp:
2073         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
2074         * WebProcess/Storage/WebSWClientConnection.h:
2075
2076 2017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2077
2078         [WTF] Thread::create should have Thread::tryCreate
2079         https://bugs.webkit.org/show_bug.cgi?id=180333
2080
2081         Reviewed by Darin Adler.
2082
2083         * UIProcess/API/glib/IconDatabase.cpp:
2084         (WebKit::IconDatabase::open):
2085         * UIProcess/linux/MemoryPressureMonitor.cpp:
2086         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
2087
2088 2017-12-11  Zan Dobersek  <zdobersek@igalia.com>
2089
2090         [CoordGraphics] Move UpdateAtlas, AreaAllocator into the platform layer
2091         https://bugs.webkit.org/show_bug.cgi?id=180641
2092
2093         Reviewed by Michael Catanzaro.
2094
2095         Move the UpdateAtlas and AreaAllocator classes into the platform layer,
2096         moving over build targets and adjust UpdateAtlas class references in
2097         CompositingCoordinator.
2098
2099         * PlatformGTK.cmake:
2100         * PlatformWPE.cmake:
2101         * PlatformWin.cmake:
2102         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2103
2104 2017-12-11  Alex Christensen  <achristensen@webkit.org>
2105
2106         Add a WKPageGroupRef setter in WKWebViewConfiguration
2107         https://bugs.webkit.org/show_bug.cgi?id=180674
2108         <rdar://problem/35920392>
2109
2110         Reviewed by Brady Eidson.
2111
2112         There is a Mac app trying to transition to WKWebView, and it uses WKPageGroupRef extensively.
2113         To help it transition, we are temporarily giving it an ObjC way to use this organization for
2114         its UserContentControllers to be united per PageGroup before it transitions away from SPIs like
2115         WKBundleAddUserScript.  Make it Mac-only to indicate that this should be transitioned away from,
2116         rather than adopted on iOS.
2117         
2118         No change in behavior for apps not using the new WKWebViewConfiguration._pageGroup SPI.
2119
2120         * UIProcess/API/Cocoa/WKWebView.mm:
2121         (-[WKWebView _initializeWithConfiguration:]):
2122         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2123         (-[WKWebViewConfiguration copyWithZone:]):
2124         (-[WKWebViewConfiguration _pageGroup]):
2125         (-[WKWebViewConfiguration _setPageGroup:]):
2126         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2127
2128 2017-12-11  Brent Fulgham  <bfulgham@apple.com>
2129
2130         [iOS] Remove unused services from WebContent Process sandbox
2131         https://bugs.webkit.org/show_bug.cgi?id=180670
2132
2133         Reviewed by Eric Carlson.
2134
2135         Pare down the set of sandbox exceptions in the iOS WebContent process sandbox to just
2136         those services actually in use:
2137         1. Remove unused code.
2138         2. Instead of defining a 'UIKit-app' function and calling it, just declare the individual sandbox
2139         commands inline. This will allow them to be more easily consolidated with other parts of the
2140         sandbox in a future step.
2141
2142         This update should not change behavior.
2143
2144         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2145
2146 2017-12-11  Chris Dumez  <cdumez@apple.com>
2147
2148         Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData
2149         https://bugs.webkit.org/show_bug.cgi?id=180669
2150
2151         Reviewed by Youenn Fablet.
2152
2153         Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData, for consistency with
2154         ServiceWorkerIdentifier / ServiceWorkerData, and start simplifying the postMessage() code.
2155
2156         * Scripts/webkit/messages.py:
2157         (forward_declarations_and_headers):
2158         (headers_for_type):
2159         * Shared/WebCoreArgumentCoders.cpp:
2160         (IPC::ArgumentCoder<ServiceWorkerOrClientData>::encode):
2161         (IPC::ArgumentCoder<ServiceWorkerOrClientData>::decode):
2162         * Shared/WebCoreArgumentCoders.h:
2163         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2164         (WebKit::WebSWServerConnection::~WebSWServerConnection):
2165         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
2166         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
2167         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
2168         (WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
2169         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2170         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2171         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2172         (WebKit::WebSWServerToContextConnection::matchAllCompleted):
2173         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2174         * WebProcess/Storage/WebSWClientConnection.cpp:
2175         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
2176         (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
2177         * WebProcess/Storage/WebSWClientConnection.h:
2178         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2179         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
2180         (WebKit::WebSWContextManagerConnection::matchAllCompleted):
2181         * WebProcess/Storage/WebSWContextManagerConnection.h:
2182         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2183
2184 2017-12-11  Youenn Fablet  <youenn@apple.com>
2185
2186         RTCPacketOptions::packet_id should be encoded as 32 bits integer.
2187         https://bugs.webkit.org/show_bug.cgi?id=180654
2188
2189         Reviewed by Eric Carlson.
2190
2191         packet_id is a 16 bit unsigned integer, but it can also take -1 if its value is not set.
2192         Before the patch, it was IPC encoded as a 16 bit signed integer which is not large enough.
2193
2194         * Shared/RTCPacketOptions.cpp:
2195         (WebKit::RTCPacketOptions::encode const):
2196         (WebKit::RTCPacketOptions::decode):
2197
2198 2017-12-11  Chris Dumez  <cdumez@apple.com>
2199
2200         Layout Test http/tests/workers/service/postmessage-after-sw-process-crash.https.html is flaky
2201         https://bugs.webkit.org/show_bug.cgi?id=180659
2202
2203         Reviewed by Youenn Fablet.
2204
2205         Fix flaky crash due to capturing an IPC::DataReference in a lambda, which would point to invalid
2206         memory when the lambda is called asynchronously.
2207
2208         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2209         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
2210         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
2211
2212 2017-12-11  Brent Fulgham  <bfulgham@apple.com>
2213
2214         [iOS] Don't import 'UIKit-apps.sb' to the WebContent process sandbox
2215         https://bugs.webkit.org/show_bug.cgi?id=180610
2216         <rdar://problem/18899506>
2217
2218         Reviewed by Dean Jackson.
2219
2220         Stop including 'system.sb', and just include the portions of that sandbox that we
2221         actually use in WebContent Process. This is the first step in some further sandbox
2222         tightening.
2223
2224         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2225
2226 2017-12-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2227
2228         [WTF] Add Converter traits to StringHasher instead of function pointer
2229         https://bugs.webkit.org/show_bug.cgi?id=180656
2230
2231         Reviewed by JF Bastien.
2232
2233         * WebProcess/WebProcess.cpp:
2234         (WebKit::addCaseFoldedCharacters):
2235
2236 2017-12-11  David Quesada  <david_quesada@apple.com>
2237
2238         Turn on ENABLE_APPLICATION_MANIFEST
2239         https://bugs.webkit.org/show_bug.cgi?id=180562
2240         rdar://problem/35924737
2241
2242         Reviewed by Geoffrey Garen.
2243
2244         * Configurations/FeatureDefines.xcconfig:
2245
2246 2017-12-11  Dean Jackson  <dino@apple.com>
2247
2248         Add a runtime feature flag for ImageBitmap and OffscreenCanvas
2249         https://bugs.webkit.org/show_bug.cgi?id=180652
2250         <rdar://problem/35969611>
2251
2252         Reviewed by Antoine Quint.
2253
2254         Add an experimental feature flag for these interfaces.
2255
2256         * Shared/WebPreferences.yaml:
2257
2258 2017-12-10  Stephan Szabo  <stephan.szabo@sony.com>
2259
2260         APIClient.h uses things from <tuple> without including it explicitly
2261         https://bugs.webkit.org/show_bug.cgi?id=180609
2262
2263         Reviewed by Darin Adler.
2264
2265         * Shared/API/APIClient.h:
2266
2267 2017-12-08  Youenn Fablet  <youenn@apple.com>
2268
2269         Service Worker should use a correct user agent
2270         https://bugs.webkit.org/show_bug.cgi?id=180566
2271         <rdar://problem/35926295>
2272
2273         Reviewed by Chris Dumez.
2274
2275         Addendum to landed patch.
2276         This change was removed from the last version of the patch but proves to be needed by Safari.
2277
2278         * UIProcess/WebProcessPool.cpp:
2279         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2280         Added back setting the user agent at start of service worker in case a page is already created.
2281
2282 2017-12-08  Brady Eidson  <beidson@apple.com>
2283
2284         Delay some service worker operations until after the database import completes.
2285         https://bugs.webkit.org/show_bug.cgi?id=180573
2286
2287         Reviewed by Chris Dumez.
2288
2289         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2290         (WebKit::WebSWOriginStore::importComplete): Tell the Origin Table on all connects that
2291           the import is complete.
2292         (WebKit::WebSWOriginStore::registerSWServerConnection):
2293         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2294
2295         * WebProcess/Storage/WebSWClientConnection.cpp:
2296         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
2297         (WebKit::WebSWClientConnection::setSWOriginTableIsImported): Run deferred tasks!
2298         (WebKit::WebSWClientConnection::matchRegistration): If the import isn't complete yet, delay
2299           the match registration task until later.
2300         (WebKit::WebSWClientConnection::runOrDelayTask): Either send the message now or save off
2301           the task to wait until the import is complete.
2302         (WebKit::WebSWClientConnection::getRegistrations): If the import isn't complete yet, delay
2303           the get registrations task until later.
2304         (WebKit::WebSWClientConnection::initializeSWOriginTableAsEmpty): Deleted.
2305         * WebProcess/Storage/WebSWClientConnection.h:
2306         * WebProcess/Storage/WebSWClientConnection.messages.in:
2307
2308         * WebProcess/Storage/WebSWOriginTable.cpp:
2309         (WebKit::WebSWOriginTable::setSharedMemory):
2310         * WebProcess/Storage/WebSWOriginTable.h:
2311         (WebKit::WebSWOriginTable::isImported const):
2312         (WebKit::WebSWOriginTable::setIsImported):
2313         (WebKit::WebSWOriginTable::isInitialized const): Deleted.
2314         (WebKit::WebSWOriginTable::initializeAsEmpty): Deleted.
2315
2316 2017-12-08  Youenn Fablet  <youenn@apple.com>
2317
2318         Service Worker should use a correct user agent
2319         https://bugs.webkit.org/show_bug.cgi?id=180566
2320         <rdar://problem/35926295>
2321
2322         Reviewed by Chris Dumez.
2323
2324         Add support to set service worker user agent from UIProcess to service worker process.
2325         One user agent is currently supported per service worker process and it can be changed at any given time.
2326         Only new service worker will use the new value.
2327         Once a service worker is launched, it will stay with the same user agent value.
2328
2329         This sets both navigator.userAgent and User-Agent header name used for fetch within a service worker.
2330         Compute the service worker process user agent by picking the last user agent set for a web page.
2331
2332         * UIProcess/ServiceWorkerProcessProxy.cpp:
2333         (WebKit::ServiceWorkerProcessProxy::start):
2334         (WebKit::ServiceWorkerProcessProxy::setUserAgent):
2335         * UIProcess/ServiceWorkerProcessProxy.h:
2336         * UIProcess/WebPageProxy.cpp:
2337         (WebKit::WebPageProxy::setApplicationNameForUserAgent):
2338         * UIProcess/WebProcessPool.cpp:
2339         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2340         (WebKit::WebProcessPool::createWebPage):
2341         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
2342         * UIProcess/WebProcessPool.h:
2343         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2344         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2345         (WebKit::WebSWContextManagerConnection::setUserAgent):
2346         (WebKit::WebSWContextManagerConnection::removeFrameLoaderClient):
2347         * WebProcess/Storage/WebSWContextManagerConnection.h:
2348         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2349
2350 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
2351
2352         Wrong caret position for input field inside a fixed position parent on iOS 11
2353         https://bugs.webkit.org/show_bug.cgi?id=176896
2354         rdar://problem/33726145
2355
2356         Reviewed by Tim Horton.
2357
2358         In r219668 I added code to compute a layout viewport rect in the web process, so that
2359         after programmatic scrolling, getBoundingClientRect() would return the correct values.
2360         However, that computation sometimes used a different visual viewport than the UI process,
2361         resulting in a different layout viewport being set. This would happen when the keyboard
2362         was visible, and the combination of this and zooming when focusing an input would result
2363         in a state where the scrolling tree contained notes computed with the bad layout viewport.
2364         This could cause apparently offset fixed elements, and bad caret positioning if those fixed
2365         elements contained the focused input.
2366
2367         Fix by passing to the web process the same visual viewport rect that the UI process is using,
2368         namely "unobscuredContentRectRespectingInputViewBounds". This was already being set in
2369         VisibleContentRectUpdateInfo but wasn't encoded/decoded, so fix that. Set it as an optional<>
2370         on FrameView when different from the normal visual viewport, and return it from
2371         visualViewportRect().
2372
2373         Some other minor logging changes.
2374
2375         * Shared/VisibleContentRectUpdateInfo.cpp:
2376         (WebKit::VisibleContentRectUpdateInfo::encode const):
2377         (WebKit::VisibleContentRectUpdateInfo::decode):
2378         (WebKit::operator<<):
2379         * Shared/VisibleContentRectUpdateInfo.h:
2380         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2381         * WebProcess/WebPage/ios/WebPageIOS.mm:
2382         (WebKit::WebPage::updateVisibleContentRects):
2383
2384 2017-12-06  Simon Fraser  <simon.fraser@apple.com>
2385
2386         When the iPhone keyboard is up, sometimes we never commit a stable update and re-show the caret
2387         https://bugs.webkit.org/show_bug.cgi?id=180498
2388
2389         Reviewed by Tim Horton.
2390
2391         When the keyboard is showing, we would think that the page was in a rubber-banding state
2392         because contentOffsetBoundedInValidRange() would always clamp the content offset to a different
2393         value.
2394
2395         This happened because scrollView.contentInset don't change when the keyboard is showing,
2396         but UIKit actually consults scrollView.adjustedContentInset, which does. If we use
2397         scrollView.adjustedContentInset in this computation, we'll get a correct answer.
2398
2399         Also rewrote the clamping logic to be more similar to what UIKit does internally when computing
2400         min/max content offset.
2401
2402         * UIProcess/API/Cocoa/WKWebView.mm:
2403         (contentOffsetBoundedInValidRange):
2404
2405 2017-12-08  Chris Dumez  <cdumez@apple.com>
2406
2407         Clearing all Website Data should remove service worker registrations on disk
2408         https://bugs.webkit.org/show_bug.cgi?id=180558
2409
2410         Reviewed by Youenn Fablet.
2411
2412         * StorageProcess/StorageProcess.cpp:
2413         (WebKit::StorageProcess::deleteWebsiteData):
2414         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2415
2416 2017-12-08  Youenn Fablet  <youenn@apple.com>
2417
2418         WebServiceWorkerProvider should use Cancellation error to notify DTL that it cannot handle a fetch
2419         https://bugs.webkit.org/show_bug.cgi?id=180584
2420
2421         Reviewed by Alex Christensen.
2422
2423         * WebProcess/Network/WebLoaderStrategy.cpp:
2424         (WebKit::WebLoaderStrategy::scheduleLoad):
2425
2426 2017-12-08  Youenn Fablet  <youenn@apple.com>
2427
2428         Service Worker should use a correct SessionID
2429         https://bugs.webkit.org/show_bug.cgi?id=180585
2430
2431         Reviewed by Alex Christensen.
2432
2433         Store SessionID in SWServer and send it as part of service worker instantiation.
2434         Use it when creating service worker thread in service worker process.
2435
2436         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2437         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
2438         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2439         * StorageProcess/StorageProcess.cpp:
2440         (WebKit::StorageProcess::swServerForSession):
2441         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2442         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2443         * WebProcess/Storage/WebSWContextManagerConnection.h:
2444         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2445
2446 2017-12-08  Youenn Fablet  <youenn@apple.com>
2447
2448         FetchResponse should keep unfiltered ResourceResponse so that it can be used in Service Worker
2449         https://bugs.webkit.org/show_bug.cgi?id=179641
2450         <rdar://problem/35923570>
2451
2452         Reviewed by Alex Christensen.
2453
2454         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2455         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): In case of opaque redirected response, handle it as a regular response.
2456
2457 2017-12-08  Alex Christensen  <achristensen@webkit.org>
2458
2459         Remove unused code in WebPageGroup
2460         https://bugs.webkit.org/show_bug.cgi?id=180604
2461
2462         Reviewed by Youenn Fablet.
2463
2464         * UIProcess/WebPageGroup.cpp:
2465         (WebKit::WebPageGroup::userContentController):
2466         (WebKit::WebPageGroup::createNonNull): Deleted.
2467         (WebKit::WebPageGroup::preferencesDidChange): Deleted.
2468         * UIProcess/WebPageGroup.h:
2469         * UIProcess/WebProcessPool.cpp:
2470         (WebKit::WebProcessPool::WebProcessPool):
2471
2472 2017-12-08  Alex Christensen  <achristensen@webkit.org>
2473
2474         Modernize APIWebsiteDataStore.h and WebProcessPool.h
2475         https://bugs.webkit.org/show_bug.cgi?id=180588
2476
2477         Reviewed by Chris Dumez.
2478
2479         pragma once, Ref instead of RefPtr, initializer list in header instead of literals in constructor.
2480
2481         * UIProcess/API/APIWebsiteDataStore.h:
2482         * UIProcess/WebProcessPool.cpp:
2483         (WebKit::WebProcessPool::WebProcessPool):
2484         * UIProcess/WebProcessPool.h:
2485
2486 2017-12-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2487
2488         Remove pthread_once in favor of dispatch_once
2489         https://bugs.webkit.org/show_bug.cgi?id=180591
2490
2491         Reviewed by Saam Barati.
2492
2493         * PluginProcess/mac/PluginProcessMac.mm:
2494         (WebKit::shouldCallRealDebugger):
2495         (WebKit::initShouldCallRealDebugger): Deleted.
2496
2497 2017-12-08  Chris Dumez  <cdumez@apple.com>
2498
2499         ProcessPoolConfiguration::copy() fails to copy the service worker path
2500         https://bugs.webkit.org/show_bug.cgi?id=180595
2501
2502         Reviewed by Brady Eidson.
2503
2504         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2505         (API::ProcessPoolConfiguration::copy):
2506
2507 2017-12-08  Chris Dumez  <cdumez@apple.com>
2508
2509         Different WebKitTestRunner instances should use different service worker registrations databases
2510         https://bugs.webkit.org/show_bug.cgi?id=180589
2511
2512         Reviewed by Brady Eidson.
2513
2514         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2515         (WKContextConfigurationCopyServiceWorkerDatabaseDirectory):
2516         (WKContextConfigurationSetServiceWorkerDatabaseDirectory):
2517         * UIProcess/API/C/WKContextConfigurationRef.h:
2518
2519 2017-12-08  Alex Christensen  <achristensen@webkit.org>
2520
2521         Pass std::optional<WebsitePolicies> instead of WebsitePolicies
2522         https://bugs.webkit.org/show_bug.cgi?id=180563
2523
2524         Reviewed by Andy Estes.
2525
2526         WebsitePolicies are only passed along when a decidePolicyForNavigationAction SPI completion handler
2527         is called with a valid _WKWebsitePolicies object.  In other cases, we don't have one.  Rather than
2528         making WebsitePolicies have a default value for everything that won't change policies, pass
2529         a std::optional<WebsitePolicies> which indicates better when we don't have new policies.
2530
2531         No change in behavior, but this will enable me to add things to WebsitePolicies that have no default value.
2532
2533         * Shared/WebsitePolicies.h:
2534         Make WebsitePolicies a class with public members because the IPC code generators don't understand std::optional<struct type>
2535         * UIProcess/API/C/WKAPICast.h:
2536         * UIProcess/Cocoa/NavigationState.mm:
2537         (WebKit::tryAppLink):
2538         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2539         * UIProcess/WebFrameListenerProxy.cpp:
2540         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
2541         * UIProcess/WebFrameListenerProxy.h:
2542         * UIProcess/WebFramePolicyListenerProxy.cpp:
2543         (WebKit::WebFramePolicyListenerProxy::use):
2544         * UIProcess/WebFramePolicyListenerProxy.h:
2545         * UIProcess/WebFrameProxy.cpp:
2546         (WebKit::WebFrameProxy::receivedPolicyDecision):
2547         * UIProcess/WebFrameProxy.h:
2548         * UIProcess/WebPageProxy.cpp:
2549         (WebKit::WebPageProxy::receivedPolicyDecision):
2550         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2551         * UIProcess/WebPageProxy.h:
2552         * UIProcess/WebPageProxy.messages.in:
2553         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2554         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2555         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2556         * WebProcess/WebPage/WebFrame.cpp:
2557         (WebKit::WebFrame::didReceivePolicyDecision):
2558         * WebProcess/WebPage/WebFrame.h:
2559         * WebProcess/WebPage/WebPage.cpp:
2560         (WebKit::WebPage::didReceivePolicyDecision):
2561         * WebProcess/WebPage/WebPage.h:
2562         * WebProcess/WebPage/WebPage.messages.in:
2563
2564 2017-12-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2565
2566         [WTF] Remove remaining use of Mutex
2567         https://bugs.webkit.org/show_bug.cgi?id=180579
2568
2569         Reviewed by Alex Christensen.
2570
2571         Remove unused "BinarySemaphore.h".
2572
2573         * Platform/IPC/win/ConnectionWin.cpp:
2574
2575 2017-12-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2576
2577         [GTK] WebInspectorProxyClient needs a virtual destructor
2578         https://bugs.webkit.org/show_bug.cgi?id=180533
2579
2580         Reviewed by Carlos Garcia Campos.
2581
2582         Otherwise the derived class portion of the object, WebKitInspectorClient, is not destroyed.
2583
2584         * UIProcess/gtk/WebInspectorProxyClient.h:
2585
2586 2017-12-07  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2587
2588         [WinCairo] Fix ResourceError handling in ArgumentCoder for wincairo webkit
2589         https://bugs.webkit.org/show_bug.cgi?id=180483
2590
2591         Reviewed by Alex Christensen.
2592
2593         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2594         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
2595         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
2596
2597 2017-12-07  Youenn Fablet  <youenn@apple.com>
2598
2599         StartFetch should take a ServiceWorkerIdentifier
2600         https://bugs.webkit.org/show_bug.cgi?id=180478
2601
2602         Reviewed by Brady Eidson.
2603
2604         Before the patch, StartFetch was taking an optional ServiceWorkerIdentifier.
2605         Now that every navigation fetch is querying its matching registration, it can no longer be optional.
2606
2607         In the case there is a problem in running the service worker at start fetch time,
2608         answer to the WebProcess to go to network so that the request does not get stalled.
2609
2610         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2611         (WebKit::WebSWServerConnection::startFetch):
2612         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2613         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2614         * WebProcess/Storage/WebSWClientConnection.cpp:
2615         (WebKit::WebSWClientConnection::startFetch):
2616         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2617         (WebKit::WebSWContextManagerConnection::startFetch):
2618         * WebProcess/Storage/WebSWContextManagerConnection.h:
2619         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2620
2621 2017-12-07  Saam Barati  <sbarati@apple.com>
2622
2623         We need to grab the JSLock in InjectedBundle::createWebDataFromUint8Array
2624         https://bugs.webkit.org/show_bug.cgi?id=180492
2625
2626         Reviewed by Alex Christensen.
2627
2628         InjectedBundle::createWebDataFromUint8Array calls into WebCore APIs that allocate
2629         out of the JS heap. It's only legal to allocate out of the JS heap when holding the JS lock.
2630
2631         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2632         (WebKit::InjectedBundle::createWebDataFromUint8Array):
2633
2634 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
2635
2636         Propagate WebKit2Logging channels to the Web Process
2637         https://bugs.webkit.org/show_bug.cgi?id=180517
2638
2639         Reviewed by Tim Horton.
2640
2641         If you set WebKit2Logging, you want those channels active in both the UI process and
2642         the web process, but without tricky 'defaults' gyrations, setting them in the web process
2643         was hard.
2644
2645         Instead, send them through to the process via WebProcessCreationParameters, as we do
2646         for WebCoreLogging channels.
2647
2648         * Platform/LogInitialization.h:
2649         * Platform/Logging.cpp:
2650         (WebKit::initializeLogChannelsIfNecessary):
2651         * Shared/WebProcessCreationParameters.cpp:
2652         (WebKit::WebProcessCreationParameters::encode const):
2653         (WebKit::WebProcessCreationParameters::decode):
2654         * Shared/WebProcessCreationParameters.h:
2655         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2656         (WebKit::WebProcessPool::platformInitializeWebProcess):
2657         * WebProcess/cocoa/WebProcessCocoa.mm:
2658         (WebKit::WebProcess::platformInitializeWebProcess):
2659
2660 2017-12-07  Simon Fraser  <simon.fraser@apple.com>
2661
2662         Add logging for EditorState in RemoteLayerTree transactions
2663         https://bugs.webkit.org/show_bug.cgi?id=180515
2664
2665         Reviewed by Wenson Hsieh.
2666        
2667         Make EditorState TextStream-able, and dump it in layer tree transactions.
2668
2669         * Shared/EditorState.cpp:
2670         (WebKit::operator<<):
2671         * Shared/EditorState.h:
2672         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2673         (WebKit::RemoteLayerTreeTransaction::description const):
2674
2675 2017-12-07  Youenn Fablet  <youenn@apple.com>
2676
2677         CacheStorage Cache should not remove any disk entry when clearing its memory representation
2678         https://bugs.webkit.org/show_bug.cgi?id=180546
2679
2680         Reviewed by Brady Eidson.
2681
2682         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2683         (WebKit::CacheStorage::Cache::clearMemoryRepresentation):
2684
2685 2017-12-07  Myles C. Maxfield  <mmaxfield@apple.com>
2686
2687         [Cocoa] Add SPI to disallow user-installed fonts
2688         https://bugs.webkit.org/show_bug.cgi?id=180062
2689         <rdar://problem/35042408>
2690
2691         Reviewed by Simon Fraser.
2692
2693         * Shared/WebPreferences.yaml:
2694         * UIProcess/API/C/WKPreferences.cpp:
2695         (WKPreferencesSetShouldDisallowUserInstalledFonts):
2696         (WKPreferencesGetShouldDisallowUserInstalledFonts):
2697         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2698         * UIProcess/API/Cocoa/WKPreferences.mm:
2699         (-[WKPreferences _shouldDisallowUserInstalledFonts]):
2700         (-[WKPreferences _setShouldDisallowUserInstalledFonts:]):
2701         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2702
2703 2017-12-07  David Quesada  <david_quesada@apple.com>
2704
2705         [Web App Manifest] Support display-mode media feature
2706         https://bugs.webkit.org/show_bug.cgi?id=180376
2707         rdar://problem/35837993
2708
2709         Reviewed by Geoffrey Garen.
2710
2711         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
2712         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
2713         (-[_WKApplicationManifest initWithCoder:]):
2714         (-[_WKApplicationManifest encodeWithCoder:]):
2715         (-[_WKApplicationManifest displayMode]):
2716
2717 2017-12-07  Chris Dumez  <cdumez@apple.com>
2718
2719         Unreviewed build fix after r225622.
2720
2721         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2722         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
2723
2724 2017-12-06  Chris Dumez  <cdumez@apple.com>
2725
2726         We should be able to recover after a Service Worker process crash
2727         https://bugs.webkit.org/show_bug.cgi?id=180477
2728
2729         Reviewed by Brady Eidson and Youenn Fablet.
2730
2731         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2732         (WebKit::WebSWServerConnection::startFetch):
2733         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
2734         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
2735         Update calls to SWServer::runServiceWorkerIfNecessary() that that it is asynchronous
2736         and takes in a lambda.
2737
2738         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2739         (WebKit::WebSWServerConnection::ipcConnection const):
2740         Add getter for the underlying IPC connection.
2741
2742         * StorageProcess/StorageProcess.cpp:
2743         (WebKit::StorageProcess::didClose):
2744         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2745         Move some code to connectionToContextProcessWasClosed() to avoid duplication.
2746         Also, relaunch the Service Worker process if it has exited but we still
2747         have SWServer connections to regular Web Processes.
2748
2749         (WebKit::StorageProcess::needsServerToContextConnection const):
2750         Utility function to determine if we still need the service worker process.
2751         The current rule is that we need the service worker (aka "context") process
2752         if we still have SWServer connections to regular Web Processes.
2753
2754         * StorageProcess/StorageProcess.h:
2755
2756         * StorageProcess/StorageToWebProcessConnection.cpp:
2757         (WebKit::StorageToWebProcessConnection::didClose):
2758         If didClose() is called for the connection to the service worker context,
2759         let the StorageProcess know so that it can clear its state and relaunch
2760         the process if necessary.
2761
2762         * UIProcess/API/C/WKContext.cpp:
2763         (WKContextTerminateServiceWorkerProcess):
2764         * UIProcess/API/C/WKContextPrivate.h:
2765         * UIProcess/API/Cocoa/WKProcessPool.mm:
2766         (-[WKProcessPool _terminateServiceWorkerProcess]):
2767         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2768         Add SPI to terminate the service worker process.
2769
2770         * UIProcess/WebProcessPool.cpp:
2771         (WebKit::m_serviceWorkerProcessTerminationTimer):
2772         (WebKit::WebProcessPool::createNewWebProcess):
2773         (WebKit::WebProcessPool::disconnectProcess):
2774         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
2775         * UIProcess/WebProcessPool.h:
2776         We used to shutdown the ServiceWorker process right away as soon as the last regular
2777         WebProcess was gone. We now give it a grace period of 5 seconds in case a new
2778         WebProcess gets launched shortly after.
2779
2780 2017-12-02  Darin Adler  <darin@apple.com>
2781
2782         Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp
2783         https://bugs.webkit.org/show_bug.cgi?id=180009
2784
2785         Reviewed by Alex Christensen.
2786
2787         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2788         (WebKit::initializeProtectionSpace): Use equalLettersIgnoringASCIICase instead
2789         of strcasecmp.
2790
2791 2017-12-06  David Quesada  <david_quesada@apple.com>
2792
2793         [Web App Manifest] Add SPI for applying a manifest to a top-level browsing context
2794         https://bugs.webkit.org/show_bug.cgi?id=180368
2795         rdar://problem/34748067
2796
2797         Reviewed by Geoffrey Garen.
2798
2799         Add a new property WKWebViewConfiguration._applicationManifest to specify manifest
2800         to apply to application contexts (aka. top-level browsing contexts, i.e. web views).
2801         The manifest is ultimately stored on the MainFrame of the Pages created from the
2802         web view configuration.
2803
2804         No new tests, no change in behavior.
2805
2806         * Shared/WebPageCreationParameters.cpp:
2807         (WebKit::WebPageCreationParameters::encode const):
2808         (WebKit::WebPageCreationParameters::decode):
2809         * Shared/WebPageCreationParameters.h:
2810         * UIProcess/API/APIPageConfiguration.cpp:
2811         (API::PageConfiguration::copy const):
2812         (API::PageConfiguration::applicationManifest const):
2813         (API::PageConfiguration::setApplicationManifest):
2814         * UIProcess/API/APIPageConfiguration.h:
2815         * UIProcess/API/Cocoa/WKWebView.mm:
2816         (-[WKWebView _initializeWithConfiguration:]):
2817         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2818         (-[WKWebViewConfiguration copyWithZone:]):
2819         (-[WKWebViewConfiguration _applicationManifest]):
2820         (-[WKWebViewConfiguration _setApplicationManifest:]):
2821         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2822         * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h:
2823         * UIProcess/WebPageProxy.cpp:
2824         (WebKit::WebPageProxy::creationParameters):
2825         * WebProcess/WebPage/WebPage.cpp:
2826         (WebKit::m_cpuLimit):
2827
2828 2017-12-06  Jeff Miller  <jeffm@apple.com>
2829
2830         -[WKWebViewConfiguration copyWithZone] doesn't copy _groupIdentifier
2831         https://bugs.webkit.org/show_bug.cgi?id=180504
2832
2833         Reviewed by Geoffrey Garen.
2834
2835         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2836         (-[WKWebViewConfiguration copyWithZone:]):
2837         Copy _groupIdentifier.
2838
2839 2017-12-06  David Quesada  <david_quesada@apple.com>
2840
2841         [Web App Manifest] Add SPI for fetching the manifest
2842         https://bugs.webkit.org/show_bug.cgi?id=180294
2843         rdar://problem/34747968
2844
2845         Reviewed by Geoffrey Garen.
2846
2847         Add a new method -[WKWebView _getApplicationManifestWithCompletionHandler:] to request
2848         the manifest associated with the current page.
2849
2850         * Shared/API/APIObject.h:
2851         * Shared/Cocoa/APIObject.mm:
2852         (API::Object::newObject):
2853         * UIProcess/API/APIApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
2854             Add a new API object type for application manifests.
2855         * UIProcess/API/C/WKPage.cpp:
2856         (WKPageGetApplicationManifest_b):
2857             Add a C version of this SPI for WebKitTestRunner.
2858         * UIProcess/API/C/WKPagePrivate.h:
2859         * UIProcess/API/Cocoa/WKWebView.mm:
2860         (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
2861         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2862         * UIProcess/API/Cocoa/_WKApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
2863         * UIProcess/API/Cocoa/_WKApplicationManifest.mm: Added.
2864         (-[_WKApplicationManifest initWithCoder:]):
2865         (-[_WKApplicationManifest encodeWithCoder:]):
2866         (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
2867         (-[_WKApplicationManifest _apiObject]):
2868         (nullableNSString):
2869         (-[_WKApplicationManifest name]):
2870         (-[_WKApplicationManifest shortName]):
2871         (-[_WKApplicationManifest applicationDescription]):
2872         (-[_WKApplicationManifest scope]):
2873         (-[_WKApplicationManifest startURL]):
2874         * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
2875         (API::wrapper):
2876         * UIProcess/WebPageProxy.cpp:
2877         (WebKit::WebPageProxy::applicationManifestCallback):
2878         (WebKit::WebPageProxy::getApplicationManifest):
2879         * UIProcess/WebPageProxy.h:
2880         * UIProcess/WebPageProxy.messages.in:
2881         * WebKit.xcodeproj/project.pbxproj:
2882         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2883         (WebKit::WebFrameLoaderClient::finishedLoadingApplicationManifest):
2884         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2885         * WebProcess/WebPage/WebPage.cpp:
2886         (WebKit::WebPage::getApplicationManifest):
2887         (WebKit::WebPage::didFinishLoadingApplicationManifest):
2888         * WebProcess/WebPage/WebPage.h:
2889         * WebProcess/WebPage/WebPage.messages.in:
2890
2891 2017-12-06  Per Arne Vollan  <pvollan@apple.com>
2892
2893         The WebProcess should use the NSRunLoop runloop type.
2894         https://bugs.webkit.org/show_bug.cgi?id=179804
2895         <rdar://problem/14012823>
2896
2897         Reviewed by Brent Fulgham.
2898
2899         * Platform/IPC/mac/ConnectionMac.mm:
2900         (IPC::AccessibilityProcessSuspendedNotification):
2901         * Shared/ChildProcess.h:
2902         * Shared/mac/ChildProcessMac.mm:
2903         (WebKit::ChildProcess::launchServicesCheckIn):
2904         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2905         (WebKit::shouldLeakBoost):
2906         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2907         * WebProcess/WebProcess.cpp:
2908         (WebKit::WebProcess::initializeProcess):
2909
2910 2017-12-06  Nan Wang  <n_wang@apple.com>
2911
2912         AX: [iOS] Post accessibility notification when a web process changes its suspended state
2913         https://bugs.webkit.org/show_bug.cgi?id=180458
2914         <rdar://problem/35869115>
2915
2916         Reviewed by Chris Dumez.
2917
2918         Post accessibility notification with the pid information when a web process
2919         becomes suspended or resumes running.
2920
2921         * WebProcess/WebProcess.cpp:
2922         (WebKit::WebProcess::actualPrepareToSuspend):
2923         (WebKit::WebProcess::processDidResume):
2924         * WebProcess/WebProcess.h:
2925         * WebProcess/cocoa/WebProcessCocoa.mm:
2926         (WebKit::WebProcess::accessibilityProcessSuspendedNotification):
2927
2928 2017-12-06  Ryan Haddad  <ryanhaddad@apple.com>
2929
2930         Unreviewed build fix, removed unused lambda capture.
2931
2932         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2933         (WebKit::CacheStorageEngineConnection::open):
2934
2935 2017-12-06  John Wilander  <wilander@apple.com>
2936
2937         Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes
2938         https://bugs.webkit.org/show_bug.cgi?id=176944
2939         <rdar://problem/34440658>
2940
2941         Reviewed by Brent Fulgham.
2942
2943         This change introduces document.hasStorageAccess() as a function which
2944         returns a promise instead of being a property. Since cookie access can
2945         be due to both a granted request and recent user interaction as first
2946         party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.
2947
2948         * UIProcess/WebPageProxy.cpp:
2949         (WebKit::WebPageProxy::hasStorageAccess):
2950         * UIProcess/WebPageProxy.h:
2951         * UIProcess/WebPageProxy.messages.in:
2952         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2953         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2954         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2955             Now adds an entry for granted access. A bug found through testing.
2956             Switched from WTF::Function to WTF::CompletionHandler.
2957         * UIProcess/WebResourceLoadStatisticsStore.h:
2958         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2959         (WebKit::WebsiteDataStore::hasStorageAccess):
2960         (WebKit::WebsiteDataStore::requestStorageAccess):
2961             Switched from WTF::Function to WTF::CompletionHandler.
2962         * UIProcess/WebsiteData/WebsiteDataStore.h:
2963         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2964         (WebKit::WebChromeClient::hasStorageAccess):
2965         (WebKit::WebChromeClient::requestStorageAccess):
2966             Switched from WTF::Function to WTF::CompletionHandler.
2967         * WebProcess/WebCoreSupport/WebChromeClient.h:
2968         * WebProcess/WebPage/WebPage.cpp:
2969         (WebKit::WebPage::hasStorageAccess):
2970         (WebKit::WebPage::requestStorageAccess):
2971             Switched from WTF::Function to WTF::CompletionHandler.
2972         * WebProcess/WebPage/WebPage.h:
2973
2974 2017-12-06  Youenn Fablet  <youenn@apple.com>
2975
2976         CacheStorageEngineConnection should protect its IPC Connection when doing asynchronous tasks
2977         https://bugs.webkit.org/show_bug.cgi?id=180461
2978
2979         Reviewed by Chris Dumez.
2980
2981         Protecting the IPC connection instead of the CacheStorageEngineConnection
2982         since CacheStorageEngineConnection only keeps a reference to the NetworkConnectionToWebProcess.
2983
2984         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2985         (WebKit::CacheStorageEngineConnection::open):
2986         (WebKit::CacheStorageEngineConnection::remove):
2987         (WebKit::CacheStorageEngineConnection::caches):
2988         (WebKit::CacheStorageEngineConnection::retrieveRecords):
2989         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
2990         (WebKit::CacheStorageEngineConnection::putRecords):
2991         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2992
2993 2017-12-06  Zan Dobersek  <zdobersek@igalia.com>
2994
2995         [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation
2996         https://bugs.webkit.org/show_bug.cgi?id=180239
2997
2998         Reviewed by Michael Catanzaro.
2999
3000         With Nicosia::Buffer now only providing the memory area into which the
3001         tile content was rasterized, we can simplify the BitmapTexture update
3002         greatly -- we don't have to create a BitmapImage anymore and retrieve
3003         memory pointer from the contained cairo_surface_t object. Instead, we
3004         just copy to GPU the memory that Nicosia::Buffer controls.
3005
3006         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3007         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
3008
3009 2017-12-05  Brent Fulgham  <bfulgham@apple.com>
3010
3011         Limit user agent versioning to an upper bound
3012         https://bugs.webkit.org/show_bug.cgi?id=180365
3013         <rdar://problem/34550617>
3014
3015         Reviewed by Joseph Pecoraro.
3016
3017         * UIProcess/ios/WebPageProxyIOS.mm:
3018         (WebKit::WebPageProxy::standardUserAgent): Don't pass the WebKit bundle version when
3019         creatin the User Agent string.
3020         (WebKit::webKitBundleVersionString): Deleted.
3021         * UIProcess/mac/WebPageProxyMac.mm:
3022         (WebKit::WebPageProxy::standardUserAgent): Ditto.
3023         (WebKit::webKitBundleVersionString): Deleted.
3024
3025 2017-12-05  Alex Christensen  <achristensen@webkit.org>
3026
3027         Fix crash when loading a file URL that does not have a fileSystemPath representation
3028         https://bugs.webkit.org/show_bug.cgi?id=180448
3029         <rdar://problem/22805921>
3030
3031         Reviewed by Chris Dumez.
3032
3033         * UIProcess/WebProcessProxy.cpp:
3034         (WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
3035         Check if a String is null before adding it to a HashSet.
3036
3037 2017-12-05  Youenn Fablet  <youenn@apple.com>
3038
3039         Implement https://w3c.github.io/ServiceWorker/#clients-claim
3040         https://bugs.webkit.org/show_bug.cgi?id=180261
3041
3042         Reviewed by Chris Dumez.
3043
3044         Add IPC plumbery for clients claim between ServiceWorker process and Storage process.
3045
3046         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3047         (WebKit::WebSWServerToContextConnection::claimCompleted):
3048         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3049         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
3050         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3051         (WebKit::WebSWContextManagerConnection::claim):
3052         (WebKit::WebSWContextManagerConnection::claimCompleted):
3053         * WebProcess/Storage/WebSWContextManagerConnection.h:
3054         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3055
3056 2017-12-05  Chris Dumez  <cdumez@apple.com>
3057
3058         Add support for ServiceWorkerContainer.prototype.ready
3059         https://bugs.webkit.org/show_bug.cgi?id=180383
3060
3061         Reviewed by Youenn Fablet.
3062
3063         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3064         (WebKit::WebSWServerConnection::whenRegistrationReady):
3065         (WebKit::WebSWServerConnection::resolveRegistrationReadyRequests):
3066         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3067         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3068         * WebProcess/Storage/WebSWClientConnection.cpp:
3069         (WebKit::WebSWClientConnection::matchRegistration):
3070         (WebKit::WebSWClientConnection::whenRegistrationReady):
3071         (WebKit::WebSWClientConnection::registrationReady):
3072         (WebKit::WebSWClientConnection::getRegistrations):
3073         * WebProcess/Storage/WebSWClientConnection.h:
3074         * WebProcess/Storage/WebSWClientConnection.messages.in:
3075
3076 2017-12-05  Youenn Fablet  <youenn@apple.com>
3077
3078         Implement setting of service worker to client in SWServer without going to WebProcess
3079         https://bugs.webkit.org/show_bug.cgi?id=180382
3080
3081         Reviewed by Chris Dumez.
3082
3083         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3084         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3085         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
3086         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3087         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3088         * WebProcess/Storage/WebSWClientConnection.cpp:
3089         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
3090         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): Deleted.
3091         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): Deleted.
3092         * WebProcess/Storage/WebSWClientConnection.h:
3093
3094 2017-12-04  Chris Dumez  <cdumez@apple.com>
3095
3096         Support container.getRegistration() / getRegistrations() inside service workers
3097         https://bugs.webkit.org/show_bug.cgi?id=180360
3098
3099         Reviewed by Youenn Fablet.
3100
3101         * WebProcess/Storage/WebSWClientConnection.cpp:
3102         (WebKit::WebSWClientConnection::didMatchRegistration):
3103         (WebKit::WebSWClientConnection::didGetRegistrations):
3104         (WebKit::WebSWClientConnection::matchRegistration):
3105         (WebKit::WebSWClientConnection::getRegistrations):
3106
3107 2017-12-04  Brady Eidson  <beidson@apple.com>
3108
3109         Followup to:
3110         Get a directory path to SWServers for storing ServiceWorker registrations
3111         https://bugs.webkit.org/show_bug.cgi?id=180362
3112
3113         Unreviewed.
3114
3115         * StorageProcess/StorageProcess.cpp:
3116         (WebKit::StorageProcess::swServerForSession): Change this ASSERT which is invalid in private browsing sessions.
3117
3118 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
3119
3120         Minor DisplayRefreshMonitor-related cleanup
3121         https://bugs.webkit.org/show_bug.cgi?id=179802
3122
3123         Reviewed by Sam Weinig.
3124
3125         Use RunLoopObserver::WellKnownRunLoopOrders. We want to fire before layer flushing.
3126
3127         * UIProcess/WebPageProxy.cpp:
3128         (WebKit::m_configurationPreferenceValues):
3129
3130 2017-12-04  Brent Fulgham  <bfulgham@apple.com>
3131
3132         Don't force creation of process pool when enabling resource load statistics
3133         https://bugs.webkit.org/show_bug.cgi?id=180374
3134         <rdar://problem/35545639>
3135
3136         Reviewed by Alex Christensen.
3137
3138         Pass appropriate arguments to the 'processPool' accessor so that we only get the
3139         set of existing process pools. We don't want to pay the cost of launching new
3140         process pools just to set this flag. The flag will be properly set when the pools
3141         are created as soon as a WebView is instantiated.
3142
3143         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3144         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
3145
3146 2017-12-04  David Quesada  <david_quesada@apple.com>
3147
3148         Add a class for parsing application manifests
3149         https://bugs.webkit.org/show_bug.cgi?id=177973
3150         rdar://problem/34747949
3151
3152         Reviewed by Geoffrey Garen.
3153
3154         * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
3155
3156 2017-12-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3157
3158         Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines.
3159         https://bugs.webkit.org/show_bug.cgi?id=180305
3160
3161         Reviewed by Andy Estes.
3162
3163         Style guidelines state that we should use bare words for getters, so getItemType should just be
3164         itemType. Since this collides with the itemType member variable, this patch also renames that
3165         member variable to the more concise "type".
3166
3167         No change in behavior.
3168
3169         * Shared/TouchBarMenuItemData.cpp:
3170         (WebKit::itemType):
3171         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
3172         (WebKit::TouchBarMenuItemData::encode const):
3173         (WebKit::TouchBarMenuItemData::decode):
3174         (WebKit::getItemType): Deleted.
3175         * Shared/TouchBarMenuItemData.h:
3176         (WebKit::operator==):
3177
3178 2017-12-04  Brian Burg  <bburg@apple.com>
3179
3180         Web Automation: add flag to preserve legacy page screenshot behavior
3181         https://bugs.webkit.org/show_bug.cgi?id=180313
3182         <rdar://problem/34379930>
3183
3184         Reviewed by Joseph Pecoraro.
3185
3186         For compatibility with JSON Wire Protocol implemented by Safari,
3187         we need to retain the ability to perform whole page contents
3188         snapshots using Automation.takeScreenshot. Add an extra flag,
3189         clipToViewport, which can be used by W3C-conforming drivers.
3190
3191         * UIProcess/Automation/Automation.json: Add new flag.
3192         * UIProcess/Automation/WebAutomationSession.h:
3193         * UIProcess/Automation/WebAutomationSession.cpp:
3194         (WebKit::WebAutomationSession::takeScreenshot):
3195         * WebProcess/Automation/WebAutomationSessionProxy.h:
3196         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
3197         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3198         (WebKit::snapshotRectForScreenshot):
3199         (WebKit::WebAutomationSessionProxy::takeScreenshot):
3200         If the flag is false, take a screenshot of the whole page contents.
3201
3202 2017-12-04  JF Bastien  <jfbastien@apple.com>
3203
3204         Update std::expected to match libc++ coding style
3205         https://bugs.webkit.org/show_bug.cgi?id=180264
3206
3207         Reviewed by Alex Christensen.
3208
3209         Update various uses of Expected, mostly renaming valueOr and
3210         hasValue to the STL naming convention.
3211
3212         * NetworkProcess/cache/CacheStorageEngine.cpp:
3213         (WebKit::CacheStorage::Engine::open):
3214         (WebKit::CacheStorage::Engine::retrieveCaches):
3215         (WebKit::CacheStorage::Engine::retrieveRecords):
3216         (WebKit::CacheStorage::Engine::putRecords):
3217         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
3218         (WebKit::CacheStorage::Engine::fetchEntries):
3219         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
3220         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3221         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
3222         (WebKit::CacheStorage::Cache::updateRecordToDisk):
3223         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3224         (WebKit::CacheStorage::Caches::initialize):
3225         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3226         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3227         (WebKit::NetworkRTCProvider::createResolver):
3228         * Platform/IPC/ArgumentCoders.h:
3229
3230 2017-12-04  Brady Eidson  <beidson@apple.com>
3231
3232         Get a directory path to SWServers for storing ServiceWorker registrations.
3233         https://bugs.webkit.org/show_bug.cgi?id=180362
3234
3235         Reviewed by Chris Dumez.
3236
3237         This gets all of the plumbing in place for specifying a ServiceWorker registration storage path
3238         in a particular WebsiteDataStore.
3239
3240         * Shared/Storage/StorageProcessCreationParameters.cpp:
3241         (WebKit::StorageProcessCreationParameters::encode const):
3242         (WebKit::StorageProcessCreationParameters::decode):
3243         * Shared/Storage/StorageProcessCreationParameters.h:
3244
3245         * StorageProcess/StorageProcess.cpp:
3246         (WebKit::StorageProcess::initializeWebsiteDataStore):
3247         (WebKit::StorageProcess::swServerForSession):
3248         * StorageProcess/StorageProcess.h:
3249
3250         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3251         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3252         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
3253         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3254         * UIProcess/API/APIProcessPoolConfiguration.h:
3255
3256         * UIProcess/API/APIWebsiteDataStore.h:
3257         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3258         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
3259         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
3260         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
3261
3262         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3263         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
3264         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
3265         * UIProcess/WebProcessPool.cpp:
3266         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
3267         * UIProcess/WebProcessPool.h:
3268
3269         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3270         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
3271         (WebKit::WebsiteDataStore::storageProcessParameters):
3272         * UIProcess/WebsiteData/WebsiteDataStore.h:
3273         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
3274
3275         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3276         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
3277
3278         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3279         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
3280
3281 2017-12-04  Frederic Wang  <fwang@igalia.com>
3282
3283         Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes
3284         https://bugs.webkit.org/show_bug.cgi?id=180353
3285
3286         Reviewed by Antonio Gomes.
3287
3288         This function was introduced in bug 175135 to solve a rendering bug with fixed positioned
3289         nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is
3290         actually the frame node itself or otherwise we will get the same rendering bug. This patch
3291         makes enclosingFrameNode return the node itself when it is a frame node and renames it to
3292         clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the
3293         behavior is unchanged.
3294
3295         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3296         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Use auto* and
3297         the new function name.
3298
3299 2017-12-04  Michael Catanzaro  <mcatanzaro@igalia.com>
3300
3301         [GTK] Implement PAL::SleepDisabler
3302         https://bugs.webkit.org/show_bug.cgi?id=178485
3303
3304         Reviewed by Carlos Garcia Campos.
3305
3306         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3307         (webkitWebViewBaseDispose):
3308         (webkitWebViewBaseEnterFullScreen):
3309         (webkitWebViewBaseExitFullScreen):
3310         (screenSaverInhibitedCallback): Deleted.
3311         (webkitWebViewBaseSendInhibitMessageToScreenSaver): Deleted.
3312         (screenSaverProxyCreatedCallback): Deleted.
3313         (webkitWebViewBaseInhibitScreenSaver): Deleted.
3314         (webkitWebViewBaseUninhibitScreenSaver): Deleted.
3315
3316 2017-12-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3317
3318         WTF shouldn't have both Thread and ThreadIdentifier
3319         https://bugs.webkit.org/show_bug.cgi?id=180308
3320
3321         Reviewed by Darin Adler.
3322
3323         * UIProcess/API/glib/IconDatabase.cpp:
3324         * UIProcess/GenericCallback.h:
3325         (WebKit::GenericCallback::~GenericCallback):
3326         (WebKit::GenericCallback::performCallbackWithReturnValue):
3327
3328 2017-12-03  Chris Dumez  <cdumez@apple.com>
3329
3330         Support serviceWorker.postMessage() inside service workers
3331         https://bugs.webkit.org/show_bug.cgi?id=180328
3332
3333         Reviewed by Darin Adler.
3334
3335         Support serviceWorker.postMessage() inside service workers.
3336
3337         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3338         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
3339         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
3340         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3341         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3342         * WebProcess/Storage/WebSWClientConnection.cpp:
3343         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
3344         * WebProcess/Storage/WebSWClientConnection.h:
3345         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3346         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromClient):
3347         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromServiceWorker):
3348         * WebProcess/Storage/WebSWContextManagerConnection.h:
3349         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3350
3351 2017-12-03  Chris Dumez  <cdumez@apple.com>
3352
3353         Implement self.skipWaiting() inside service workers
3354         https://bugs.webkit.org/show_bug.cgi?id=180329
3355
3356         Reviewed by Darin Adler.
3357
3358         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3359         (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting):
3360         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3361         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
3362         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3363         (WebKit::WebSWContextManagerConnection::skipWaiting):
3364         (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting):
3365         * WebProcess/Storage/WebSWContextManagerConnection.h:
3366         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3367
3368 2017-12-02  Youenn Fablet  <youenn@apple.com>
3369
3370         Implement https://w3c.github.io/ServiceWorker/#clients-getall
3371         https://bugs.webkit.org/show_bug.cgi?id=180276
3372
3373         Reviewed by Chris Dumez.
3374
3375         Add IPC plumbery for clients.matchAll between ServiceWorker process and Storage process.
3376
3377         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3378         (WebKit::WebSWServerToContextConnection::matchAllCompleted):
3379         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3380         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
3381         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3382         (WebKit::WebSWContextManagerConnection::matchAll):
3383         (WebKit::WebSWContextManagerConnection::matchAllCompleted):
3384         * WebProcess/Storage/WebSWContextManagerConnection.h:
3385         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3386
3387 2017-12-02  Joseph Pecoraro  <pecoraro@apple.com>
3388
3389         Remote Web Inspector window always shows up at the default size
3390         https://bugs.webkit.org/show_bug.cgi?id=180284
3391         <rdar://problem/35430255>
3392
3393         Reviewed by Brian Burg.
3394
3395         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3396         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3397         Give remote web inspector windows an autosave name so that their frame can
3398         be automatically saved and restored by the system.
3399
3400 2017-12-02  Simon Fraser  <simon.fraser@apple.com>
3401
3402         Add a log channel for viewports
3403         https://bugs.webkit.org/show_bug.cgi?id=180295
3404
3405         Reviewed by Zalan Bujtas.
3406
3407         Add a "Viewports" log channel to log viewport scaling information, and enhance the
3408         WebKit "VisibleRects" channel to log additional data for the same reason.
3409
3410         * UIProcess/API/Cocoa/WKWebView.mm:
3411         (-[WKWebView _didCommitLayerTree:]):
3412         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
3413         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
3414         (-[WKWebView _endAnimatedResize]):
3415         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
3416         * WebProcess/WebPage/WebPage.cpp:
3417         (WebKit::WebPage::setFixedLayoutSize):
3418         (WebKit::WebPage::mainFrameDidLayout):
3419         (WebKit::WebPage::didCommitLoad):
3420         * WebProcess/WebPage/ios/WebPageIOS.mm:
3421         (WebKit::scaleAfterViewportWidthChange):
3422         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
3423         (WebKit::WebPage::dynamicViewportSizeUpdate):
3424         (WebKit::WebPage::resetViewportDefaultConfiguration):
3425         (WebKit::WebPage::viewportConfigurationChanged):
3426         (WebKit::WebPage::updateVisibleContentRects):
3427
3428 2017-12-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3429
3430         WebDriver: handle user prompts shown while executing scripts
3431         https://bugs.webkit.org/show_bug.cgi?id=179979
3432
3433         Reviewed by Brian Burg.
3434
3435         * UIProcess/Automation/Automation.json: Add UnexpectedAlertOpen error.
3436         * UIProcess/Automation/WebAutomationSession.cpp:
3437         (WebKit::WebAutomationSession::willShowJavaScriptDialog): Finish pending evaluateJavaScriptFunction operations
3438         with UnexpectedAlertOpen error.
3439
3440 2017-12-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3441
3442         Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
3443         https://bugs.webkit.org/show_bug.cgi?id=180305
3444
3445         Reviewed by Joseph Pecoraro.
3446
3447         Mark some methods and parameters as const, use the default constructor in more places, and also remove a few
3448         extraneous imported headers.
3449
3450         * Shared/TouchBarMenuData.cpp:
3451         (WebKit::TouchBarMenuData::TouchBarMenuData):
3452
3453         Add a FIXME regarding the use of the 'id' attribute.
3454
3455         (WebKit::TouchBarMenuData::decode):
3456         * Shared/TouchBarMenuData.h:
3457         (WebKit::TouchBarMenuData::items const):
3458         (WebKit::TouchBarMenuData::setID):
3459         (WebKit::TouchBarMenuData::isPageCustomized const):
3460         (WebKit::TouchBarMenuData::items): Deleted.
3461         (WebKit::TouchBarMenuData::isPageCustomized): Deleted.
3462         * Shared/TouchBarMenuItemData.cpp:
3463         (WebKit::getItemType):
3464
3465         Change a helper method from a static class function to a static function in the implementation file.
3466
3467         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
3468         (WebKit::TouchBarMenuItemData::encode const):
3469         (WebKit::TouchBarMenuItemData::decode):
3470         (WebKit::TouchBarMenuItemData::getItemType): Deleted.
3471         * Shared/TouchBarMenuItemData.h:
3472         (WebKit::operator==):
3473
3474         Remove the commandName member variable, since it doesn't make sense to propagate an event handler
3475         attribute from WebCore to the client layer.
3476
3477         * UIProcess/WebPageProxy.messages.in:
3478
3479 2017-12-01  Zan Dobersek  <zdobersek@igalia.com>
3480
3481         Unreviewed GTK+ debug build fix. Replace ASSERT_UNUSED() with UNUSED_PARAM()
3482         in WebKit::WebPage methods that used to operate on HTMLMenuElement pointer
3483         values (which have been converted to references).
3484
3485         * WebProcess/WebPage/WebPage.cpp:
3486         (WebKit::WebPage::didInsertMenuElement):
3487         (WebKit::WebPage::didRemoveMenuElement):
3488         (WebKit::WebPage::didInsertMenuItemElement):
3489         (WebKit::WebPage::didRemoveMenuItemElement):
3490
3491 2017-12-01  Simon Fraser  <simon.fraser@apple.com>
3492
3493         Reduce the number of calls to ViewportConfiguration::updateConfiguration()
3494         https://bugs.webkit.org/show_bug.cgi?id=180299
3495
3496         Reviewed by Zalan Bujtas.
3497
3498         There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading
3499         with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning
3500         early if the configuration hasn't changed.
3501
3502         Also move the fetching of ViewportConfiguration::xhtmlMobileParameters() from didReceiveMobileDocType()
3503         into resetViewportDefaultConfiguration() where we grab all the other default configs.
3504
3505         * WebProcess/WebPage/WebPage.h:
3506         * WebProcess/WebPage/ios/WebPageIOS.mm:
3507         (WebKit::WebPage::didReceiveMobileDocType):
3508         (WebKit::WebPage::resetViewportDefaultConfiguration):
3509
3510 2017-12-01  Aishwarya Nirmal  <anirmal@apple.com>
3511
3512         [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes
3513         https://bugs.webkit.org/show_bug.cgi?id=179714
3514
3515         Reviewed by Wenson Hsieh.
3516
3517         These changes define the TouchBarMenuData and TouchBarMenuItemData objects which draw information
3518         from touch bar HTMLMenuElement and HTMLMenuItemElement. These objects represent the contents of
3519         the page-customized touch bar. Changes to the html elements representing the touch bar are sent 
3520         to the UI process.
3521
3522         * Shared/TouchBarMenuData.cpp: Copied from Source/WebCore/html/HTMLMenuItemElement.cpp.
3523         (WebKit::TouchBarMenuData::TouchBarMenuData):
3524         (WebKit::TouchBarMenuData::addMenuItem):
3525         (WebKit::TouchBarMenuData::removeMenuItem):
3526         (WebKit::TouchBarMenuData::encode const):
3527         (WebKit::TouchBarMenuData::decode):
3528         * Shared/TouchBarMenuData.h: Copied from Source/WebCore/html/HTMLMenuItemElement.h.
3529         (WebKit::TouchBarMenuData::items):
3530         (WebKit::TouchBarMenuData::isPageCustomized):
3531         (WebKit::TouchBarMenuData::setIsPageCustomized):
3532         * Shared/TouchBarMenuItemData.cpp: Added.
3533         (WebKit::TouchBarMenuItemData::getItemType):
3534         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
3535         (WebKit::TouchBarMenuItemData::encode const):
3536         (WebKit::TouchBarMenuItemData::decode):
3537         * Shared/TouchBarMenuItemData.h: Added.
3538         (WebKit::operator<):
3539         (WebKit::operator>):
3540         (WebKit::operator<=):
3541         (WebKit::operator>=):
3542         (WebKit::operator==):
3543         (WebKit::operator!=):
3544         * UIProcess/WebPageProxy.cpp:
3545         (WebKit::WebPageProxy::touchBarMenuDataChanged):
3546         (WebKit::WebPageProxy::touchBarMenuItemDataAdded):
3547         (WebKit::WebPageProxy::touchBarMenuItemDataRemoved):
3548         * UIProcess/WebPageProxy.h:
3549         (WebKit::WebPageProxy::touchBarMenuData const):
3550         * UIProcess/WebPageProxy.messages.in:
3551         * WebKit.xcodeproj/project.pbxproj:
3552         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3553         (WebKit::WebChromeClient::didInsertMenuElement):
3554         (WebKit::WebChromeClient::didRemoveMenuElement):
3555         (WebKit::WebChromeClient::didInsertMenuItemElement):
3556         (WebKit::WebChromeClient::didRemoveMenuItemElement):
3557         * WebProcess/WebCoreSupport/WebChromeClient.h:
3558         * WebProcess/WebPage/WebPage.cpp:
3559         (WebKit::WebPage::didInsertMenuElement):
3560         (WebKit::WebPage::didRemoveMenuElement):
3561         (WebKit::WebPage::didInsertMenuItemElement):
3562         (WebKit::WebPage::didRemoveMenuItemElement):
3563         (WebKit::WebPage::sendTouchBarMenuDataRemovedUpdate):
3564         (WebKit::WebPage::sendTouchBarMenuDataAddedUpdate):
3565         (WebKit::WebPage::sendTouchBarMenuItemDataAddedUpdate):
3566         (WebKit::WebPage::sendTouchBarMenuItemDataRemovedUpdate):
3567         * WebProcess/WebPage/WebPage.h:
3568
3569 2017-12-01  Daniel Bates  <dabates@apple.com>
3570
3571         Alternative Presentation Button: Provide a way to query for the replaced elements
3572         https://bugs.webkit.org/show_bug.cgi?id=180114
3573         <rdar://problem/35710539>
3574
3575         Reviewed by Tim Horton.
3576
3577         Add SPI to query for the elements that were replaced by an Alternative Presentation Button.
3578
3579         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
3580         (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Added.
3581         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
3582         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3583         (WKBundleElementsReplacedByAlternativePresentationButton): Added.
3584         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
3585
3586 2017-12-01  Youenn Fablet  <youenn@apple.com>
3587
3588         Implement https://w3c.github.io/ServiceWorker/#clients-get
3589         https://bugs.webkit.org/show_bug.cgi?id=180167
3590
3591         Reviewed by Chris Dumez.
3592
3593         Add IPC plumbery for clientFromId between ServiceWorker process and Storage process.
3594
3595         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3596         (WebKit::WebSWServerToContextConnection::clientFromIdCompleted):
3597         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3598         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
3599         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3600         (WebKit::WebSWContextManagerConnection::findClientByIdentifier):
3601         (WebKit::WebSWContextManagerConnection::findClientByIdentifierCompleted):
3602         * WebProcess/Storage/WebSWContextManagerConnection.h:
3603         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3604
3605 2017-12-01  Brian Burg  <bburg@apple.com>
3606
3607         Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
3608         https://bugs.webkit.org/show_bug.cgi?id=173662
3609
3610         Reviewed by Joseph Pecoraro.
3611
3612         Adopt new type names.
3613
3614         * UIProcess/Automation/WebAutomationSession.cpp:
3615         (WebKit::WebAutomationSession::getNextContext):
3616         (WebKit::WebAutomationSession::getBrowsingContexts):
3617         (WebKit::buildArrayForCookies):
3618         (WebKit::WebAutomationSession::getSessionPermissions):
3619         * UIProcess/Automation/WebAutomationSession.h:
3620
3621 2017-12-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3622
3623         [Attachment Support] Implement SPI for clients to update a given attachment's data
3624         https://bugs.webkit.org/show_bug.cgi?id=180184
3625         <rdar://problem/35355731>
3626
3627         Reviewed by Tim Horton.
3628
3629         Add plumbing to the web process for setting the attachment data (and optionally, the content type and/or file
3630         name) of a given attachment. See WebCore ChangeLog for more detail. Changes covered by new API tests.
3631
3632         * UIProcess/API/APIAttachment.cpp:
3633         (API::Attachment::setDataAndContentType):
3634         * UIProcess/API/APIAttachment.h:
3635         * UIProcess/API/Cocoa/_WKAttachment.h:
3636
3637         Add nullability annotations around _WKAttachment SPI methods.
3638
3639         * UIProcess/API/Cocoa/_WKAttachment.mm:
3640         (-[_WKAttachment setData:newContentType:newFilename:completion:]):
3641         * UIProcess/WebPageProxy.cpp:
3642         (WebKit::WebPageProxy::setAttachmentDataAndContentType):
3643         * UIProcess/WebPageProxy.h:
3644         * WebProcess/WebPage/WebPage.cpp:
3645         (WebKit::WebPage::setAttachmentDataAndContentType):
3646         * WebProcess/WebPage/WebPage.h:
3647         * WebProcess/WebPage/WebPage.messages.in:
3648
3649 2017-12-01  Brady Eidson  <beidson@apple.com>
3650
3651         Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage.
3652         https://bugs.webkit.org/show_bug.cgi?id=180170
3653
3654         Reviewed by Chris Dumez.
3655
3656         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3657         (WebKit::WebSWServerConnection::startFetch):
3658         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
3659         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3660         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3661
3662         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
3663         (WebKit::WebSWServerToContextConnection::syncTerminateWorker):
3664         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
3665
3666         * StorageProcess/StorageToWebProcessConnection.cpp:
3667         (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
3668
3669         * WebProcess/Storage/WebSWClientConnection.cpp:
3670         (WebKit::WebSWClientConnection::syncTerminateWorker):
3671         * WebProcess/Storage/WebSWClientConnection.h:
3672
3673         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3674         (WebKit::WebSWContextManagerConnection::terminateWorker):
3675         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
3676         * WebProcess/Storage/WebSWContextManagerConnection.h:
3677         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3678
3679         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3680         (WebKit::WebToStorageProcessConnection::didReceiveSyncMessage):
3681         * WebProcess/Storage/WebToStorageProcessConnection.h:
3682
3683 2017-12-01  Youenn Fablet  <youenn@apple.com>
3684
3685         Clear WebSWClientConnection in case storage process IPC connection is closing
3686         https://bugs.webkit.org/show_bug.cgi?id=180210
3687
3688         Reviewed by Chris Dumez.
3689
3690         Clear the sw connection maps when connection is closing.
3691         Call related completion handlers for each connection.
3692
3693         * WebProcess/Storage/WebSWClientConnection.cpp:
3694         (WebKit::WebSWClientConnection::connectionToServerLost):
3695         * WebProcess/Storage/WebSWClientConnection.h:
3696         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3697         (WebKit::WebToStorageProcessConnection::didClose):
3698         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
3699         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
3700         * WebProcess/Storage/WebToStorageProcessConnection.h:
3701
3702 2017-12-01  Eric Carlson  <eric.carlson@apple.com>
3703
3704         [MediaStream] Use CaptureDevice instead of device ID to identify devices
3705         https://bugs.webkit.org/show_bug.cgi?id=180206
3706         <rdar://problem/35775758>
3707
3708         Reviewed by Youenn Fablet.
3709
3710         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3711         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
3712         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3713         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3714         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3715         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3716         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
3717         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3718         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3719         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3720         (WebKit::UserMediaPermissionRequestProxy::allow):
3721         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3722         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
3723         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3724         * WebProcess/WebPage/WebPage.cpp:
3725         (WebKit::WebPage::userMediaAccessWasGranted):
3726         * WebProcess/WebPage/WebPage.h:
3727         * WebProcess/WebPage/WebPage.messages.in:
3728         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3729         (WebKit::UserMediaCaptureManager::createCaptureSource):
3730         * WebProcess/cocoa/UserMediaCaptureManager.h:
3731
3732 2017-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3733
3734         WebDriver: link and partial links queries don't work in xhtml documents
3735         https://bugs.webkit.org/show_bug.cgi?id=180191
3736
3737         Reviewed by Brian Burg.
3738
3739         We convert the queries to use xpath, which works for html documents, but it doesn't work for xhtml. In case of
3740         xhtml we would need to provide a namespace resolver and elements would need to be prefixed with 'xhtml:'. It's
3741         easier to simply iterate the link elements and compare the text.
3742
3743         Fixes: imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[link text-full link text]
3744                imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[partial link text-link text]
3745                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[link text-full link text]
3746                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[partial link text-link text]
3747                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[link text-full link text]
3748                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[partial link text-link text]
3749                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[link text-full link text]
3750                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[partial link text-link text]
3751
3752         * UIProcess/Automation/atoms/FindNodes.js:
3753         (switch):
3754         (tryToFindNode):
3755
3756 2017-11-30  Alex Christensen  <achristensen@webkit.org>
3757
3758         REGRESSION (r224791): cookies are shared between ephemeral sessions in the same process pool
3759         https://bugs.webkit.org/show_bug.cgi?id=180235
3760
3761         Reviewed by Joseph Pecoraro.
3762
3763         In r224791 I assumed that uiProcessCookieStorageIdentifier would be empty in the ephemeral session initialization message.
3764         This is not the case.  We did not catch this because almost all of our ephemeral session testing uses the legacyPrivateSessionID.
3765         I add checks for if the SessionID is ephemeral like we already have in WebFrameNetworkingContext::ensureWebsiteDataStoreSession.
3766         I also add an API test that makes sure cookies are not shared between ephemeral sessions the way they are made through the API.
3767
3768         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3769         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3770
3771 2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>
3772
3773         Make LegacyCustomProtocolManager optional for network process
3774         https://bugs.webkit.org/show_bug.cgi?id=176230
3775
3776         Reviewed by Alex Christensen.
3777
3778         * CMakeLists.txt:
3779         * Configurations/FeatureDefines.xcconfig:
3780         * NetworkProcess/NetworkProcess.cpp:
3781         (WebKit::NetworkProcess::NetworkProcess):
3782         (WebKit::NetworkProcess::initializeNetworkProcess):
3783         * PlatformGTK.cmake:
3784         * PlatformMac.cmake:
3785         * PlatformWPE.cmake:
3786         * UIProcess/Network/NetworkProcessProxy.cpp:
3787         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
3788         (WebKit::NetworkProcessProxy::didClose):
3789         * UIProcess/Network/NetworkProcessProxy.h:
3790         * UIProcess/WebProcessPool.cpp:
3791         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
3792         (WebKit::WebProcessPool::registerSchemeForCustomProtocol):
3793         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
3794
3795 2017-11-30  Ryan Haddad  <ryanhaddad@apple.com>
3796
3797         Unreviewed build fix, suppress deprecation warnings.
3798
3799         * Shared/mac/SandboxExtensionMac.mm:
3800         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
3801
3802 2017-11-30  Daniel Bates  <dabates@apple.com>
3803
3804         Expose SPI didClickAlternativePresentationButtonWithUserInfo on iOS
3805         https://bugs.webkit.org/show_bug.cgi?id=180218
3806         <rdar://problem/35782555>
3807
3808         Reviewed by Alex Christensen.
3809
3810         We want to support the SPI didClickAlternativePresentationButtonWithUserInfo on Cocoa platforms.
3811
3812         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3813         * UIProcess/Cocoa/UIDelegate.h:
3814         * UIProcess/Cocoa/UIDelegate.mm:
3815         (WebKit::UIDelegate::setDelegate):
3816         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton):
3817
3818 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
3819
3820         [Cocoa] Web Automation: _WKAutomationSessionConfiguration leak
3821         https://bugs.webkit.org/show_bug.cgi?id=180222
3822
3823         Reviewed by Brian Burg.
3824
3825         * UIProcess/Cocoa/AutomationClient.mm:
3826         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
3827
3828 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
3829
3830         Fix some NSOperationQueue leaks
3831         https://bugs.webkit.org/show_bug.cgi?id=180221
3832
3833         Reviewed by Wenson Hsieh.
3834
3835         * UIProcess/Cocoa/WebViewImpl.mm:
3836         (WebKit::WebViewImpl::performDragOperation):
3837
3838 2017-11-30  Brian Burg  <bburg@apple.com>
3839
3840         Web Automation: computeElementLayout does not correctly translate iframe client coordinates to main frame coordinates
3841         https://bugs.webkit.org/show_bug.cgi?id=180213
3842         <rdar://problem/30260141>
3843
3844         Reviewed by Simon Fraser.
3845
3846         The current implementation computes points in terms of the frame in which the element is located.
3847         However, WebDriver expects coordinates to be relative to the top-level document since
3848         these coordinates are used for generating click events, among other things.
3849
3850         To convert from frame client coordinates to main frame client coordinates, round-trip
3851         both inViewCenterPoint and elementBounds to root view coordinates and back
3852         to the main frame's contents/client coordinates. Then convert this to page coordinates if needed.
3853
3854         This progresses several tests in the Selenium Python test suite:
3855
3856          - event_firing_webdriver_tests.py::test_should_fire_navigation_events
3857          - frame_switching_tests.py::testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation
3858          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs
3859          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex
3860          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement
3861          - frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs
3862          - position_and_size_tests.py::testShouldGetCoordinatesOfAnInvisibleElement
3863
3864         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3865         (WebKit::WebAutomationSessionProxy::computeElementLayout):
3866         Get both the frame and main frame FrameViews and convert coordinates to the root view.
3867         This is somewhat lossy as clientToDocument* deals with FloatPoints but contentsToRootView
3868         deals with IntPoints. For the purposes of WebDriver, lossiness is not a problem since
3869         integer values are expected anyway.
3870
3871         The imperative nature of the coordinate calculations is difficult to debug, so I converted
3872         this function to only assign to each variable once.
3873
3874 2017-11-30  Alex Christensen  <achristensen@webkit.org>
3875
3876         WKURLSchemeHandler.request should include HTTPBody
3877         https://bugs.webkit.org/show_bug.cgi?id=180220
3878
3879         Reviewed by Brady Eidson.
3880
3881         * Shared/URLSchemeTaskParameters.cpp: Added.
3882         (WebKit::URLSchemeTaskParameters::encode const):
3883         (WebKit::URLSchemeTaskParameters::decode):
3884         * Shared/URLSchemeTaskParameters.h: Added.
3885         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
3886         (-[WKURLSchemeTaskImpl request]):
3887         * UIProcess/WebPageProxy.cpp:
3888         (WebKit::WebPageProxy::startURLSchemeTask):
3889         * UIProcess/WebPageProxy.h:
3890         * UIProcess/WebPageProxy.messages.in:
3891         * UIProcess/WebURLSchemeHandler.cpp:
3892         (WebKit::WebURLSchemeHandler::startTask):
3893         * UIProcess/WebURLSchemeHandler.h:
3894         * UIProcess/WebURLSchemeTask.cpp:
3895         (WebKit::WebURLSchemeTask::create):
3896         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
3897         * UIProcess/WebURLSchemeTask.h:
3898         * WebKit.xcodeproj/project.pbxproj:
3899         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
3900         (WebKit::WebURLSchemeTaskProxy::startLoading):
3901
3902 2017-11-30  Darin Adler  <darin@apple.com>
3903
3904         [Mac] remove unneeded RetainPtr use introduced in r225142
3905         https://bugs.webkit.org/show_bug.cgi?id=180202
3906
3907         Reviewed by Tim Horton.
3908
3909         * WebProcess/Plugins/PDF/PDFPlugin.h: Got rid of unnecessary RetainPtr.
3910         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3911         (WebKit::PDFPlugin::lookupTextAtLocation const): Ditto.
3912         * WebProcess/WebPage/WebPage.h: Ditto.
3913         * WebProcess/WebPage/mac/WebPageMac.mm:
3914         (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto.
3915         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
3916         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Ditto.
3917         (WebKit::WebPage::lookupTextAtLocation): Ditto.
3918
3919 2017-11-30  Zan Dobersek  <zdobersek@igalia.com>
3920
3921         [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine
3922         https://bugs.webkit.org/show_bug.cgi?id=180141
3923
3924         Reviewed by Carlos Garcia Campos.
3925
3926         CompositingCoordinator must implement the paintingEngine() method now
3927         that the method's been added to the CoordinatedGraphicsLayerClient
3928         interface. The CompositingCoordinator manages the Nicosia::PaintingEngine
3929         object through the new m_paintingEngine member variable, and returns the
3930         reference to this object in the paintingEngine() method.
3931
3932         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3933         (WebKit::CompositingCoordinator::CompositingCoordinator):
3934         (WebKit::CompositingCoordinator::paintingEngine):
3935         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3936         Drop unnecessary typedefs.
3937
3938 2017-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3939
3940         [Attachment Support] Implement SPI for clients to make an attachment element display in-place
3941         https://bugs.webkit.org/show_bug.cgi?id=180153
3942         <rdar://problem/35735252>
3943
3944         Reviewed by Tim Horton.
3945
3946         Add new WebKit SPI, -[_WKAttachment setDisplayOptions:completion:], and add plumbing for attachment display
3947         options to the web content process. Changes covered by 4 new API tests.
3948
3949         * Scripts/webkit/messages.py:
3950         (headers_for_type):
3951         * UIProcess/API/APIAttachment.cpp:
3952         (API::Attachment::setDisplayOptions):
3953         * UIProcess/API/APIAttachment.h:
3954         * UIProcess/API/Cocoa/WKWebView.mm:
3955         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
3956
3957         Respect given display options when inserting a new attachment.
3958
3959         * UIProcess/API/Cocoa/_WKAttachment.h:
3960         * UIProcess/API/Cocoa/_WKAttachment.mm:
3961         (-[_WKAttachmentDisplayOptions coreDisplayOptions]):
3962
3963         Introduce a helper to convert from the Cocoa _WKAttachmentDisplayOptions object to platform-agnostic
3964         AttachmentDisplayOptions.
3965
3966         (-[_WKAttachment setDisplayOptions:completion:]):
3967         (WebKit::if): Deleted.
3968         * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
3969         * UIProcess/WebPageProxy.cpp:
3970         (WebKit::WebPageProxy::insertAttachment):
3971         (WebKit::WebPageProxy::setAttachmentDisplayOptions):
3972         * UIProcess/WebPageProxy.h:
3973         * WebProcess/WebPage/WebPage.cpp:
3974         (WebKit::WebPage::insertAttachment):
3975         (WebKit::WebPage::requestAttachmentData):
3976         (WebKit::WebPage::setAttachmentDisplayOptions):
3977         (WebKit::WebPage::attachmentElementWithIdentifier const):
3978
3979         Pull common logic to retrieve an attachment element matching a given identifier out into a helper.
3980
3981         * WebProcess/WebPage/WebPage.h:
3982         * WebProcess/WebPage/WebPage.messages.in:
3983
3984 2017-11-29  Brent Fulgham  <bfulgham@apple.com>
3985
3986         Part 2: Adopt updated NSKeyed[Un]Archiver API when available
3987         https://bugs.webkit.org/show_bug.cgi?id=180127
3988         <rdar://problem/35710738>
3989
3990         Reviewed by Simon Fraser.
3991
3992         The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
3993         to the modern API. Use the original API for macOS builds prior to 10.12.
3994
3995         * Shared/Cocoa/DataDetectionResult.mm:
3996         (WebKit::DataDetectionResult::encode const):
3997         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3998         (IPC::ArgumentCoder<WebCore::Payment>::encode):
3999         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
4000         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
4001         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
4002         * Shared/ios/InteractionInformationAtPosition.mm:
4003         (WebKit::InteractionInformationAtPosition::encode const):
4004         * Shared/mac/WebCoreArgumentCodersMac.mm:
4005         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
4006         (IPC::ArgumentCoder<Credential>::encodePlatformData):
4007         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
4008         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
4009         * Shared/mac/WebHitTestResultData.mm:
4010         (WebKit::WebHitTestResultData::platformEncode const):
4011         * UIProcess/API/Cocoa/WKProcessPool.mm:
4012         (-[WKProcessPool _setObject:forBundleParameter:]):
4013         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
4014         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
4015         (WebKit::WebProcessPool::platformInitializeWebProcess):
4016         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
4017         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
4018
4019 2017-11-29  Brady Eidson  <beidson@apple.com>
4020
4021         When managing context startups, make ServiceWorkerJobDataIdentifier's optional.
4022         https://bugs.webkit.org/show_bug.cgi?id=180166
4023
4024         Reviewed by Chris Dumez.
4025
4026         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
4027
4028         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
4029         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
4030         (WebKit::WebSWContextManagerConnection::didFinishInstall):
4031         * WebProcess/Storage/WebSWContextManagerConnection.h:
4032
4033 2017-11-29  Youenn Fablet  <youenn@apple.com>
4034
4035         Add support for service worker generated redirections
4036         https://bugs.webkit.org/show_bug.cgi?id=179498
4037
4038         Reviewed by Darin Adler.
4039
4040         Small refactoring to allow a service worker redirected fetch to follow the redirection through the service worker.
4041
4042         * WebProcess/Network/WebLoaderStrategy.cpp:
4043         (WebKit::WebLoaderStrategy::scheduleLoad): Make use of the loader request in case a network load is needed after a service worker redirection.
4044         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
4045         (WebKit::ServiceWorkerClientFetch::create):
4046         (WebKit::ServiceWorkerClientFetch::~ServiceWorkerClientFetch):
4047         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
4048         (WebKit::ServiceWorkerClientFetch::start):
4049         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Check for response.
4050         Generate redirected request if needed and call loader callback to process the redirection.
4051         Adding some states so that if didFinish is called before the willSendRequest callback, redirection is followed.
4052         (WebKit::ServiceWorkerClientFetch::didFinish):
4053         In case redirection should be followed, wait for didFinish to follow it.
4054         This simplifies the model although introducing some limited latency.
4055         * WebProcess/Storage/ServiceWorkerClientFetch.h:
4056         * WebProcess/Storage/WebSWClientConnection.cpp:
4057         (WebKit::WebSWClientConnection::startFetch):
4058         * WebProcess/Storage/WebSWClientConnection.h:
4059         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
4060         (WebKit::WebServiceWorkerProvider::handleFetch):
4061
4062 2017-11-29  Youenn Fablet  <youenn@apple.com>
4063
4064         Add support for FetchEvent.clientId
4065         https://bugs.webkit.org/show_bug.cgi?id=180052
4066
4067         Reviewed by Chris Dumez.
4068
4069         Using FetchOption persistency coders for cache API and modernizing IPC FetchOptions decoding.
4070
4071         * WebKit/Shared/WebCoreArgumentCoders.cpp:
4072         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
4073         (WebKit::CacheStorage::Cache::encode):
4074         (WebKit::CacheStorage::Cache::decodeRecordHeader):
4075         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
4076         (WebKit::WebSWContextManagerConnection::startFetch):
4077         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
4078         (WebKit::WebSWContextManagerConnection::startFetch):
4079
4080 2017-11-29  Alex Christensen  <achristensen@webkit.org>
4081
4082         Make WebFrameLoaderClient more robust against null pointer dereferencing
4083         https://bugs.webkit.org/show_bug.cgi?id=180157
4084         <rdar://problem/34895616>
4085
4086         Reviewed by Tim Horton.
4087
4088         There has always been rare null pointer crashes in this code, but they have become more common
4089         now that we are waiting for completion handlers for redirects, which makes it more likely that
4090         we are hitting this code after we have detached from the core frame.
4091
4092         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
4093         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
4094         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
4095         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
4096         * WebProcess/WebPage/WebFrame.cpp:
4097         (WebKit::WebFrame::page const):
4098
4099 2017-11-29  Alex Christensen  <achristensen@webkit.org>
4100
4101         Fix Mac CMake build.
4102
4103         * PlatformMac.cmake:
4104
4105 2017-11-29  Chris Dumez  <cdumez@apple.com>
4106
4107         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection
4108         https://bugs.webkit.org/show_bug.cgi?id=180147
4109
4110         Reviewed by Brady Eidson.
4111
4112         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection.
4113         Otherwise, we have with 2 IPC::Connections between the StorageProcess and the ServiceWorker (aka Context) process,
4114         which makes synchronization of IPC messages difficult.
4115
4116         * StorageProcess/StorageProcess.cpp:
4117         (WebKit::StorageProcess::createStorageToWebProcessConnection):
4118         (WebKit::StorageProcess::createServerToContextConnection):
4119         * StorageProcess/StorageProcess.h:
4120         * StorageProcess/StorageProcess.messages.in:
4121         * StorageProcess/StorageToWebProcessConnection.cpp:
4122         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
4123         * UIProcess/ServiceWorkerProcessProxy.cpp:
4124         (WebKit::ServiceWorkerProcessProxy::start):
4125         * UIProcess/ServiceWorkerProcessProxy.h:
4126         * UIProcess/Storage/StorageProcessProxy.cpp:
4127         (WebKit::StorageProcessProxy::getStorageProcessConnection):
4128         (WebKit::StorageProcessProxy::didFinishLaunching):
4129         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
4130         * UIProcess/Storage/StorageProcessProxy.h:
4131         * UIProcess/Storage/StorageProcessProxy.messages.in:
4132         * UIProcess/WebProcessPool.cpp:
4133         (WebKit::WebProcessPool::getStorageProcessConnection):
4134         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
4135         * UIProcess/WebProcessPool.h:
4136         * UIProcess/WebProcessProxy.cpp:
4137         (WebKit::WebProcessProxy::getStorageProcessConnection):
4138         * UIProcess/WebProcessProxy.h:
4139         (WebKit::WebProcessProxy::isServiceWorkerProcess const):
4140         * UIProcess/WebProcessProxy.messages.in:
4141         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
4142         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
4143         * WebProcess/WebProcess.cpp:
4144         (WebKit::WebProcess::didReceiveMessage):
4145         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
4146         * WebProcess/WebProcess.h:
4147         * WebProcess/WebProcess.messages.in:
4148
4149 2017-11-29  Chris Dumez  <cdumez@apple.com>
4150
4151         ensure*Connection() methods on WebProcess should return a reference
4152         https://bugs.webkit.org/show_bug.cgi?id=180149
4153
4154         Reviewed by Alex Christensen.
4155
4156         ensure*Connection() methods on WebProcess should return a reference instead of not returning
4157         anything. Also get rid of the non-ensure variants which called "ensure" internally and are
4158         no longer needed.
4159
4160         * Shared/mac/CookieStorageShim.mm:
4161         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
4162         * WebProcess/Cache/WebCacheStorageConnection.cpp:
4163         (WebKit::WebCacheStorageConnection::connection):
4164         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
4165         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
4166         (WebKit::preregisterSandboxExtensionsIfNecessary):
4167         * WebProcess/Databases/WebDatabaseProvider.cpp:
4168         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
4169         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
4170         (WebKit::BlobRegistryProxy::registerFileBlobURL):
4171         (WebKit::BlobRegistryProxy::re