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