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