Unreviewed build fix after r225622.
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-12-07  Chris Dumez  <cdumez@apple.com>
2
3         Unreviewed build fix after r225622.
4
5         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
6         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
7
8 2017-12-06  Chris Dumez  <cdumez@apple.com>
9
10         We should be able to recover after a Service Worker process crash
11         https://bugs.webkit.org/show_bug.cgi?id=180477
12
13         Reviewed by Brady Eidson and Youenn Fablet.
14
15         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
16         (WebKit::WebSWServerConnection::startFetch):
17         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
18         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
19         Update calls to SWServer::runServiceWorkerIfNecessary() that that it is asynchronous
20         and takes in a lambda.
21
22         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
23         (WebKit::WebSWServerConnection::ipcConnection const):
24         Add getter for the underlying IPC connection.
25
26         * StorageProcess/StorageProcess.cpp:
27         (WebKit::StorageProcess::didClose):
28         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
29         Move some code to connectionToContextProcessWasClosed() to avoid duplication.
30         Also, relaunch the Service Worker process if it has exited but we still
31         have SWServer connections to regular Web Processes.
32
33         (WebKit::StorageProcess::needsServerToContextConnection const):
34         Utility function to determine if we still need the service worker process.
35         The current rule is that we need the service worker (aka "context") process
36         if we still have SWServer connections to regular Web Processes.
37
38         * StorageProcess/StorageProcess.h:
39
40         * StorageProcess/StorageToWebProcessConnection.cpp:
41         (WebKit::StorageToWebProcessConnection::didClose):
42         If didClose() is called for the connection to the service worker context,
43         let the StorageProcess know so that it can clear its state and relaunch
44         the process if necessary.
45
46         * UIProcess/API/C/WKContext.cpp:
47         (WKContextTerminateServiceWorkerProcess):
48         * UIProcess/API/C/WKContextPrivate.h:
49         * UIProcess/API/Cocoa/WKProcessPool.mm:
50         (-[WKProcessPool _terminateServiceWorkerProcess]):
51         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
52         Add SPI to terminate the service worker process.
53
54         * UIProcess/WebProcessPool.cpp:
55         (WebKit::m_serviceWorkerProcessTerminationTimer):
56         (WebKit::WebProcessPool::createNewWebProcess):
57         (WebKit::WebProcessPool::disconnectProcess):
58         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
59         * UIProcess/WebProcessPool.h:
60         We used to shutdown the ServiceWorker process right away as soon as the last regular
61         WebProcess was gone. We now give it a grace period of 5 seconds in case a new
62         WebProcess gets launched shortly after.
63
64 2017-12-02  Darin Adler  <darin@apple.com>
65
66         Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp
67         https://bugs.webkit.org/show_bug.cgi?id=180009
68
69         Reviewed by Alex Christensen.
70
71         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
72         (WebKit::initializeProtectionSpace): Use equalLettersIgnoringASCIICase instead
73         of strcasecmp.
74
75 2017-12-06  David Quesada  <david_quesada@apple.com>
76
77         [Web App Manifest] Add SPI for applying a manifest to a top-level browsing context
78         https://bugs.webkit.org/show_bug.cgi?id=180368
79         rdar://problem/34748067
80
81         Reviewed by Geoffrey Garen.
82
83         Add a new property WKWebViewConfiguration._applicationManifest to specify manifest
84         to apply to application contexts (aka. top-level browsing contexts, i.e. web views).
85         The manifest is ultimately stored on the MainFrame of the Pages created from the
86         web view configuration.
87
88         No new tests, no change in behavior.
89
90         * Shared/WebPageCreationParameters.cpp:
91         (WebKit::WebPageCreationParameters::encode const):
92         (WebKit::WebPageCreationParameters::decode):
93         * Shared/WebPageCreationParameters.h:
94         * UIProcess/API/APIPageConfiguration.cpp:
95         (API::PageConfiguration::copy const):
96         (API::PageConfiguration::applicationManifest const):
97         (API::PageConfiguration::setApplicationManifest):
98         * UIProcess/API/APIPageConfiguration.h:
99         * UIProcess/API/Cocoa/WKWebView.mm:
100         (-[WKWebView _initializeWithConfiguration:]):
101         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
102         (-[WKWebViewConfiguration copyWithZone:]):
103         (-[WKWebViewConfiguration _applicationManifest]):
104         (-[WKWebViewConfiguration _setApplicationManifest:]):
105         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
106         * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h:
107         * UIProcess/WebPageProxy.cpp:
108         (WebKit::WebPageProxy::creationParameters):
109         * WebProcess/WebPage/WebPage.cpp:
110         (WebKit::m_cpuLimit):
111
112 2017-12-06  Jeff Miller  <jeffm@apple.com>
113
114         -[WKWebViewConfiguration copyWithZone] doesn't copy _groupIdentifier
115         https://bugs.webkit.org/show_bug.cgi?id=180504
116
117         Reviewed by Geoffrey Garen.
118
119         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
120         (-[WKWebViewConfiguration copyWithZone:]):
121         Copy _groupIdentifier.
122
123 2017-12-06  David Quesada  <david_quesada@apple.com>
124
125         [Web App Manifest] Add SPI for fetching the manifest
126         https://bugs.webkit.org/show_bug.cgi?id=180294
127         rdar://problem/34747968
128
129         Reviewed by Geoffrey Garen.
130
131         Add a new method -[WKWebView _getApplicationManifestWithCompletionHandler:] to request
132         the manifest associated with the current page.
133
134         * Shared/API/APIObject.h:
135         * Shared/Cocoa/APIObject.mm:
136         (API::Object::newObject):
137         * UIProcess/API/APIApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
138             Add a new API object type for application manifests.
139         * UIProcess/API/C/WKPage.cpp:
140         (WKPageGetApplicationManifest_b):
141             Add a C version of this SPI for WebKitTestRunner.
142         * UIProcess/API/C/WKPagePrivate.h:
143         * UIProcess/API/Cocoa/WKWebView.mm:
144         (-[WKWebView _getApplicationManifestWithCompletionHandler:]):
145         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
146         * UIProcess/API/Cocoa/_WKApplicationManifest.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
147         * UIProcess/API/Cocoa/_WKApplicationManifest.mm: Added.
148         (-[_WKApplicationManifest initWithCoder:]):
149         (-[_WKApplicationManifest encodeWithCoder:]):
150         (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
151         (-[_WKApplicationManifest _apiObject]):
152         (nullableNSString):
153         (-[_WKApplicationManifest name]):
154         (-[_WKApplicationManifest shortName]):
155         (-[_WKApplicationManifest applicationDescription]):
156         (-[_WKApplicationManifest scope]):
157         (-[_WKApplicationManifest startURL]):
158         * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: Copied from Source/WebCore/Modules/applicationmanifest/ApplicationManifest.h.
159         (API::wrapper):
160         * UIProcess/WebPageProxy.cpp:
161         (WebKit::WebPageProxy::applicationManifestCallback):
162         (WebKit::WebPageProxy::getApplicationManifest):
163         * UIProcess/WebPageProxy.h:
164         * UIProcess/WebPageProxy.messages.in:
165         * WebKit.xcodeproj/project.pbxproj:
166         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
167         (WebKit::WebFrameLoaderClient::finishedLoadingApplicationManifest):
168         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
169         * WebProcess/WebPage/WebPage.cpp:
170         (WebKit::WebPage::getApplicationManifest):
171         (WebKit::WebPage::didFinishLoadingApplicationManifest):
172         * WebProcess/WebPage/WebPage.h:
173         * WebProcess/WebPage/WebPage.messages.in:
174
175 2017-12-06  Per Arne Vollan  <pvollan@apple.com>
176
177         The WebProcess should use the NSRunLoop runloop type.
178         https://bugs.webkit.org/show_bug.cgi?id=179804
179         <rdar://problem/14012823>
180
181         Reviewed by Brent Fulgham.
182
183         * Platform/IPC/mac/ConnectionMac.mm:
184         (IPC::AccessibilityProcessSuspendedNotification):
185         * Shared/ChildProcess.h:
186         * Shared/mac/ChildProcessMac.mm:
187         (WebKit::ChildProcess::launchServicesCheckIn):
188         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
189         (WebKit::shouldLeakBoost):
190         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
191         * WebProcess/WebProcess.cpp:
192         (WebKit::WebProcess::initializeProcess):
193
194 2017-12-06  Nan Wang  <n_wang@apple.com>
195
196         AX: [iOS] Post accessibility notification when a web process changes its suspended state
197         https://bugs.webkit.org/show_bug.cgi?id=180458
198         <rdar://problem/35869115>
199
200         Reviewed by Chris Dumez.
201
202         Post accessibility notification with the pid information when a web process
203         becomes suspended or resumes running.
204
205         * WebProcess/WebProcess.cpp:
206         (WebKit::WebProcess::actualPrepareToSuspend):
207         (WebKit::WebProcess::processDidResume):
208         * WebProcess/WebProcess.h:
209         * WebProcess/cocoa/WebProcessCocoa.mm:
210         (WebKit::WebProcess::accessibilityProcessSuspendedNotification):
211
212 2017-12-06  Ryan Haddad  <ryanhaddad@apple.com>
213
214         Unreviewed build fix, removed unused lambda capture.
215
216         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
217         (WebKit::CacheStorageEngineConnection::open):
218
219 2017-12-06  John Wilander  <wilander@apple.com>
220
221         Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes
222         https://bugs.webkit.org/show_bug.cgi?id=176944
223         <rdar://problem/34440658>
224
225         Reviewed by Brent Fulgham.
226
227         This change introduces document.hasStorageAccess() as a function which
228         returns a promise instead of being a property. Since cookie access can
229         be due to both a granted request and recent user interaction as first
230         party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.
231
232         * UIProcess/WebPageProxy.cpp:
233         (WebKit::WebPageProxy::hasStorageAccess):
234         * UIProcess/WebPageProxy.h:
235         * UIProcess/WebPageProxy.messages.in:
236         * UIProcess/WebResourceLoadStatisticsStore.cpp:
237         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
238         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
239             Now adds an entry for granted access. A bug found through testing.
240             Switched from WTF::Function to WTF::CompletionHandler.
241         * UIProcess/WebResourceLoadStatisticsStore.h:
242         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
243         (WebKit::WebsiteDataStore::hasStorageAccess):
244         (WebKit::WebsiteDataStore::requestStorageAccess):
245             Switched from WTF::Function to WTF::CompletionHandler.
246         * UIProcess/WebsiteData/WebsiteDataStore.h:
247         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
248         (WebKit::WebChromeClient::hasStorageAccess):
249         (WebKit::WebChromeClient::requestStorageAccess):
250             Switched from WTF::Function to WTF::CompletionHandler.
251         * WebProcess/WebCoreSupport/WebChromeClient.h:
252         * WebProcess/WebPage/WebPage.cpp:
253         (WebKit::WebPage::hasStorageAccess):
254         (WebKit::WebPage::requestStorageAccess):
255             Switched from WTF::Function to WTF::CompletionHandler.
256         * WebProcess/WebPage/WebPage.h:
257
258 2017-12-06  Youenn Fablet  <youenn@apple.com>
259
260         CacheStorageEngineConnection should protect its IPC Connection when doing asynchronous tasks
261         https://bugs.webkit.org/show_bug.cgi?id=180461
262
263         Reviewed by Chris Dumez.
264
265         Protecting the IPC connection instead of the CacheStorageEngineConnection
266         since CacheStorageEngineConnection only keeps a reference to the NetworkConnectionToWebProcess.
267
268         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
269         (WebKit::CacheStorageEngineConnection::open):
270         (WebKit::CacheStorageEngineConnection::remove):
271         (WebKit::CacheStorageEngineConnection::caches):
272         (WebKit::CacheStorageEngineConnection::retrieveRecords):
273         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
274         (WebKit::CacheStorageEngineConnection::putRecords):
275         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
276
277 2017-12-06  Zan Dobersek  <zdobersek@igalia.com>
278
279         [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation
280         https://bugs.webkit.org/show_bug.cgi?id=180239
281
282         Reviewed by Michael Catanzaro.
283
284         With Nicosia::Buffer now only providing the memory area into which the
285         tile content was rasterized, we can simplify the BitmapTexture update
286         greatly -- we don't have to create a BitmapImage anymore and retrieve
287         memory pointer from the contained cairo_surface_t object. Instead, we
288         just copy to GPU the memory that Nicosia::Buffer controls.
289
290         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
291         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
292
293 2017-12-05  Brent Fulgham  <bfulgham@apple.com>
294
295         Limit user agent versioning to an upper bound
296         https://bugs.webkit.org/show_bug.cgi?id=180365
297         <rdar://problem/34550617>
298
299         Reviewed by Joseph Pecoraro.
300
301         * UIProcess/ios/WebPageProxyIOS.mm:
302         (WebKit::WebPageProxy::standardUserAgent): Don't pass the WebKit bundle version when
303         creatin the User Agent string.
304         (WebKit::webKitBundleVersionString): Deleted.
305         * UIProcess/mac/WebPageProxyMac.mm:
306         (WebKit::WebPageProxy::standardUserAgent): Ditto.
307         (WebKit::webKitBundleVersionString): Deleted.
308
309 2017-12-05  Alex Christensen  <achristensen@webkit.org>
310
311         Fix crash when loading a file URL that does not have a fileSystemPath representation
312         https://bugs.webkit.org/show_bug.cgi?id=180448
313         <rdar://problem/22805921>
314
315         Reviewed by Chris Dumez.
316
317         * UIProcess/WebProcessProxy.cpp:
318         (WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
319         Check if a String is null before adding it to a HashSet.
320
321 2017-12-05  Youenn Fablet  <youenn@apple.com>
322
323         Implement https://w3c.github.io/ServiceWorker/#clients-claim
324         https://bugs.webkit.org/show_bug.cgi?id=180261
325
326         Reviewed by Chris Dumez.
327
328         Add IPC plumbery for clients claim between ServiceWorker process and Storage process.
329
330         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
331         (WebKit::WebSWServerToContextConnection::claimCompleted):
332         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
333         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
334         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
335         (WebKit::WebSWContextManagerConnection::claim):
336         (WebKit::WebSWContextManagerConnection::claimCompleted):
337         * WebProcess/Storage/WebSWContextManagerConnection.h:
338         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
339
340 2017-12-05  Chris Dumez  <cdumez@apple.com>
341
342         Add support for ServiceWorkerContainer.prototype.ready
343         https://bugs.webkit.org/show_bug.cgi?id=180383
344
345         Reviewed by Youenn Fablet.
346
347         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
348         (WebKit::WebSWServerConnection::whenRegistrationReady):
349         (WebKit::WebSWServerConnection::resolveRegistrationReadyRequests):
350         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
351         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
352         * WebProcess/Storage/WebSWClientConnection.cpp:
353         (WebKit::WebSWClientConnection::matchRegistration):
354         (WebKit::WebSWClientConnection::whenRegistrationReady):
355         (WebKit::WebSWClientConnection::registrationReady):
356         (WebKit::WebSWClientConnection::getRegistrations):
357         * WebProcess/Storage/WebSWClientConnection.h:
358         * WebProcess/Storage/WebSWClientConnection.messages.in:
359
360 2017-12-05  Youenn Fablet  <youenn@apple.com>
361
362         Implement setting of service worker to client in SWServer without going to WebProcess
363         https://bugs.webkit.org/show_bug.cgi?id=180382
364
365         Reviewed by Chris Dumez.
366
367         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
368         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
369         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
370         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
371         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
372         * WebProcess/Storage/WebSWClientConnection.cpp:
373         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
374         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient): Deleted.
375         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient): Deleted.
376         * WebProcess/Storage/WebSWClientConnection.h:
377
378 2017-12-04  Chris Dumez  <cdumez@apple.com>
379
380         Support container.getRegistration() / getRegistrations() inside service workers
381         https://bugs.webkit.org/show_bug.cgi?id=180360
382
383         Reviewed by Youenn Fablet.
384
385         * WebProcess/Storage/WebSWClientConnection.cpp:
386         (WebKit::WebSWClientConnection::didMatchRegistration):
387         (WebKit::WebSWClientConnection::didGetRegistrations):
388         (WebKit::WebSWClientConnection::matchRegistration):
389         (WebKit::WebSWClientConnection::getRegistrations):
390
391 2017-12-04  Brady Eidson  <beidson@apple.com>
392
393         Followup to:
394         Get a directory path to SWServers for storing ServiceWorker registrations
395         https://bugs.webkit.org/show_bug.cgi?id=180362
396
397         Unreviewed.
398
399         * StorageProcess/StorageProcess.cpp:
400         (WebKit::StorageProcess::swServerForSession): Change this ASSERT which is invalid in private browsing sessions.
401
402 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
403
404         Minor DisplayRefreshMonitor-related cleanup
405         https://bugs.webkit.org/show_bug.cgi?id=179802
406
407         Reviewed by Sam Weinig.
408
409         Use RunLoopObserver::WellKnownRunLoopOrders. We want to fire before layer flushing.
410
411         * UIProcess/WebPageProxy.cpp:
412         (WebKit::m_configurationPreferenceValues):
413
414 2017-12-04  Brent Fulgham  <bfulgham@apple.com>
415
416         Don't force creation of process pool when enabling resource load statistics
417         https://bugs.webkit.org/show_bug.cgi?id=180374
418         <rdar://problem/35545639>
419
420         Reviewed by Alex Christensen.
421
422         Pass appropriate arguments to the 'processPool' accessor so that we only get the
423         set of existing process pools. We don't want to pay the cost of launching new
424         process pools just to set this flag. The flag will be properly set when the pools
425         are created as soon as a WebView is instantiated.
426
427         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
428         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
429
430 2017-12-04  David Quesada  <david_quesada@apple.com>
431
432         Add a class for parsing application manifests
433         https://bugs.webkit.org/show_bug.cgi?id=177973
434         rdar://problem/34747949
435
436         Reviewed by Geoffrey Garen.
437
438         * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
439
440 2017-12-04  Wenson Hsieh  <wenson_hsieh@apple.com>
441
442         Rename a static helper in TouchBarMenuItemData.cpp to match style guidelines.
443         https://bugs.webkit.org/show_bug.cgi?id=180305
444
445         Reviewed by Andy Estes.
446
447         Style guidelines state that we should use bare words for getters, so getItemType should just be
448         itemType. Since this collides with the itemType member variable, this patch also renames that
449         member variable to the more concise "type".
450
451         No change in behavior.
452
453         * Shared/TouchBarMenuItemData.cpp:
454         (WebKit::itemType):
455         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
456         (WebKit::TouchBarMenuItemData::encode const):
457         (WebKit::TouchBarMenuItemData::decode):
458         (WebKit::getItemType): Deleted.
459         * Shared/TouchBarMenuItemData.h:
460         (WebKit::operator==):
461
462 2017-12-04  Brian Burg  <bburg@apple.com>
463
464         Web Automation: add flag to preserve legacy page screenshot behavior
465         https://bugs.webkit.org/show_bug.cgi?id=180313
466         <rdar://problem/34379930>
467
468         Reviewed by Joseph Pecoraro.
469
470         For compatibility with JSON Wire Protocol implemented by Safari,
471         we need to retain the ability to perform whole page contents
472         snapshots using Automation.takeScreenshot. Add an extra flag,
473         clipToViewport, which can be used by W3C-conforming drivers.
474
475         * UIProcess/Automation/Automation.json: Add new flag.
476         * UIProcess/Automation/WebAutomationSession.h:
477         * UIProcess/Automation/WebAutomationSession.cpp:
478         (WebKit::WebAutomationSession::takeScreenshot):
479         * WebProcess/Automation/WebAutomationSessionProxy.h:
480         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
481         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
482         (WebKit::snapshotRectForScreenshot):
483         (WebKit::WebAutomationSessionProxy::takeScreenshot):
484         If the flag is false, take a screenshot of the whole page contents.
485
486 2017-12-04  JF Bastien  <jfbastien@apple.com>
487
488         Update std::expected to match libc++ coding style
489         https://bugs.webkit.org/show_bug.cgi?id=180264
490
491         Reviewed by Alex Christensen.
492
493         Update various uses of Expected, mostly renaming valueOr and
494         hasValue to the STL naming convention.
495
496         * NetworkProcess/cache/CacheStorageEngine.cpp:
497         (WebKit::CacheStorage::Engine::open):
498         (WebKit::CacheStorage::Engine::retrieveCaches):
499         (WebKit::CacheStorage::Engine::retrieveRecords):
500         (WebKit::CacheStorage::Engine::putRecords):
501         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
502         (WebKit::CacheStorage::Engine::fetchEntries):
503         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
504         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
505         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
506         (WebKit::CacheStorage::Cache::updateRecordToDisk):
507         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
508         (WebKit::CacheStorage::Caches::initialize):
509         (WebKit::CacheStorage::Caches::readCachesFromDisk):
510         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
511         (WebKit::NetworkRTCProvider::createResolver):
512         * Platform/IPC/ArgumentCoders.h:
513
514 2017-12-04  Brady Eidson  <beidson@apple.com>
515
516         Get a directory path to SWServers for storing ServiceWorker registrations.
517         https://bugs.webkit.org/show_bug.cgi?id=180362
518
519         Reviewed by Chris Dumez.
520
521         This gets all of the plumbing in place for specifying a ServiceWorker registration storage path
522         in a particular WebsiteDataStore.
523
524         * Shared/Storage/StorageProcessCreationParameters.cpp:
525         (WebKit::StorageProcessCreationParameters::encode const):
526         (WebKit::StorageProcessCreationParameters::decode):
527         * Shared/Storage/StorageProcessCreationParameters.h:
528
529         * StorageProcess/StorageProcess.cpp:
530         (WebKit::StorageProcess::initializeWebsiteDataStore):
531         (WebKit::StorageProcess::swServerForSession):
532         * StorageProcess/StorageProcess.h:
533
534         * UIProcess/API/APIProcessPoolConfiguration.cpp:
535         (API::ProcessPoolConfiguration::createWithLegacyOptions):
536         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
537         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
538         * UIProcess/API/APIProcessPoolConfiguration.h:
539
540         * UIProcess/API/APIWebsiteDataStore.h:
541         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
542         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
543         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
544         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
545
546         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
547         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
548         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
549         * UIProcess/WebProcessPool.cpp:
550         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
551         * UIProcess/WebProcessPool.h:
552
553         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
554         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
555         (WebKit::WebsiteDataStore::storageProcessParameters):
556         * UIProcess/WebsiteData/WebsiteDataStore.h:
557         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
558
559         * UIProcess/gtk/WebProcessPoolGtk.cpp:
560         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
561
562         * UIProcess/wpe/WebProcessPoolWPE.cpp:
563         (WebKit::WebProcessPool::legacyPlatformDefaultServiceWorkerRegistrationDirectory):
564
565 2017-12-04  Frederic Wang  <fwang@igalia.com>
566
567         Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes
568         https://bugs.webkit.org/show_bug.cgi?id=180353
569
570         Reviewed by Antonio Gomes.
571
572         This function was introduced in bug 175135 to solve a rendering bug with fixed positioned
573         nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is
574         actually the frame node itself or otherwise we will get the same rendering bug. This patch
575         makes enclosingFrameNode return the node itself when it is a frame node and renames it to
576         clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the
577         behavior is unchanged.
578
579         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
580         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Use auto* and
581         the new function name.
582
583 2017-12-04  Michael Catanzaro  <mcatanzaro@igalia.com>
584
585         [GTK] Implement PAL::SleepDisabler
586         https://bugs.webkit.org/show_bug.cgi?id=178485
587
588         Reviewed by Carlos Garcia Campos.
589
590         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
591         (webkitWebViewBaseDispose):
592         (webkitWebViewBaseEnterFullScreen):
593         (webkitWebViewBaseExitFullScreen):
594         (screenSaverInhibitedCallback): Deleted.
595         (webkitWebViewBaseSendInhibitMessageToScreenSaver): Deleted.
596         (screenSaverProxyCreatedCallback): Deleted.
597         (webkitWebViewBaseInhibitScreenSaver): Deleted.
598         (webkitWebViewBaseUninhibitScreenSaver): Deleted.
599
600 2017-12-03  Yusuke Suzuki  <utatane.tea@gmail.com>
601
602         WTF shouldn't have both Thread and ThreadIdentifier
603         https://bugs.webkit.org/show_bug.cgi?id=180308
604
605         Reviewed by Darin Adler.
606
607         * UIProcess/API/glib/IconDatabase.cpp:
608         * UIProcess/GenericCallback.h:
609         (WebKit::GenericCallback::~GenericCallback):
610         (WebKit::GenericCallback::performCallbackWithReturnValue):
611
612 2017-12-03  Chris Dumez  <cdumez@apple.com>
613
614         Support serviceWorker.postMessage() inside service workers
615         https://bugs.webkit.org/show_bug.cgi?id=180328
616
617         Reviewed by Darin Adler.
618
619         Support serviceWorker.postMessage() inside service workers.
620
621         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
622         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromClient):
623         (WebKit::WebSWServerConnection::postMessageToServiceWorkerFromServiceWorker):
624         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
625         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
626         * WebProcess/Storage/WebSWClientConnection.cpp:
627         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
628         * WebProcess/Storage/WebSWClientConnection.h:
629         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
630         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromClient):
631         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerFromServiceWorker):
632         * WebProcess/Storage/WebSWContextManagerConnection.h:
633         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
634
635 2017-12-03  Chris Dumez  <cdumez@apple.com>
636
637         Implement self.skipWaiting() inside service workers
638         https://bugs.webkit.org/show_bug.cgi?id=180329
639
640         Reviewed by Darin Adler.
641
642         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
643         (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting):
644         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
645         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
646         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
647         (WebKit::WebSWContextManagerConnection::skipWaiting):
648         (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting):
649         * WebProcess/Storage/WebSWContextManagerConnection.h:
650         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
651
652 2017-12-02  Youenn Fablet  <youenn@apple.com>
653
654         Implement https://w3c.github.io/ServiceWorker/#clients-getall
655         https://bugs.webkit.org/show_bug.cgi?id=180276
656
657         Reviewed by Chris Dumez.
658
659         Add IPC plumbery for clients.matchAll between ServiceWorker process and Storage process.
660
661         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
662         (WebKit::WebSWServerToContextConnection::matchAllCompleted):
663         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
664         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
665         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
666         (WebKit::WebSWContextManagerConnection::matchAll):
667         (WebKit::WebSWContextManagerConnection::matchAllCompleted):
668         * WebProcess/Storage/WebSWContextManagerConnection.h:
669         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
670
671 2017-12-02  Joseph Pecoraro  <pecoraro@apple.com>
672
673         Remote Web Inspector window always shows up at the default size
674         https://bugs.webkit.org/show_bug.cgi?id=180284
675         <rdar://problem/35430255>
676
677         Reviewed by Brian Burg.
678
679         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
680         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
681         Give remote web inspector windows an autosave name so that their frame can
682         be automatically saved and restored by the system.
683
684 2017-12-02  Simon Fraser  <simon.fraser@apple.com>
685
686         Add a log channel for viewports
687         https://bugs.webkit.org/show_bug.cgi?id=180295
688
689         Reviewed by Zalan Bujtas.
690
691         Add a "Viewports" log channel to log viewport scaling information, and enhance the
692         WebKit "VisibleRects" channel to log additional data for the same reason.
693
694         * UIProcess/API/Cocoa/WKWebView.mm:
695         (-[WKWebView _didCommitLayerTree:]):
696         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
697         (-[WKWebView _dispatchSetMinimumLayoutSize:]):
698         (-[WKWebView _endAnimatedResize]):
699         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
700         * WebProcess/WebPage/WebPage.cpp:
701         (WebKit::WebPage::setFixedLayoutSize):
702         (WebKit::WebPage::mainFrameDidLayout):
703         (WebKit::WebPage::didCommitLoad):
704         * WebProcess/WebPage/ios/WebPageIOS.mm:
705         (WebKit::scaleAfterViewportWidthChange):
706         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
707         (WebKit::WebPage::dynamicViewportSizeUpdate):
708         (WebKit::WebPage::resetViewportDefaultConfiguration):
709         (WebKit::WebPage::viewportConfigurationChanged):
710         (WebKit::WebPage::updateVisibleContentRects):
711
712 2017-12-02  Carlos Garcia Campos  <cgarcia@igalia.com>
713
714         WebDriver: handle user prompts shown while executing scripts
715         https://bugs.webkit.org/show_bug.cgi?id=179979
716
717         Reviewed by Brian Burg.
718
719         * UIProcess/Automation/Automation.json: Add UnexpectedAlertOpen error.
720         * UIProcess/Automation/WebAutomationSession.cpp:
721         (WebKit::WebAutomationSession::willShowJavaScriptDialog): Finish pending evaluateJavaScriptFunction operations
722         with UnexpectedAlertOpen error.
723
724 2017-12-02  Wenson Hsieh  <wenson_hsieh@apple.com>
725
726         Make some minor adjustments to TouchBarMenuData and TouchBarMenuItemData
727         https://bugs.webkit.org/show_bug.cgi?id=180305
728
729         Reviewed by Joseph Pecoraro.
730
731         Mark some methods and parameters as const, use the default constructor in more places, and also remove a few
732         extraneous imported headers.
733
734         * Shared/TouchBarMenuData.cpp:
735         (WebKit::TouchBarMenuData::TouchBarMenuData):
736
737         Add a FIXME regarding the use of the 'id' attribute.
738
739         (WebKit::TouchBarMenuData::decode):
740         * Shared/TouchBarMenuData.h:
741         (WebKit::TouchBarMenuData::items const):
742         (WebKit::TouchBarMenuData::setID):
743         (WebKit::TouchBarMenuData::isPageCustomized const):
744         (WebKit::TouchBarMenuData::items): Deleted.
745         (WebKit::TouchBarMenuData::isPageCustomized): Deleted.
746         * Shared/TouchBarMenuItemData.cpp:
747         (WebKit::getItemType):
748
749         Change a helper method from a static class function to a static function in the implementation file.
750
751         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
752         (WebKit::TouchBarMenuItemData::encode const):
753         (WebKit::TouchBarMenuItemData::decode):
754         (WebKit::TouchBarMenuItemData::getItemType): Deleted.
755         * Shared/TouchBarMenuItemData.h:
756         (WebKit::operator==):
757
758         Remove the commandName member variable, since it doesn't make sense to propagate an event handler
759         attribute from WebCore to the client layer.
760
761         * UIProcess/WebPageProxy.messages.in:
762
763 2017-12-01  Zan Dobersek  <zdobersek@igalia.com>
764
765         Unreviewed GTK+ debug build fix. Replace ASSERT_UNUSED() with UNUSED_PARAM()
766         in WebKit::WebPage methods that used to operate on HTMLMenuElement pointer
767         values (which have been converted to references).
768
769         * WebProcess/WebPage/WebPage.cpp:
770         (WebKit::WebPage::didInsertMenuElement):
771         (WebKit::WebPage::didRemoveMenuElement):
772         (WebKit::WebPage::didInsertMenuItemElement):
773         (WebKit::WebPage::didRemoveMenuItemElement):
774
775 2017-12-01  Simon Fraser  <simon.fraser@apple.com>
776
777         Reduce the number of calls to ViewportConfiguration::updateConfiguration()
778         https://bugs.webkit.org/show_bug.cgi?id=180299
779
780         Reviewed by Zalan Bujtas.
781
782         There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading
783         with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning
784         early if the configuration hasn't changed.
785
786         Also move the fetching of ViewportConfiguration::xhtmlMobileParameters() from didReceiveMobileDocType()
787         into resetViewportDefaultConfiguration() where we grab all the other default configs.
788
789         * WebProcess/WebPage/WebPage.h:
790         * WebProcess/WebPage/ios/WebPageIOS.mm:
791         (WebKit::WebPage::didReceiveMobileDocType):
792         (WebKit::WebPage::resetViewportDefaultConfiguration):
793
794 2017-12-01  Aishwarya Nirmal  <anirmal@apple.com>
795
796         [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes
797         https://bugs.webkit.org/show_bug.cgi?id=179714
798
799         Reviewed by Wenson Hsieh.
800
801         These changes define the TouchBarMenuData and TouchBarMenuItemData objects which draw information
802         from touch bar HTMLMenuElement and HTMLMenuItemElement. These objects represent the contents of
803         the page-customized touch bar. Changes to the html elements representing the touch bar are sent 
804         to the UI process.
805
806         * Shared/TouchBarMenuData.cpp: Copied from Source/WebCore/html/HTMLMenuItemElement.cpp.
807         (WebKit::TouchBarMenuData::TouchBarMenuData):
808         (WebKit::TouchBarMenuData::addMenuItem):
809         (WebKit::TouchBarMenuData::removeMenuItem):
810         (WebKit::TouchBarMenuData::encode const):
811         (WebKit::TouchBarMenuData::decode):
812         * Shared/TouchBarMenuData.h: Copied from Source/WebCore/html/HTMLMenuItemElement.h.
813         (WebKit::TouchBarMenuData::items):
814         (WebKit::TouchBarMenuData::isPageCustomized):
815         (WebKit::TouchBarMenuData::setIsPageCustomized):
816         * Shared/TouchBarMenuItemData.cpp: Added.
817         (WebKit::TouchBarMenuItemData::getItemType):
818         (WebKit::TouchBarMenuItemData::TouchBarMenuItemData):
819         (WebKit::TouchBarMenuItemData::encode const):
820         (WebKit::TouchBarMenuItemData::decode):
821         * Shared/TouchBarMenuItemData.h: Added.
822         (WebKit::operator<):
823         (WebKit::operator>):
824         (WebKit::operator<=):
825         (WebKit::operator>=):
826         (WebKit::operator==):
827         (WebKit::operator!=):
828         * UIProcess/WebPageProxy.cpp:
829         (WebKit::WebPageProxy::touchBarMenuDataChanged):
830         (WebKit::WebPageProxy::touchBarMenuItemDataAdded):
831         (WebKit::WebPageProxy::touchBarMenuItemDataRemoved):
832         * UIProcess/WebPageProxy.h:
833         (WebKit::WebPageProxy::touchBarMenuData const):
834         * UIProcess/WebPageProxy.messages.in:
835         * WebKit.xcodeproj/project.pbxproj:
836         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
837         (WebKit::WebChromeClient::didInsertMenuElement):
838         (WebKit::WebChromeClient::didRemoveMenuElement):
839         (WebKit::WebChromeClient::didInsertMenuItemElement):
840         (WebKit::WebChromeClient::didRemoveMenuItemElement):
841         * WebProcess/WebCoreSupport/WebChromeClient.h:
842         * WebProcess/WebPage/WebPage.cpp:
843         (WebKit::WebPage::didInsertMenuElement):
844         (WebKit::WebPage::didRemoveMenuElement):
845         (WebKit::WebPage::didInsertMenuItemElement):
846         (WebKit::WebPage::didRemoveMenuItemElement):
847         (WebKit::WebPage::sendTouchBarMenuDataRemovedUpdate):
848         (WebKit::WebPage::sendTouchBarMenuDataAddedUpdate):
849         (WebKit::WebPage::sendTouchBarMenuItemDataAddedUpdate):
850         (WebKit::WebPage::sendTouchBarMenuItemDataRemovedUpdate):
851         * WebProcess/WebPage/WebPage.h:
852
853 2017-12-01  Daniel Bates  <dabates@apple.com>
854
855         Alternative Presentation Button: Provide a way to query for the replaced elements
856         https://bugs.webkit.org/show_bug.cgi?id=180114
857         <rdar://problem/35710539>
858
859         Reviewed by Tim Horton.
860
861         Add SPI to query for the elements that were replaced by an Alternative Presentation Button.
862
863         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
864         (-[WKWebProcessPlugInFrame elementsReplacedByAlternativePresentationButtonWithIdentifier:]): Added.
865         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
866         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
867         (WKBundleElementsReplacedByAlternativePresentationButton): Added.
868         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
869
870 2017-12-01  Youenn Fablet  <youenn@apple.com>
871
872         Implement https://w3c.github.io/ServiceWorker/#clients-get
873         https://bugs.webkit.org/show_bug.cgi?id=180167
874
875         Reviewed by Chris Dumez.
876
877         Add IPC plumbery for clientFromId between ServiceWorker process and Storage process.
878
879         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
880         (WebKit::WebSWServerToContextConnection::clientFromIdCompleted):
881         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
882         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
883         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
884         (WebKit::WebSWContextManagerConnection::findClientByIdentifier):
885         (WebKit::WebSWContextManagerConnection::findClientByIdentifierCompleted):
886         * WebProcess/Storage/WebSWContextManagerConnection.h:
887         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
888
889 2017-12-01  Brian Burg  <bburg@apple.com>
890
891         Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
892         https://bugs.webkit.org/show_bug.cgi?id=173662
893
894         Reviewed by Joseph Pecoraro.
895
896         Adopt new type names.
897
898         * UIProcess/Automation/WebAutomationSession.cpp:
899         (WebKit::WebAutomationSession::getNextContext):
900         (WebKit::WebAutomationSession::getBrowsingContexts):
901         (WebKit::buildArrayForCookies):
902         (WebKit::WebAutomationSession::getSessionPermissions):
903         * UIProcess/Automation/WebAutomationSession.h:
904
905 2017-12-01  Wenson Hsieh  <wenson_hsieh@apple.com>
906
907         [Attachment Support] Implement SPI for clients to update a given attachment's data
908         https://bugs.webkit.org/show_bug.cgi?id=180184
909         <rdar://problem/35355731>
910
911         Reviewed by Tim Horton.
912
913         Add plumbing to the web process for setting the attachment data (and optionally, the content type and/or file
914         name) of a given attachment. See WebCore ChangeLog for more detail. Changes covered by new API tests.
915
916         * UIProcess/API/APIAttachment.cpp:
917         (API::Attachment::setDataAndContentType):
918         * UIProcess/API/APIAttachment.h:
919         * UIProcess/API/Cocoa/_WKAttachment.h:
920
921         Add nullability annotations around _WKAttachment SPI methods.
922
923         * UIProcess/API/Cocoa/_WKAttachment.mm:
924         (-[_WKAttachment setData:newContentType:newFilename:completion:]):
925         * UIProcess/WebPageProxy.cpp:
926         (WebKit::WebPageProxy::setAttachmentDataAndContentType):
927         * UIProcess/WebPageProxy.h:
928         * WebProcess/WebPage/WebPage.cpp:
929         (WebKit::WebPage::setAttachmentDataAndContentType):
930         * WebProcess/WebPage/WebPage.h:
931         * WebProcess/WebPage/WebPage.messages.in:
932
933 2017-12-01  Brady Eidson  <beidson@apple.com>
934
935         Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage.
936         https://bugs.webkit.org/show_bug.cgi?id=180170
937
938         Reviewed by Chris Dumez.
939
940         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
941         (WebKit::WebSWServerConnection::startFetch):
942         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
943         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
944         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
945
946         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
947         (WebKit::WebSWServerToContextConnection::syncTerminateWorker):
948         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
949
950         * StorageProcess/StorageToWebProcessConnection.cpp:
951         (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
952
953         * WebProcess/Storage/WebSWClientConnection.cpp:
954         (WebKit::WebSWClientConnection::syncTerminateWorker):
955         * WebProcess/Storage/WebSWClientConnection.h:
956
957         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
958         (WebKit::WebSWContextManagerConnection::terminateWorker):
959         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
960         * WebProcess/Storage/WebSWContextManagerConnection.h:
961         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
962
963         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
964         (WebKit::WebToStorageProcessConnection::didReceiveSyncMessage):
965         * WebProcess/Storage/WebToStorageProcessConnection.h:
966
967 2017-12-01  Youenn Fablet  <youenn@apple.com>
968
969         Clear WebSWClientConnection in case storage process IPC connection is closing
970         https://bugs.webkit.org/show_bug.cgi?id=180210
971
972         Reviewed by Chris Dumez.
973
974         Clear the sw connection maps when connection is closing.
975         Call related completion handlers for each connection.
976
977         * WebProcess/Storage/WebSWClientConnection.cpp:
978         (WebKit::WebSWClientConnection::connectionToServerLost):
979         * WebProcess/Storage/WebSWClientConnection.h:
980         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
981         (WebKit::WebToStorageProcessConnection::didClose):
982         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
983         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
984         * WebProcess/Storage/WebToStorageProcessConnection.h:
985
986 2017-12-01  Eric Carlson  <eric.carlson@apple.com>
987
988         [MediaStream] Use CaptureDevice instead of device ID to identify devices
989         https://bugs.webkit.org/show_bug.cgi?id=180206
990         <rdar://problem/35775758>
991
992         Reviewed by Youenn Fablet.
993
994         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
995         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
996         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
997         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
998         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
999         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1000         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
1001         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1002         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1003         * UIProcess/UserMediaPermissionRequestProxy.cpp:
1004         (WebKit::UserMediaPermissionRequestProxy::allow):
1005         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1006         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
1007         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1008         * WebProcess/WebPage/WebPage.cpp:
1009         (WebKit::WebPage::userMediaAccessWasGranted):
1010         * WebProcess/WebPage/WebPage.h:
1011         * WebProcess/WebPage/WebPage.messages.in:
1012         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1013         (WebKit::UserMediaCaptureManager::createCaptureSource):
1014         * WebProcess/cocoa/UserMediaCaptureManager.h:
1015
1016 2017-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1017
1018         WebDriver: link and partial links queries don't work in xhtml documents
1019         https://bugs.webkit.org/show_bug.cgi?id=180191
1020
1021         Reviewed by Brian Burg.
1022
1023         We convert the queries to use xpath, which works for html documents, but it doesn't work for xhtml. In case of
1024         xhtml we would need to provide a namespace resolver and elements would need to be prefixed with 'xhtml:'. It's
1025         easier to simply iterate the link elements and compare the text.
1026
1027         Fixes: imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[link text-full link text]
1028                imported/w3c/webdriver/tests/retrieval/find_element_from_element.py::test_xhtml_namespace[partial link text-link text]
1029                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[link text-full link text]
1030                imported/w3c/webdriver/tests/retrieval/find_element_from_elements.py::test_xhtml_namespace[partial link text-link text]
1031                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[link text-full link text]
1032                imported/w3c/webdriver/tests/retrieval/find_element.py::test_xhtml_namespace[partial link text-link text]
1033                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[link text-full link text]
1034                imported/w3c/webdriver/tests/retrieval/find_elements.py::test_xhtml_namespace[partial link text-link text]
1035
1036         * UIProcess/Automation/atoms/FindNodes.js:
1037         (switch):
1038         (tryToFindNode):
1039
1040 2017-11-30  Alex Christensen  <achristensen@webkit.org>
1041
1042         REGRESSION (r224791): cookies are shared between ephemeral sessions in the same process pool
1043         https://bugs.webkit.org/show_bug.cgi?id=180235
1044
1045         Reviewed by Joseph Pecoraro.
1046
1047         In r224791 I assumed that uiProcessCookieStorageIdentifier would be empty in the ephemeral session initialization message.
1048         This is not the case.  We did not catch this because almost all of our ephemeral session testing uses the legacyPrivateSessionID.
1049         I add checks for if the SessionID is ephemeral like we already have in WebFrameNetworkingContext::ensureWebsiteDataStoreSession.
1050         I also add an API test that makes sure cookies are not shared between ephemeral sessions the way they are made through the API.
1051
1052         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1053         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1054
1055 2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>
1056
1057         Make LegacyCustomProtocolManager optional for network process
1058         https://bugs.webkit.org/show_bug.cgi?id=176230
1059
1060         Reviewed by Alex Christensen.
1061
1062         * CMakeLists.txt:
1063         * Configurations/FeatureDefines.xcconfig:
1064         * NetworkProcess/NetworkProcess.cpp:
1065         (WebKit::NetworkProcess::NetworkProcess):
1066         (WebKit::NetworkProcess::initializeNetworkProcess):
1067         * PlatformGTK.cmake:
1068         * PlatformMac.cmake:
1069         * PlatformWPE.cmake:
1070         * UIProcess/Network/NetworkProcessProxy.cpp:
1071         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
1072         (WebKit::NetworkProcessProxy::didClose):
1073         * UIProcess/Network/NetworkProcessProxy.h:
1074         * UIProcess/WebProcessPool.cpp:
1075         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
1076         (WebKit::WebProcessPool::registerSchemeForCustomProtocol):
1077         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
1078
1079 2017-11-30  Ryan Haddad  <ryanhaddad@apple.com>
1080
1081         Unreviewed build fix, suppress deprecation warnings.
1082
1083         * Shared/mac/SandboxExtensionMac.mm:
1084         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
1085
1086 2017-11-30  Daniel Bates  <dabates@apple.com>
1087
1088         Expose SPI didClickAlternativePresentationButtonWithUserInfo on iOS
1089         https://bugs.webkit.org/show_bug.cgi?id=180218
1090         <rdar://problem/35782555>
1091
1092         Reviewed by Alex Christensen.
1093
1094         We want to support the SPI didClickAlternativePresentationButtonWithUserInfo on Cocoa platforms.
1095
1096         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1097         * UIProcess/Cocoa/UIDelegate.h:
1098         * UIProcess/Cocoa/UIDelegate.mm:
1099         (WebKit::UIDelegate::setDelegate):
1100         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton):
1101
1102 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
1103
1104         [Cocoa] Web Automation: _WKAutomationSessionConfiguration leak
1105         https://bugs.webkit.org/show_bug.cgi?id=180222
1106
1107         Reviewed by Brian Burg.
1108
1109         * UIProcess/Cocoa/AutomationClient.mm:
1110         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
1111
1112 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
1113
1114         Fix some NSOperationQueue leaks
1115         https://bugs.webkit.org/show_bug.cgi?id=180221
1116
1117         Reviewed by Wenson Hsieh.
1118
1119         * UIProcess/Cocoa/WebViewImpl.mm:
1120         (WebKit::WebViewImpl::performDragOperation):
1121
1122 2017-11-30  Brian Burg  <bburg@apple.com>
1123
1124         Web Automation: computeElementLayout does not correctly translate iframe client coordinates to main frame coordinates
1125         https://bugs.webkit.org/show_bug.cgi?id=180213
1126         <rdar://problem/30260141>
1127
1128         Reviewed by Simon Fraser.
1129
1130         The current implementation computes points in terms of the frame in which the element is located.
1131         However, WebDriver expects coordinates to be relative to the top-level document since
1132         these coordinates are used for generating click events, among other things.
1133
1134         To convert from frame client coordinates to main frame client coordinates, round-trip
1135         both inViewCenterPoint and elementBounds to root view coordinates and back
1136         to the main frame's contents/client coordinates. Then convert this to page coordinates if needed.
1137
1138         This progresses several tests in the Selenium Python test suite:
1139
1140          - event_firing_webdriver_tests.py::test_should_fire_navigation_events
1141          - frame_switching_tests.py::testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation
1142          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs
1143          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex
1144          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement
1145          - frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs
1146          - position_and_size_tests.py::testShouldGetCoordinatesOfAnInvisibleElement
1147
1148         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1149         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1150         Get both the frame and main frame FrameViews and convert coordinates to the root view.
1151         This is somewhat lossy as clientToDocument* deals with FloatPoints but contentsToRootView
1152         deals with IntPoints. For the purposes of WebDriver, lossiness is not a problem since
1153         integer values are expected anyway.
1154
1155         The imperative nature of the coordinate calculations is difficult to debug, so I converted
1156         this function to only assign to each variable once.
1157
1158 2017-11-30  Alex Christensen  <achristensen@webkit.org>
1159
1160         WKURLSchemeHandler.request should include HTTPBody
1161         https://bugs.webkit.org/show_bug.cgi?id=180220
1162
1163         Reviewed by Brady Eidson.
1164
1165         * Shared/URLSchemeTaskParameters.cpp: Added.
1166         (WebKit::URLSchemeTaskParameters::encode const):
1167         (WebKit::URLSchemeTaskParameters::decode):
1168         * Shared/URLSchemeTaskParameters.h: Added.
1169         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
1170         (-[WKURLSchemeTaskImpl request]):
1171         * UIProcess/WebPageProxy.cpp:
1172         (WebKit::WebPageProxy::startURLSchemeTask):
1173         * UIProcess/WebPageProxy.h:
1174         * UIProcess/WebPageProxy.messages.in:
1175         * UIProcess/WebURLSchemeHandler.cpp:
1176         (WebKit::WebURLSchemeHandler::startTask):
1177         * UIProcess/WebURLSchemeHandler.h:
1178         * UIProcess/WebURLSchemeTask.cpp:
1179         (WebKit::WebURLSchemeTask::create):
1180         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
1181         * UIProcess/WebURLSchemeTask.h:
1182         * WebKit.xcodeproj/project.pbxproj:
1183         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1184         (WebKit::WebURLSchemeTaskProxy::startLoading):
1185
1186 2017-11-30  Darin Adler  <darin@apple.com>
1187
1188         [Mac] remove unneeded RetainPtr use introduced in r225142
1189         https://bugs.webkit.org/show_bug.cgi?id=180202
1190
1191         Reviewed by Tim Horton.
1192
1193         * WebProcess/Plugins/PDF/PDFPlugin.h: Got rid of unnecessary RetainPtr.
1194         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1195         (WebKit::PDFPlugin::lookupTextAtLocation const): Ditto.
1196         * WebProcess/WebPage/WebPage.h: Ditto.
1197         * WebProcess/WebPage/mac/WebPageMac.mm:
1198         (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto.
1199         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
1200         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Ditto.
1201         (WebKit::WebPage::lookupTextAtLocation): Ditto.
1202
1203 2017-11-30  Zan Dobersek  <zdobersek@igalia.com>
1204
1205         [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine
1206         https://bugs.webkit.org/show_bug.cgi?id=180141
1207
1208         Reviewed by Carlos Garcia Campos.
1209
1210         CompositingCoordinator must implement the paintingEngine() method now
1211         that the method's been added to the CoordinatedGraphicsLayerClient
1212         interface. The CompositingCoordinator manages the Nicosia::PaintingEngine
1213         object through the new m_paintingEngine member variable, and returns the
1214         reference to this object in the paintingEngine() method.
1215
1216         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1217         (WebKit::CompositingCoordinator::CompositingCoordinator):
1218         (WebKit::CompositingCoordinator::paintingEngine):
1219         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1220         Drop unnecessary typedefs.
1221
1222 2017-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1223
1224         [Attachment Support] Implement SPI for clients to make an attachment element display in-place
1225         https://bugs.webkit.org/show_bug.cgi?id=180153
1226         <rdar://problem/35735252>
1227
1228         Reviewed by Tim Horton.
1229
1230         Add new WebKit SPI, -[_WKAttachment setDisplayOptions:completion:], and add plumbing for attachment display
1231         options to the web content process. Changes covered by 4 new API tests.
1232
1233         * Scripts/webkit/messages.py:
1234         (headers_for_type):
1235         * UIProcess/API/APIAttachment.cpp:
1236         (API::Attachment::setDisplayOptions):
1237         * UIProcess/API/APIAttachment.h:
1238         * UIProcess/API/Cocoa/WKWebView.mm:
1239         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
1240
1241         Respect given display options when inserting a new attachment.
1242
1243         * UIProcess/API/Cocoa/_WKAttachment.h:
1244         * UIProcess/API/Cocoa/_WKAttachment.mm:
1245         (-[_WKAttachmentDisplayOptions coreDisplayOptions]):
1246
1247         Introduce a helper to convert from the Cocoa _WKAttachmentDisplayOptions object to platform-agnostic
1248         AttachmentDisplayOptions.
1249
1250         (-[_WKAttachment setDisplayOptions:completion:]):
1251         (WebKit::if): Deleted.
1252         * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
1253         * UIProcess/WebPageProxy.cpp:
1254         (WebKit::WebPageProxy::insertAttachment):
1255         (WebKit::WebPageProxy::setAttachmentDisplayOptions):
1256         * UIProcess/WebPageProxy.h:
1257         * WebProcess/WebPage/WebPage.cpp:
1258         (WebKit::WebPage::insertAttachment):
1259         (WebKit::WebPage::requestAttachmentData):
1260         (WebKit::WebPage::setAttachmentDisplayOptions):
1261         (WebKit::WebPage::attachmentElementWithIdentifier const):
1262
1263         Pull common logic to retrieve an attachment element matching a given identifier out into a helper.
1264
1265         * WebProcess/WebPage/WebPage.h:
1266         * WebProcess/WebPage/WebPage.messages.in:
1267
1268 2017-11-29  Brent Fulgham  <bfulgham@apple.com>
1269
1270         Part 2: Adopt updated NSKeyed[Un]Archiver API when available
1271         https://bugs.webkit.org/show_bug.cgi?id=180127
1272         <rdar://problem/35710738>
1273
1274         Reviewed by Simon Fraser.
1275
1276         The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
1277         to the modern API. Use the original API for macOS builds prior to 10.12.
1278
1279         * Shared/Cocoa/DataDetectionResult.mm:
1280         (WebKit::DataDetectionResult::encode const):
1281         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1282         (IPC::ArgumentCoder<WebCore::Payment>::encode):
1283         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
1284         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
1285         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
1286         * Shared/ios/InteractionInformationAtPosition.mm:
1287         (WebKit::InteractionInformationAtPosition::encode const):
1288         * Shared/mac/WebCoreArgumentCodersMac.mm:
1289         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1290         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1291         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
1292         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
1293         * Shared/mac/WebHitTestResultData.mm:
1294         (WebKit::WebHitTestResultData::platformEncode const):
1295         * UIProcess/API/Cocoa/WKProcessPool.mm:
1296         (-[WKProcessPool _setObject:forBundleParameter:]):
1297         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
1298         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1299         (WebKit::WebProcessPool::platformInitializeWebProcess):
1300         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1301         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1302
1303 2017-11-29  Brady Eidson  <beidson@apple.com>
1304
1305         When managing context startups, make ServiceWorkerJobDataIdentifier's optional.
1306         https://bugs.webkit.org/show_bug.cgi?id=180166
1307
1308         Reviewed by Chris Dumez.
1309
1310         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1311
1312         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1313         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1314         (WebKit::WebSWContextManagerConnection::didFinishInstall):
1315         * WebProcess/Storage/WebSWContextManagerConnection.h:
1316
1317 2017-11-29  Youenn Fablet  <youenn@apple.com>
1318
1319         Add support for service worker generated redirections
1320         https://bugs.webkit.org/show_bug.cgi?id=179498
1321
1322         Reviewed by Darin Adler.
1323
1324         Small refactoring to allow a service worker redirected fetch to follow the redirection through the service worker.
1325
1326         * WebProcess/Network/WebLoaderStrategy.cpp:
1327         (WebKit::WebLoaderStrategy::scheduleLoad): Make use of the loader request in case a network load is needed after a service worker redirection.
1328         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1329         (WebKit::ServiceWorkerClientFetch::create):
1330         (WebKit::ServiceWorkerClientFetch::~ServiceWorkerClientFetch):
1331         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
1332         (WebKit::ServiceWorkerClientFetch::start):
1333         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Check for response.
1334         Generate redirected request if needed and call loader callback to process the redirection.
1335         Adding some states so that if didFinish is called before the willSendRequest callback, redirection is followed.
1336         (WebKit::ServiceWorkerClientFetch::didFinish):
1337         In case redirection should be followed, wait for didFinish to follow it.
1338         This simplifies the model although introducing some limited latency.
1339         * WebProcess/Storage/ServiceWorkerClientFetch.h:
1340         * WebProcess/Storage/WebSWClientConnection.cpp:
1341         (WebKit::WebSWClientConnection::startFetch):
1342         * WebProcess/Storage/WebSWClientConnection.h:
1343         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1344         (WebKit::WebServiceWorkerProvider::handleFetch):
1345
1346 2017-11-29  Youenn Fablet  <youenn@apple.com>
1347
1348         Add support for FetchEvent.clientId
1349         https://bugs.webkit.org/show_bug.cgi?id=180052
1350
1351         Reviewed by Chris Dumez.
1352
1353         Using FetchOption persistency coders for cache API and modernizing IPC FetchOptions decoding.
1354
1355         * WebKit/Shared/WebCoreArgumentCoders.cpp:
1356         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1357         (WebKit::CacheStorage::Cache::encode):
1358         (WebKit::CacheStorage::Cache::decodeRecordHeader):
1359         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1360         (WebKit::WebSWContextManagerConnection::startFetch):
1361         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1362         (WebKit::WebSWContextManagerConnection::startFetch):
1363
1364 2017-11-29  Alex Christensen  <achristensen@webkit.org>
1365
1366         Make WebFrameLoaderClient more robust against null pointer dereferencing
1367         https://bugs.webkit.org/show_bug.cgi?id=180157
1368         <rdar://problem/34895616>
1369
1370         Reviewed by Tim Horton.
1371
1372         There has always been rare null pointer crashes in this code, but they have become more common
1373         now that we are waiting for completion handlers for redirects, which makes it more likely that
1374         we are hitting this code after we have detached from the core frame.
1375
1376         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1377         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1378         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1379         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1380         * WebProcess/WebPage/WebFrame.cpp:
1381         (WebKit::WebFrame::page const):
1382
1383 2017-11-29  Alex Christensen  <achristensen@webkit.org>
1384
1385         Fix Mac CMake build.
1386
1387         * PlatformMac.cmake:
1388
1389 2017-11-29  Chris Dumez  <cdumez@apple.com>
1390
1391         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection
1392         https://bugs.webkit.org/show_bug.cgi?id=180147
1393
1394         Reviewed by Brady Eidson.
1395
1396         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection.
1397         Otherwise, we have with 2 IPC::Connections between the StorageProcess and the ServiceWorker (aka Context) process,
1398         which makes synchronization of IPC messages difficult.
1399
1400         * StorageProcess/StorageProcess.cpp:
1401         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1402         (WebKit::StorageProcess::createServerToContextConnection):
1403         * StorageProcess/StorageProcess.h:
1404         * StorageProcess/StorageProcess.messages.in:
1405         * StorageProcess/StorageToWebProcessConnection.cpp:
1406         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
1407         * UIProcess/ServiceWorkerProcessProxy.cpp:
1408         (WebKit::ServiceWorkerProcessProxy::start):
1409         * UIProcess/ServiceWorkerProcessProxy.h:
1410         * UIProcess/Storage/StorageProcessProxy.cpp:
1411         (WebKit::StorageProcessProxy::getStorageProcessConnection):
1412         (WebKit::StorageProcessProxy::didFinishLaunching):
1413         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
1414         * UIProcess/Storage/StorageProcessProxy.h:
1415         * UIProcess/Storage/StorageProcessProxy.messages.in:
1416         * UIProcess/WebProcessPool.cpp:
1417         (WebKit::WebProcessPool::getStorageProcessConnection):
1418         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1419         * UIProcess/WebProcessPool.h:
1420         * UIProcess/WebProcessProxy.cpp:
1421         (WebKit::WebProcessProxy::getStorageProcessConnection):
1422         * UIProcess/WebProcessProxy.h:
1423         (WebKit::WebProcessProxy::isServiceWorkerProcess const):
1424         * UIProcess/WebProcessProxy.messages.in:
1425         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1426         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1427         * WebProcess/WebProcess.cpp:
1428         (WebKit::WebProcess::didReceiveMessage):
1429         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
1430         * WebProcess/WebProcess.h:
1431         * WebProcess/WebProcess.messages.in:
1432
1433 2017-11-29  Chris Dumez  <cdumez@apple.com>
1434
1435         ensure*Connection() methods on WebProcess should return a reference
1436         https://bugs.webkit.org/show_bug.cgi?id=180149
1437
1438         Reviewed by Alex Christensen.
1439
1440         ensure*Connection() methods on WebProcess should return a reference instead of not returning
1441         anything. Also get rid of the non-ensure variants which called "ensure" internally and are
1442         no longer needed.
1443
1444         * Shared/mac/CookieStorageShim.mm:
1445         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
1446         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1447         (WebKit::WebCacheStorageConnection::connection):
1448         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1449         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
1450         (WebKit::preregisterSandboxExtensionsIfNecessary):
1451         * WebProcess/Databases/WebDatabaseProvider.cpp:
1452         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
1453         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1454         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1455         (WebKit::BlobRegistryProxy::registerBlobURL):
1456         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
1457         (WebKit::BlobRegistryProxy::unregisterBlobURL):
1458         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
1459         (WebKit::BlobRegistryProxy::blobSize):
1460         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
1461         * WebProcess/Network/NetworkProcessConnection.cpp:
1462         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
1463         * WebProcess/Network/WebLoaderStrategy.cpp:
1464         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1465         (WebKit::WebLoaderStrategy::remove):
1466         (WebKit::WebLoaderStrategy::setDefersLoading):
1467         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1468         (WebKit::WebLoaderStrategy::startPingLoad):
1469         (WebKit::WebLoaderStrategy::preconnectTo):
1470         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1471         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
1472         * WebProcess/Network/WebResourceLoader.cpp:
1473         (WebKit::WebResourceLoader::messageSenderConnection):
1474         * WebProcess/Network/WebSocketStream.cpp:
1475         (WebKit::WebSocketStream::WebSocketStream):
1476         (WebKit::WebSocketStream::messageSenderConnection):
1477         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
1478         (WebKit::sendOnMainThread):
1479         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1480         (WebKit::sendOnMainThread):
1481         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
1482         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
1483         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
1484         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
1485         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
1486         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
1487         (WebKit::sendOnMainThread):
1488         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1489         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
1490         (WebKit::WebServiceWorkerProvider::handleFetch):
1491         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1492         (WebKit::WebPlatformStrategies::cookiesForDOM):
1493         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
1494         (WebKit::WebPlatformStrategies::cookiesEnabled):
1495         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1496         (WebKit::WebPlatformStrategies::getRawCookies):
1497         (WebKit::WebPlatformStrategies::deleteCookie):
1498         * WebProcess/WebPage/WebFrame.cpp:
1499         (WebKit::WebFrame::startDownload):
1500         (WebKit::WebFrame::convertMainResourceLoadToDownload):
1501         * WebProcess/WebProcess.cpp:
1502         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
1503         (WebKit::WebProcess::ensureNetworkProcessConnection):
1504         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
1505         (WebKit::WebProcess::prefetchDNS):
1506         * WebProcess/WebProcess.h:
1507
1508 2017-11-29  Alex Christensen  <achristensen@webkit.org>
1509
1510         Modernize API::SerializedScriptValue
1511         https://bugs.webkit.org/show_bug.cgi?id=180115
1512
1513         Reviewed by Brady Eidson.
1514
1515         Also remove some SPI that hasn't been used anywhere since Mountain Lion.
1516
1517         * Shared/API/APISerializedScriptValue.h:
1518         (API::SerializedScriptValue::create):
1519         (API::SerializedScriptValue::internalRepresentation):
1520         (API::SerializedScriptValue::SerializedScriptValue):
1521         * Shared/API/c/WKSerializedScriptValue.cpp:
1522         (WKSerializedScriptValueDeserialize):
1523         (WKSerializedScriptValueCreateWithInternalRepresentation): Deleted.
1524         (WKSerializedScriptValueGetInternalRepresentation): Deleted.
1525         * Shared/API/c/WKSerializedScriptValuePrivate.h: Removed.
1526         * UIProcess/API/Cocoa/WKWebView.mm:
1527         (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):
1528         * WebKit.xcodeproj/project.pbxproj:
1529
1530 2017-11-29  Michael Catanzaro  <mcatanzaro@igalia.com>
1531
1532         REGRESSION(r218064): [GTK] Broke entering fullscreen mode in debug builds
1533         https://bugs.webkit.org/show_bug.cgi?id=180120
1534
1535         Reviewed by Carlos Garcia Campos.
1536
1537         These assertions need to be swapped. Fixes /webkit2/WebKitWebView/fullscreen in debug mode.
1538
1539         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1540         (webkitWebViewBaseEnterFullScreen):
1541         (webkitWebViewBaseExitFullScreen):
1542
1543 2017-11-29  Zan Dobersek  <zdobersek@igalia.com>
1544
1545         [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer
1546         https://bugs.webkit.org/show_bug.cgi?id=180135
1547
1548         Reviewed by Carlos Garcia Campos.
1549
1550         Adjust code to the CoordinatedBuffer -> Nicosia::Buffer transition.
1551
1552         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1553         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
1554         (WebKit::CoordinatedBackingStore::updateTile):
1555         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1556         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1557         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
1558         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1559         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1560         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1561         (WebKit::CompositingCoordinator::updateImageBacking):
1562         (WebKit::CompositingCoordinator::createUpdateAtlas):
1563         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
1564         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1565         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1566         (WebKit::UpdateAtlas::UpdateAtlas):
1567         (WebKit::UpdateAtlas::getCoordinatedBuffer):
1568         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1569
1570 2017-11-28  Brent Fulgham  <bfulgham@apple.com>
1571
1572         Adopt updated NSKeyed[Un]Archiver API when available
1573         https://bugs.webkit.org/show_bug.cgi?id=180127
1574         <rdar://problem/35710738>
1575
1576         Reviewed by Alex Christensen.
1577
1578         Switch to new NSKeyed[Un]Archiver methods when available. We do not attempt
1579         to adopt secure coding in places we were not under the original API.
1580
1581         * Platform/ios/AccessibilityIOS.mm:
1582         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
1583         * Shared/Cocoa/DataDetectionResult.mm:
1584         (WebKit::DataDetectionResult::encode const): Ditto.
1585         (WebKit::DataDetectionResult::decode): Ditto.
1586         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1587         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
1588         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
1589         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
1590         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
1591         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
1592         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
1593         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
1594         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
1595         * Shared/ios/InteractionInformationAtPosition.mm:
1596         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
1597         (WebKit::InteractionInformationAtPosition::decode): Ditto.
1598         * Shared/mac/WebCoreArgumentCodersMac.mm:
1599         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
1600         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
1601         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
1602         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
1603         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
1604         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
1605         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
1606         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
1607         * Shared/mac/WebHitTestResultData.mm:
1608         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
1609         (WebKit::WebHitTestResultData::platformDecode): Ditto.
1610         * UIProcess/API/Cocoa/WKProcessPool.mm:
1611         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
1612         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
1613         * UIProcess/API/Cocoa/WKWebView.mm:
1614         (-[WKWebView _setInputDelegate:]): Ditto.
1615         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1616         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
1617         * UIProcess/ios/PageClientImplIOS.mm:
1618         (WebKit::PageClientImpl::startAssistingNode): Ditto.
1619         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1620         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
1621         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1622         (WebKit::InjectedBundle::initialize): Ditto.
1623         (WebKit::InjectedBundle::setBundleParameter): Ditto.
1624         (WebKit::InjectedBundle::setBundleParameters): Ditto.
1625
1626 2017-11-28  Youenn Fablet  <youenn@apple.com>
1627
1628         NetworkCache::Storage should protect itself when removing operations from its maps
1629         https://bugs.webkit.org/show_bug.cgi?id=180118
1630
1631         Reviewed by Antti Koivisto.
1632
1633         The operations can contain ref to the Storage object and removing them from the map may destroy the Storage object
1634
1635         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1636         (WebKit::NetworkCache::Storage::remove):
1637         (WebKit::NetworkCache::Storage::finishReadOperation):
1638         (WebKit::NetworkCache::Storage::finishWriteOperation):
1639         (WebKit::NetworkCache::Storage::traverse):
1640
1641 2017-11-28  Youenn Fablet  <youenn@apple.com>
1642
1643         Register Documents as ServiceWorker clients to the StorageProcess
1644         https://bugs.webkit.org/show_bug.cgi?id=180047
1645
1646         Reviewed by Brady Eidson.
1647
1648         Adding IPC to register/unregister clients to the storage process.
1649         This will be used to enable service worker termination, and implementation of Clients API.
1650
1651         WebSWServerConnection keeps a hash map of all its related clients.
1652         This allows unregistering these clients if the corresponding web process crashes.
1653
1654         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1655         (WebKit::WebSWServerConnection::~WebSWServerConnection):
1656         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1657         (WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
1658         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1659         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1660         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1661         * WebProcess/Storage/WebSWClientConnection.cpp:
1662         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1663         (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
1664         * WebProcess/Storage/WebSWClientConnection.h:
1665
1666 2017-11-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1667
1668         [CG] PostScript images should be supported if they are sub-resource images
1669         https://bugs.webkit.org/show_bug.cgi?id=178502
1670         <rdar://problem/35102988>
1671
1672         Reviewed by Simon Fraser.
1673
1674         Make convertPostScriptDataToPDF() be as static function of PDFDocumentImage
1675         in WebCore.
1676
1677         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1678         (WebKit::PDFPlugin::convertPostScriptDataIfNeeded):
1679         (WebKit::convertPostScriptDataToPDF): Deleted.
1680
1681 2017-11-28  Alex Christensen  <achristensen@webkit.org>
1682
1683         Add SPI for adding strings directly to a _WKVisitedLinkStore
1684         https://bugs.webkit.org/show_bug.cgi?id=180100
1685
1686         Reviewed by Geoffrey Garen.
1687
1688         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1689         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
1690         (-[_WKVisitedLinkStore addVisitedLinkWithString:]):
1691         This is a performance optimization for rdar://problem/16321391
1692
1693 2017-11-28  Joseph Pecoraro  <pecoraro@apple.com>
1694
1695         REGRESSION: Web Inspector: context menu actions "Download Image" and "Open Image in New Window" don't work
1696         https://bugs.webkit.org/show_bug.cgi?id=178808
1697         <rdar://problem/35176608>
1698
1699         Reviewed by Brian Burg.
1700
1701         * UIProcess/mac/WKInspectorViewController.mm:
1702         (-[WKInspectorViewController _webView:contextMenu:forElement:]):
1703         Continue to hide the image context menu actions like we used to.
1704         Investigating making these context menus work can be done as a
1705         follow-up task.
1706
1707         * UIProcess/mac/WKWebInspectorWKWebView.mm:
1708         (-[WKWebInspectorWKWebView initWithFrame:configuration:]):
1709         Use nullptr instead of 0.
1710
1711 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1712
1713         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
1714         https://bugs.webkit.org/show_bug.cgi?id=173793
1715
1716         Reviewed by Joseph Pecocaro.
1717
1718         Based on patch by Brian Burg.
1719
1720         * UIProcess/Automation/WebAutomationSession.cpp:
1721         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1722         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1723         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
1724         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
1725         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
1726         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
1727         (WebKit::WebAutomationSession::navigationOccurredForFrame):
1728         (WebKit::WebAutomationSession::documentLoadedForFrame):
1729         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
1730         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
1731         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1732         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
1733         (WebKit::WebAutomationSession::addSingleCookie):
1734         (WebKit::WebAutomationSession::setSessionPermissions):
1735         (WebKit::WebAutomationSession::performMouseInteraction):
1736         (WebKit::WebAutomationSession::performKeyboardInteractions):
1737         * UIProcess/Automation/WebAutomationSession.h:
1738
1739 2017-11-28  Daniel Bates  <dabates@apple.com>
1740
1741         [Cocoa] First pass at implementing alternative presentation button element
1742         https://bugs.webkit.org/show_bug.cgi?id=179785
1743         Part of <rdar://problem/34917108>
1744
1745         Reviewed by Brent Fulgham.
1746
1747         Expose SPI to substitute the alternative presentation button for one or more elements
1748         and remove the alternative presentation button. Add a private delegate callback when
1749         the alternative presentation button is clicked.
1750
1751         * UIProcess/API/APIUIClient.h:
1752         (API::UIClient::didClickAlternativePresentationButton): Added.
1753         * UIProcess/API/C/WKPageUIClient.h:
1754         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1755         * UIProcess/Cocoa/UIDelegate.h:
1756         * UIProcess/Cocoa/UIDelegate.mm:
1757         (WebKit::UIDelegate::setDelegate): Wired up delegate callback.
1758         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Added.
1759         * UIProcess/WebPageProxy.cpp:
1760         (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Added.
1761         * UIProcess/WebPageProxy.h:
1762         * UIProcess/WebPageProxy.messages.in:
1763         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
1764         (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Added.
1765         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1766         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1767         (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Added.
1768         (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Added.
1769         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
1770         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1771         (WKBundleSubstituteWithAlternativePresentationButton): Added.
1772         (WKBundleRemoveAlternativePresentationButton): Added.
1773         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
1774         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
1775         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1776         (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Added.
1777         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1778         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1779         (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Added.
1780         * WebProcess/WebCoreSupport/WebChromeClient.h:
1781
1782 2017-11-27  Chris Dumez  <cdumez@apple.com>
1783
1784         ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141
1785         https://bugs.webkit.org/show_bug.cgi?id=180049
1786
1787         Reviewed by Brady Eidson.
1788
1789         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1790         * WebProcess/Storage/WebSWClientConnection.cpp:
1791         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
1792         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
1793         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
1794         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
1795         * WebProcess/Storage/WebSWClientConnection.h:
1796
1797 2017-11-27  Jeremy Jones  <jeremyj@apple.com>
1798
1799         downcast to WebKit::FullscreenClient can sometimes fail.
1800         https://bugs.webkit.org/show_bug.cgi?id=179849
1801
1802         Reviewed by Darin Adler.
1803
1804         There are cases during teardown where fullscreenClient() has been cleared back to an API::FullscreenClient.
1805         Because those cases, WKWebView should test before downcasting to WebKit::FullscreenClient.
1806
1807         This is causing a crash when fullscreen delegate is cleared after a page is closed.
1808
1809         * UIProcess/API/Cocoa/WKWebView.mm:
1810         (-[WKWebView _setFullscreenDelegate:]):
1811         (-[WKWebView _fullscreenDelegate]):
1812
1813 2017-11-27  Chris Dumez  <cdumez@apple.com>
1814
1815         Give Document a strongly typed identifier instead of a uint64_t
1816         https://bugs.webkit.org/show_bug.cgi?id=180041
1817
1818         Reviewed by Youenn Fablet.
1819
1820         Give Document a strongly typed identifier instead of a uint64_t, for clarity.
1821
1822         * Platform/IPC/ArgumentCoders.h:
1823         * Scripts/webkit/messages.py:
1824         (forward_declarations_and_headers):
1825         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1826         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
1827         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1828         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1829         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1830         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1831         * StorageProcess/StorageProcess.cpp:
1832         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
1833         * WebProcess/Storage/WebSWClientConnection.cpp:
1834         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1835         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
1836         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
1837         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
1838         * WebProcess/Storage/WebSWClientConnection.h:
1839         * WebProcess/Storage/WebSWClientConnection.messages.in:
1840
1841 2017-11-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1842
1843         [GTK][WPE] Add "enable-encrypted-media" property to WebKitWebSettings
1844         https://bugs.webkit.org/show_bug.cgi?id=18005
1845
1846         Reviewed by Michael Catanzaro.
1847
1848         EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML.
1849         This property will only work as intended if the EncryptedMedia feature is enabled at build time
1850         with the ENABLE_ENCRYPTED_MEDIA flag.
1851
1852         * UIProcess/API/glib/WebKitSettings.cpp:
1853         (webKitSettingsSetProperty):
1854         (webKitSettingsGetProperty):
1855         (webkit_settings_class_init):
1856         (webkit_settings_get_enable_encrypted_media):
1857         (webkit_settings_set_enable_encrypted_media):
1858         * UIProcess/API/gtk/WebKitSettings.h:
1859         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1860         * UIProcess/API/wpe/WebKitSettings.h:
1861
1862 2017-11-27  Tim Horton  <timothy_horton@apple.com>
1863
1864         One too many zeroes in macOS version number in FeatureDefines
1865         https://bugs.webkit.org/show_bug.cgi?id=180011
1866
1867         Reviewed by Dan Bernstein.
1868
1869         * Configurations/FeatureDefines.xcconfig:
1870
1871 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
1872
1873         [CoordGraphics] Prettify ID value handling in UpdateAtlas and UpdateAtlas::Client
1874         https://bugs.webkit.org/show_bug.cgi?id=180038
1875
1876         Reviewed by Carlos Garcia Campos.
1877
1878         In the UpdateAtlas class, provide an ID type that aliases to uint32_t.
1879         The m_id member variable (ex-m_ID) uses this type, and it's also now
1880         used in the Client interface.
1881
1882         While poking around, the header is modified to use '#pragma once',
1883         and m_id is moved to the more logical first position among member
1884         variables.
1885
1886         The static ID variable is modified to use the new type, and renamed
1887         to s_nextID. Comment alongside the namespace scope closure is fixed
1888         to use the appropriate name.
1889
1890         createUpdateAtlas() and removeUpdateAtlas() methods in the
1891         CompositingCoordinator class are modified to use the UpdateAtlas::ID
1892         type, and the former has the second parameter changed from RefPtr<>
1893         to Ref<>.
1894
1895         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1896         (WebKit::CompositingCoordinator::createUpdateAtlas):
1897         (WebKit::CompositingCoordinator::removeUpdateAtlas):
1898         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1899         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1900         (WebKit::UpdateAtlas::UpdateAtlas):
1901         (WebKit::UpdateAtlas::~UpdateAtlas):
1902         (WebKit::UpdateAtlas::getCoordinatedBuffer):
1903         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1904
1905 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
1906
1907         [CoordGraphics] CompositingCoordinator: clean up Client vtable, GraphicsLayerClient overrides
1908         https://bugs.webkit.org/show_bug.cgi?id=180037
1909
1910         Reviewed by Carlos Garcia Campos.
1911
1912         Remove the CompositingCoordinator::Client::paintLayerContents() method since
1913         the only implementation in CoordinatedLayerTreeHost was empty.
1914
1915         Subsequently, the CompositingCoordinator::paintContents() override of the
1916         GraphicsLayerClient method can also be removed. The notifyAnimationStarted()
1917         override is empty, just like the base method, so it's removed as well.
1918
1919         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1920         (WebKit::CompositingCoordinator::deviceScaleFactor const): Bring method up
1921         to the notifyFlushRequired() code, since both are overrides of the
1922         GraphicsLayerClient-inherited methods.
1923         (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto.
1924         (WebKit::CompositingCoordinator::notifyAnimationStarted): Deleted.
1925         (WebKit::CompositingCoordinator::paintContents): Deleted.
1926         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1927         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1928         (WebKit::CoordinatedLayerTreeHost::paintLayerContents): Deleted.
1929         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1930
1931 2017-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1932
1933         REGRESSION(r223073): disk cache directory is no longer copied in ProcessPoolConfiguration::copy()
1934         https://bugs.webkit.org/show_bug.cgi?id=180031
1935
1936         Reviewed by Youenn Fablet.
1937
1938         This has caused GTK/WPE test /webkit2/WebKitWebsiteData/configuration to fail, and the wrong directory is used
1939         by the network process. I think it was removed by mistake in r223073.
1940
1941         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1942         (API::ProcessPoolConfiguration::copy): Copy m_diskCacheDirectory too.
1943
1944 2017-11-27  Adrian Perez de Castro  <aperez@igalia.com>
1945
1946         [WPE][GTK] Improve contents of pkg-config .pc files
1947         https://bugs.webkit.org/show_bug.cgi?id=180032
1948
1949         Reviewed by Carlos Garcia Campos.
1950
1951         * gtk/webkit2gtk-web-extension.pc.in: Add URL, edit Name and Description.
1952         * gtk/webkit2gtk.pc.in: Add URL, edit Name.
1953         * wpe/wpe-webkit.pc.in: Add URL, edit Name and Description.
1954
1955 2017-11-23  Darin Adler  <darin@apple.com>
1956
1957         Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
1958         https://bugs.webkit.org/show_bug.cgi?id=179981
1959
1960         Reviewed by Sam Weinig.
1961
1962         * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more
1963         things final and private. Changed functions with multiple return values to use tuples
1964         instead of out arguments for clarity, especially because some were using pointers and it
1965         was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization
1966         of data members into the class definition.
1967
1968         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1969         (WebKit::PDFPlugin::create): Take a reference.
1970         (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition.
1971         (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument.
1972         (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options.
1973         Simplified slightly confusing match count code that was doing some unnecessary comparisons
1974         with the maximum match count. Use auto a bit.
1975         (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++
1976         and overloading works based on the argument type.
1977         (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change.
1978         (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out
1979         arguments and use a RetainPtr so we don't leak the options dictionary.
1980
1981         * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h.
1982
1983         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
1984         (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference.
1985
1986         * WebProcess/WebPage/FindController.cpp:
1987         (WebKit::core): Use |= instead of | to build up a FindOptions.
1988         (WebKit::FindController::FindController): Initialize data members in the class definition.
1989         (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame.
1990         (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code.
1991         (WebKit::FindController::findString): Use |= rather than | to add in an option.
1992         (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options.
1993         * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core
1994         function that converts WebKit::FindOptions to WebCore::FindOptions.
1995
1996         * WebProcess/WebPage/WebFrame.cpp:
1997         (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame.
1998         (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame.
1999
2000         * WebProcess/WebPage/WebPage.cpp:
2001         (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM.
2002         (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame.
2003         (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer.
2004         Use is/downcast insteadof more ad hoc coding style.
2005         (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions
2006         to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two
2007         enumrations matching! The stricter type checking of OptionSet helps us catch mistakes
2008         like this.
2009
2010         * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if
2011         statements, made forward declarations unconditional, and re-sorted them. Changed the
2012         Mac-specific lookupTextAtLocation to return a tuple (see below).
2013
2014         * WebProcess/WebPage/ios/WebPageIOS.mm:
2015         (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer.
2016         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
2017         (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options.
2018
2019         * WebProcess/WebPage/mac/WebPageMac.mm:
2020         (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix
2021         code that used to leak.
2022         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
2023         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference.
2024         (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types.
2025         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto.
2026         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
2027         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the
2028         tuple result from the lookupTextAtLocation functions.
2029         (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr
2030         for the NSDictionary to help fix the leak.
2031
2032 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
2033
2034         [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer
2035         https://bugs.webkit.org/show_bug.cgi?id=179977
2036
2037         Reviewed by Carlos Garcia Campos.
2038
2039         Make CompositingCoordinator::getCoordinatedBuffer() return a Ref<CoordinatedBuffer>
2040         value. In case an UpdateAtlas with enough free area is found, its CoordinatedBuffer
2041         is dereferenced into the return value. In case a new UpdateAtlas is created, the
2042         returned CoordinatedBuffer pointer is asserted to be non-null and dereferenced.
2043
2044         The retrieved CoordinatedBuffer pointer on a newly-created UpdateAtlas should never
2045         be null since the tiles are smaller in size than the UpdateAtlas area. The assert
2046         is done in release configurations as well since the code in CoordinatedGraphicsLayer
2047         assumes the returned pointer will be non-null, so it's just a matter of where to
2048         crash first in case somehow a null value is returned.
2049
2050         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2051         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
2052         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2053
2054 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
2055
2056         [CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension value
2057         https://bugs.webkit.org/show_bug.cgi?id=179976
2058
2059         Reviewed by Carlos Garcia Campos.
2060
2061         Have the UpdateAtlas constructor receive an IntSize object that specifies
2062         the desired size for the CoordinatedBuffer. Passing in a dimension doesn't
2063         really make sense since this value isn't dynamically configurable, and
2064         the only value that is passed in is already a power-of-two.
2065
2066         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2067         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
2068         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2069         (WebKit::UpdateAtlas::UpdateAtlas):
2070         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2071
2072 2017-11-23  Sam Weinig  <sam@webkit.org>
2073
2074         Remove unneeded ScriptController::processingUserGesture() forwarding functions
2075         https://bugs.webkit.org/show_bug.cgi?id=179954
2076
2077         Reviewed by Darin Adler.
2078
2079         Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
2080         with direct calls to the corresponding UserGestureIndicator functions.
2081
2082         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2083         (WebKit::InjectedBundle::isProcessingUserGesture):
2084         * WebProcess/WebPage/WebPage.cpp:
2085         (WebKit::WebPage::addResourceRequest):
2086
2087 2017-11-23  Chris Dumez  <cdumez@apple.com>
2088
2089         WebSWServerConnection should register/unregister itself with the StorageProcess
2090         https://bugs.webkit.org/show_bug.cgi?id=179965
2091
2092         Reviewed by Darin Adler.
2093
2094         WebSWServerConnection should register/unregister itself with the StorageProcess instead of relying
2095         on StorageToWebProcessConnection to do so on its behalf. This is less error-prone.
2096
2097         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2098         (WebKit::WebSWServerConnection::WebSWServerConnection):
2099         (WebKit::WebSWServerConnection::~WebSWServerConnection):
2100         * StorageProcess/StorageToWebProcessConnection.cpp:
2101         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
2102         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2103         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
2104
2105 2017-11-23  Darin Adler  <darin@apple.com>
2106
2107         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
2108         https://bugs.webkit.org/show_bug.cgi?id=179907
2109
2110         Reviewed by Sam Weinig.
2111
2112         * NetworkProcess/cache/NetworkCache.cpp:
2113         (WebKit::NetworkCache::isMediaMIMEType): Use startsWithLettersIgnoringASCIICase.
2114         * NetworkProcess/cache/NetworkCacheKey.cpp:
2115         (WebKit::NetworkCache::hashString): Use isAllASCII..
2116         * UIProcess/API/C/WKWebsitePolicies.cpp:
2117         (WKWebsitePoliciesSetCustomHeaderFields): Use startsWithLettersIgnoringASCIICase..
2118         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2119         (-[_WKWebsitePolicies setCustomHeaderFields:]): Ditto.
2120         * UIProcess/WebPageProxy.cpp:
2121         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Use endsWithIgnoringASCIICase.
2122         * UIProcess/WebPreferences.cpp:
2123         (WebKit::WebPreferences::WebPreferences): Initialize m_identifier explicitly. Somehow
2124         changing the String default constructor to be "= default" led to a warning that we
2125         otherwise did not get about not initializing m_identifier. Arguably a compiler bug,
2126         but legitimately strange that the copy constructor does not copy m_identifier and so
2127         nice to be explicit about it, I guess.
2128         * UIProcess/mac/WebPageProxyMac.mm:
2129         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Use
2130         endsWithIgnoringASCIICase.
2131         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): Ditto.
2132         * WebProcess/WebPage/WebPage.cpp:
2133         (WebKit::WebPage::createPlugin): Ditto.
2134         * WebProcess/WebPage/ios/WebPageIOS.mm:
2135         (WebKit::WebPage::platformEditorState const): Use isAllSpecialCharacters<isHTMLSpace>.
2136
2137 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
2138
2139         [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
2140         https://bugs.webkit.org/show_bug.cgi?id=179972
2141
2142         Reviewed by Carlos Garcia Campos.
2143
2144         In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing
2145         paintToSurface(). The new method traverses the list of UpdateAtlases and
2146         returns any CoordinatedBuffer object that was free to use. If none exist,
2147         a new UpdateAtlas object is created, and its CoordinatedBuffer is returned.
2148
2149         In  UpdateAtlas, the paintOnAvailableBuffer() method is replaced with
2150         getCoordinatedBuffer(). The latter allocates the necessary area but then
2151         returns a reference to the CoordinatedBuffer buffer, along with the atlas ID
2152         and the allocated rectangle information, and does not invoke any painting
2153         operation like paintOnAvailableBuffer() did.
2154
2155         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2156         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
2157         (WebKit::CompositingCoordinator::paintToSurface): Deleted.
2158         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2159         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2160         (WebKit::UpdateAtlas::getCoordinatedBuffer):
2161         (WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted.
2162         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2163
2164 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
2165
2166         [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
2167         https://bugs.webkit.org/show_bug.cgi?id=179970
2168
2169         Reviewed by Carlos Garcia Campos.
2170
2171         Drop the helper UpdateAtlasSurfaceClient class and instead directly use
2172         the CoordinatedBuffer's GraphicsContext to perform clip and translation
2173         operations based on the allocated rectangle, to pre-fill the target rect
2174         with transparent color in case the alpha channel is supported, and to
2175         then invoke CoordinatedBuffer::Client::paintToSurfaceContext() method,
2176         passing the GraphicsContext as the argument.
2177
2178         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2179         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
2180         (): Deleted.
2181
2182 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
2183
2184         [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
2185         https://bugs.webkit.org/show_bug.cgi?id=179967
2186
2187         Reviewed by Carlos Garcia Campos.
2188
2189         Replace uses of CoordinatedSurface class with CoordinatedBuffer. The
2190         ThreadSafeCoordinatedSurface class is removed, along with the code in
2191         CoordinatedLayerTreeHost that established a CoordinatedSurface factory.
2192
2193         * PlatformGTK.cmake:
2194         * PlatformWPE.cmake:
2195         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2196         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
2197         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
2198         (WebKit::CoordinatedBackingStore::updateTile):
2199         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
2200         Rename m_surface to m_buffer, m_surfaceOffset to m_bufferOffset.
2201         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2202         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
2203         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
2204         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2205         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Removed.
2206         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Removed.
2207         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2208         (WebKit::CompositingCoordinator::updateImageBacking):
2209         (WebKit::CompositingCoordinator::createUpdateAtlas):
2210         (WebKit::CompositingCoordinator::paintToSurface):
2211         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2212         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2213         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2214         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): Deleted.
2215         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2216         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2217         (WebKit::UpdateAtlas::UpdateAtlas):
2218         (WebKit::UpdateAtlas::~UpdateAtlas):
2219         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
2220         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2221         Rename m_surface to m_buffer.
2222         (WebKit::UpdateAtlas::size const):
2223         (WebKit::UpdateAtlas::supportsAlpha const):
2224
2225 2017-11-22  Ali Juma  <ajuma@chromium.org>
2226
2227         Implement VisualViewport API attributes
2228         https://bugs.webkit.org/show_bug.cgi?id=179385
2229
2230         Reviewed by Frédéric Wang.
2231
2232         Add a VisualViewportAPI experimental feature.
2233
2234         * Shared/WebPreferences.yaml:
2235
2236 2017-11-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
2237
2238         Remove build-webkit's notion of feature flags having a default value
2239         https://bugs.webkit.org/show_bug.cgi?id=177338
2240
2241         Reviewed by Carlos Alberto Lopez Perez.
2242
2243         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
2244         experimental features.
2245
2246         * Shared/WebPreferencesDefaultValues.h:
2247
2248 2017-11-22  Commit Queue  <commit-queue@webkit.org>
2249
2250         Unreviewed, rolling out r225093.
2251         https://bugs.webkit.org/show_bug.cgi?id=179938
2252
2253         Compilation failed on WinCairo 64-bit Release (Requested by
2254         fredw on #webkit).
2255
2256         Reverted changeset:
2257
2258         "Implement VisualViewport API attributes"
2259         https://bugs.webkit.org/show_bug.cgi?id=179385
2260         https://trac.webkit.org/changeset/225093
2261
2262 2017-11-21  Ali Juma  <ajuma@chromium.org>
2263
2264         Implement VisualViewport API attributes
2265         https://bugs.webkit.org/show_bug.cgi?id=179385
2266
2267         Reviewed by Frédéric Wang.
2268
2269         Add a VisualViewportAPI experimental feature.
2270
2271         * Shared/WebPreferences.yaml:
2272
2273 2017-11-21  Christopher Reid  <chris.reid@sony.com>
2274
2275         [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
2276         https://bugs.webkit.org/show_bug.cgi?id=179504
2277
2278         Reviewed by Darin Adler.
2279
2280         * UIProcess/Cocoa/WebViewImpl.mm:
2281         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2282         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2283
2284 2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2285
2286         [WPE] WPEWebProcess: Couldn't find current GLX or EGL context
2287         https://bugs.webkit.org/show_bug.cgi?id=179883
2288
2289         Reviewed by Žan Doberšek.
2290
2291         I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so
2292         fast that the web process never renders the first frame, so the context is created but never made current. I've
2293         checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but
2294         I don't know where those calls are originated. Making the context current right after it's created fixes the
2295         problem.
2296
2297         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2298         (WebKit::ThreadedCompositor::createGLContext): Always call makeContextCurrent() right after the context is created.
2299
2300 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2301
2302         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.2 release.
2303
2304         * gtk/NEWS: Add release notes for 2.19.2.
2305
2306 2017-11-20  Don Olmstead  <don.olmstead@sony.com>
2307
2308         Add declspec within WebKit API
2309         https://bugs.webkit.org/show_bug.cgi?id=179893
2310
2311         Reviewed by Darin Adler.
2312
2313         * Shared/API/c/WKDeclarationSpecifiers.h:
2314
2315 2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>
2316
2317         [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
2318         https://bugs.webkit.org/show_bug.cgi?id=177932
2319
2320         Reviewed by Carlos Garcia Campos.
2321
2322         Added new API to WebKitCookieManager to add, retrieve and delete complete
2323         cookies into/out-of a running session, and updated documentation sections.
2324
2325         * UIProcess/API/glib/WebKitCookieManager.cpp:
2326         (webkit_cookie_manager_add_cookie): New function.
2327         (webkit_cookie_manager_add_cookie_finish): Ditto.
2328         (webkit_cookie_manager_get_cookies): Ditto.
2329         (webkit_cookie_manager_get_cookies_finish): Ditto.
2330         (webkit_cookie_manager_delete_cookie): Ditto.
2331         (webkit_cookie_manager_delete_cookie_finish): Ditto.
2332         * UIProcess/API/gtk/WebKitCookieManager.h: Added new functions.
2333         * UIProcess/API/wpe/WebKitCookieManager.h: Ditto.
2334         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Ditto.
2335
2336 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2337
2338         [WPE] webkit_web_view_new() should enable specifying wpe_view_backend object
2339         https://bugs.webkit.org/show_bug.cgi?id=178655
2340
2341         Reviewed by Michael Catanzaro.
2342
2343         Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to
2344         provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a
2345         boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always
2346         takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional
2347         GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom
2348         deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL
2349         and it's owned by the caller, not the view.
2350
2351         * PlatformWPE.cmake:
2352         * UIProcess/API/C/wpe/WKView.cpp:
2353         (WKViewCreate):
2354         * UIProcess/API/C/wpe/WKView.h:
2355         * UIProcess/API/glib/WebKitWebView.cpp:
2356         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
2357         (webkitWebViewConstructed):
2358         (webkitWebViewSetProperty):
2359         (webkitWebViewGetProperty):
2360         (webkit_web_view_class_init):
2361         (webkitWebViewCreatePage):
2362         (webkit_web_view_get_backend):
2363         * UIProcess/API/wpe/WPEView.cpp:
2364         (WKWPE::m_backend):
2365         (WKWPE::View::~View):
2366         * UIProcess/API/wpe/WebKitWebView.h:
2367         * UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added.
2368         (_WebKitWebViewBackend::_WebKitWebViewBackend):
2369         (_WebKitWebViewBackend::~_WebKitWebViewBackend):
2370         (webkitWebViewBackendRef):
2371         (webkitWebViewBackendUnref):
2372         (webkitWebViewBackendCreateDefault):
2373         (webkit_web_view_backend_new):
2374         (webkit_web_view_backend_get_wpe_backend):
2375         * UIProcess/API/wpe/WebKitWebViewBackend.h: Added.
2376         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added.
2377         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
2378         (webkit_web_view_new):
2379         (webkit_web_view_new_with_context):
2380         (webkit_web_view_new_with_related_view):
2381         (webkit_web_view_new_with_settings):
2382         (webkit_web_view_new_with_user_content_manager):
2383         * UIProcess/API/wpe/webkit.h:
2384
2385 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2386
2387         [GTK][WPE] webkit_cookie_manager_delete_all_cookies doesn't delete the cookies if called before a web process is running
2388         https://bugs.webkit.org/show_bug.cgi?id=175265
2389
2390         Reviewed by Michael Catanzaro.
2391
2392         This is what happens:
2393
2394         1- We create our WebKitWebContext that creates its WebProcessPool.
2395         2- We set a persistent cookies storage.
2396         3- We ask the website data store to delete all cookies, but since website data store is a web process observer
2397            and we haven't spawned any web process yet, it creates a new WebProcessPool with the default configuration
2398            (no persistent cookies) and sends the message to delete the cookies there.
2399         4- The network process of the second process pool does nothing because it doesn't have cookies at all.
2400
2401         We need to set the primary data store of the WebProcessPool when WebKitWebContext is constructed to ensure that
2402         one is used before the web process is launched.
2403
2404         * UIProcess/API/glib/WebKitWebContext.cpp:
2405         (webkitWebContextConstructed):
2406
2407 2017-11-19  Tim Horton  <timothy_horton@apple.com>
2408
2409         Remove unused TOUCH_ICON_LOADING feature flag
2410         https://bugs.webkit.org/show_bug.cgi?id=179873
2411
2412         Reviewed by Simon Fraser.
2413
2414         * Configurations/FeatureDefines.xcconfig:
2415
2416 2017-11-19  Tim Horton  <timothy_horton@apple.com>
2417
2418         Remove unused LEGACY_VENDOR_PREFIXES feature flag
2419         https://bugs.webkit.org/show_bug.cgi?id=179872
2420
2421         Reviewed by Darin Adler.
2422
2423         * Configurations/FeatureDefines.xcconfig:
2424
2425 2017-11-18  Chris Dumez  <cdumez@apple.com>
2426
2427         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
2428         https://bugs.webkit.org/show_bug.cgi?id=179846
2429
2430         Reviewed by Darin Adler.
2431
2432         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2433         (WebKit::WebSWServerConnection::rejectJobInClient):
2434         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2435         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2436         (WebKit::WebSWServerConnection::startScriptFetchInClient):
2437         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2438         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
2439         * WebProcess/Storage/WebSWClientConnection.messages.in:
2440         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2441         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
2442         (WebKit::WebSWContextManagerConnection::didFinishInstall):
2443         * WebProcess/Storage/WebSWContextManagerConnection.h:
2444
2445 2017-11-18  Tim Horton  <timothy_horton@apple.com>
2446
2447         Rename some Network Capture debugging defines
2448         https://bugs.webkit.org/show_bug.cgi?id=179870
2449
2450         Reviewed by Darin Adler.
2451
2452         * NetworkProcess/capture/NetworkCaptureLogging.h:
2453         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2454         (WebKit::NetworkCapture::Manager::findMatch):
2455         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
2456         These shouldn't have WTF in their name - they have nothing to do with WTF.
2457         These shouldn't use ENABLE(), since they're not features, just debugging macros.
2458
2459 2017-11-17  Chris Dumez  <cdumez@apple.com>
2460
2461         [Service Workers] Implement "Notify Controller Change" algorithm
2462         https://bugs.webkit.org/show_bug.cgi?id=179822
2463
2464         Reviewed by Youenn Fablet.
2465
2466         * Scripts/webkit/messages.py:
2467         (class_template_headers):
2468         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2469         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
2470         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2471         * WebProcess/Storage/WebSWClientConnection.messages.in:
2472
2473 2017-11-17  Chris Dumez  <cdumez@apple.com>
2474
2475         Use a strongly typed identifier for SWServer::Connection
2476         https://bugs.webkit.org/show_bug.cgi?id=179848
2477
2478         Reviewed by Brady Eidson.
2479
2480         Use a strongly typed identifier for SWServer::Connection, for clarity.
2481
2482         * Scripts/webkit/messages.py:
2483         (forward_declarations_and_headers):
2484         (forward_declarations_and_headers.templates):
2485         (headers_for_type):
2486         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2487         (WebKit::WebSWServerConnection::WebSWServerConnection):
2488         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2489         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2490         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2491         * StorageProcess/StorageProcess.cpp:
2492         (WebKit::StorageProcess::didFailFetch):
2493         (WebKit::StorageProcess::didNotHandleFetch):
2494         (WebKit::StorageProcess::didReceiveFetchResponse):
2495         (WebKit::StorageProcess::didReceiveFetchData):
2496         (WebKit::StorageProcess::didReceiveFetchFormData):
2497         (WebKit::StorageProcess::didFinishFetch):
2498         * StorageProcess/StorageProcess.h:
2499         * StorageProcess/StorageProcess.messages.in:
2500         * StorageProcess/StorageToWebProcessConnection.cpp:
2501         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2502         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2503         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
2504         (WebKit::generateIDBConnectionToServerIdentifier):
2505         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
2506         * StorageProcess/StorageToWebProcessConnection.h:
2507         * StorageProcess/StorageToWebProcessConnection.messages.in:
2508         * WebProcess/Storage/WebSWClientConnection.cpp:
2509         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2510         * WebProcess/Storage/WebSWClientConnection.h:
2511         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2512         (WebKit::WebSWContextManagerConnection::startFetch):
2513         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2514         * WebProcess/Storage/WebSWContextManagerConnection.h:
2515         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2516         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2517         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
2518         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2519         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2520         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
2521         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
2522         * WebProcess/Storage/WebToStorageProcessConnection.h:
2523
2524 2017-11-17  John Wilander  <wilander@apple.com>
2525
2526         Storage Access API: UI process should update network process about granted access
2527         https://bugs.webkit.org/show_bug.cgi?id=176943
2528         <rdar://problem/34440612>
2529
2530         Reviewed by Alex Christensen.
2531
2532         * NetworkProcess/NetworkProcess.cpp:
2533         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
2534             Updates storage access on the session.
2535         * NetworkProcess/NetworkProcess.h:
2536         * NetworkProcess/NetworkProcess.messages.in:
2537         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2538         (WebKit::NetworkProcessCreationParameters::encode const):
2539         (WebKit::NetworkProcessCreationParameters::decode):
2540         * NetworkProcess/NetworkProcessCreationParameters.h:
2541         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2542         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2543         (WebKit::NetworkProcess::setStorageAccessAPIEnabled):
2544         * UIProcess/API/C/WKCookieManager.cpp:
2545         (WKCookieManagerSetStorageAccessAPIEnabled):
2546         * UIProcess/API/C/WKCookieManager.h:
2547         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2548         (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
2549         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2550         * UIProcess/API/Cocoa/WKProcessPool.mm:
2551         (-[WKProcessPool _isStorageAccessAPIEnabled]):
2552         (-[WKProcessPool _setStorageAccessAPIEnabled:]):
2553         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2554         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2555         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]):
2556             Test infrastructure.
2557         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2558         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2559         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2560         (WebKit::WebProcessPool::setStorageAccessAPIEnabled):
2561         * UIProcess/Network/NetworkProcessProxy.cpp:
2562         (WebKit::nextRequestStorageAccessContextId):
2563         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains):
2564             Sends a message to the network process to update storage access.
2565         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
2566             Receives a message from the network process that storage access
2567             was updated.
2568         * UIProcess/Network/NetworkProcessProxy.h:
2569         * UIProcess/Network/NetworkProcessProxy.messages.in:
2570         * UIProcess/WebCookieManagerProxy.cpp:
2571         (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled):
2572         * UIProcess/WebCookieManagerProxy.h:
2573         * UIProcess/WebProcessPool.h:
2574         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2575         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2576         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2577         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
2578             Test infrastructure.
2579         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2580             Now makes the API call even if the only operation is to clear first.
2581         * UIProcess/WebResourceLoadStatisticsStore.h:
2582         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2583         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler):
2584             Propagates the storage access directive to the network process proxy.
2585         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2586         * UIProcess/WebsiteData/WebsiteDataStore.h:
2587
2588 2017-11-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2589
2590         [WinCairo] Add network (curl) files for wincairo webkit
2591         https://bugs.webkit.org/show_bug.cgi?id=179474
2592
2593         Reviewed by Alex Christensen.
2594
2595         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
2596         (IPC::ArgumentCoder<CertificateInfo>::decode): Fidex return value since currently no operation is needed for wincairo webkit.
2597         (IPC::ArgumentCoder<ResourceError>::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit.
2598         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp.
2599         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2600         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h.
2601
2602 2017-11-16  Don Olmstead  <don.olmstead@sony.com>
2603
2604         [WinCairo] Update WinCairoRequirements
2605         https://bugs.webkit.org/show_bug.cgi?id=179790
2606
2607         Reviewed by Alex Christensen.
2608
2609         * PlatformWin.cmake:
2610
2611 2017-11-16  Youenn Fablet  <youenn@apple.com>
2612
2613         Service Worker should get the body of intercepted requests
2614         https://bugs.webkit.org/show_bug.cgi?id=179776
2615
2616         Reviewed by Alex Christensen.
2617
2618         Pass a FormDataReference when starting fetch IPC.
2619         Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process.
2620         Forbid fetch interception when URL is not HTTP/HTTPS.
2621
2622         * Platform/IPC/FormDataReference.h:
2623         (IPC::FormDataReference::FormDataReference):
2624         (IPC::FormDataReference::takeData):
2625         (IPC::FormDataReference::encode const):
2626         (IPC::FormDataReference::decode):
2627         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2628         (WebKit::WebSWServerConnection::startFetch):
2629         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2630         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2631         * WebProcess/Storage/WebSWClientConnection.cpp:
2632         (WebKit::WebSWClientConnection::startFetch):
2633         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2634         (WebKit::WebSWContextManagerConnection::startFetch):
2635         * WebProcess/Storage/WebSWContextManagerConnection.h:
2636         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2637         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2638         (WebKit::WebServiceWorkerProvider::handleFetch):
2639
2640 2017-11-16  Daniel Bates  <dabates@apple.com>
2641
2642         Add feature define for alternative presentation button element
2643         https://bugs.webkit.org/show_bug.cgi?id=179692
2644         Part of <rdar://problem/34917108>
2645
2646         Reviewed by Andy Estes.
2647
2648         Only enabled on Cocoa platforms by default.
2649
2650         * Configurations/FeatureDefines.xcconfig:
2651
2652 2017-11-16  Chris Dumez  <cdumez@apple.com>
2653
2654         [Service Worker] Implement "Try Clear Registration" algorithm
2655         https://bugs.webkit.org/show_bug.cgi?id=179791
2656
2657         Reviewed by Youenn Fablet.
2658
2659         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2660         * WebProcess/Storage/WebSWClientConnection.cpp:
2661         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
2662         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
2663         * WebProcess/Storage/WebSWClientConnection.h:
2664
2665 2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2666
2667         REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
2668         https://bugs.webkit.org/show_bug.cgi?id=179797
2669
2670         Reviewed by Simon Fraser.
2671
2672         r224179 introduced a performance regression. The newly-added code in WebPage::editorState is
2673         part of a performance-critical path. (The editor state is computed and sent to the UI
2674         process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added,
2675         but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process.
2676         WebPageProxy passes them along to PageClientImpl to compute the availability of the
2677         commands.
2678
2679         That's all pointless because this code only exists for the purpose of getting editing
2680         command availability to the UI process. In the case of undo and redo, it's not needed at
2681         all. I did not realize that when writing the code. So canUndo and canRedo should be removed
2682         from EditorState. This ought to be sufficient to avoid the perf regression.
2683
2684         No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using
2685         WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior,
2686         only performance.
2687
2688         * Shared/EditorState.cpp:
2689         (WebKit::EditorState::PostLayoutData::encode const):
2690         (WebKit::EditorState::PostLayoutData::decode):
2691         * Shared/EditorState.h:
2692         * UIProcess/API/glib/WebKitEditorState.cpp:
2693         (webkitEditorStateCreate):
2694         (webkitEditorStateChanged):
2695         * UIProcess/API/glib/WebKitEditorStatePrivate.h:
2696         * UIProcess/API/glib/WebKitWebView.cpp:
2697         (webkit_web_view_get_editor_state):
2698         * UIProcess/WebPageProxy.cpp:
2699         (WebKit::WebPageProxy::canUndo):
2700         (WebKit::WebPageProxy::canRedo):
2701         * UIProcess/WebPageProxy.h:
2702         * WebProcess/WebPage/WebPage.cpp:
2703         (WebKit::WebPage::editorState const):
2704
2705 2017-11-16  Megan Gardner  <megan_gardner@apple.com>
2706
2707         Remove allowBlockSelection as block selection is not supported anymore
2708         https://bugs.webkit.org/show_bug.cgi?id=179738
2709
2710         Reviewed by Tim Horton.
2711
2712         Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled
2713         and thus this flag will do nothing. This was only added as a debug measure last year, and nothing
2714         ever actually used it.
2715
2716         * Shared/WebPageCreationParameters.cpp:
2717         (WebKit::WebPageCreationParameters::encode const):
2718         (WebKit::WebPageCreationParameters::decode):
2719         * Shared/WebPageCreationParameters.h:
2720         * UIProcess/API/Cocoa/WKWebView.mm:
2721         (-[WKWebView _allowsBlockSelection]): Deleted.
2722         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2723         (-[WKWebViewConfiguration init]):
2724         (-[WKWebViewConfiguration copyWithZone:]):
2725         (-[WKWebViewConfiguration _allowsBlockSelection]): Deleted.
2726         (-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted.
2727         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2728         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2729         * UIProcess/PageClient.h:
2730         * UIProcess/WebPageProxy.cpp:
2731         (WebKit::WebPageProxy::creationParameters):
2732         * UIProcess/ios/PageClientImplIOS.h:
2733         * UIProcess/ios/PageClientImplIOS.mm:
2734         (WebKit::PageClientImpl::allowsBlockSelection): Deleted.
2735         * WebProcess/WebPage/WebPage.cpp:
2736         * WebProcess/WebPage/WebPage.h:
2737
2738 2017-11-16  Brent Fulgham  <bfulgham@apple.com>
2739
2740         Whitelist additional IOKit properties based on customer feedback
2741         https://bugs.webkit.org/show_bug.cgi?id=179782
2742         <rdar://problem/35508246>
2743
2744         Reviewed by Dean Jackson.
2745
2746         Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs
2747         from customer systems and our test infrastructure.
2748
2749         * WebProcess/com.apple.WebProcess.sb.in:
2750
2751 2017-11-15  Brady Eidson  <beidson@apple.com>
2752
2753         Implement basics of "Terminate Service Worker" algorithm.
2754         https://bugs.webkit.org/show_bug.cgi?id=179551
2755
2756         Reviewed by Chris Dumez.
2757
2758         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2759         (WebKit::WebSWServerToContextConnection::terminateWorker):
2760         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2761         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
2762
2763         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2764         (WebKit::WebSWContextManagerConnection::terminateWorker):
2765         (WebKit::WebSWContextManagerConnection::workerTerminated):
2766         * WebProcess/Storage/WebSWContextManagerConnection.h:
2767         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2768
2769 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
2770
2771         Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox
2772         https://bugs.webkit.org/show_bug.cgi?id=179747
2773         <rdar://problem/35367346>
2774
2775         Reviewed by Dean Jackson.
2776
2777         The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need
2778         to grant the WebContent Process sandbox access to them.
2779
2780         * WebProcess/com.apple.WebProcess.sb.in: 
2781
2782 2017-11-15  Alex Christensen  <achristensen@webkit.org>
2783
2784         Revert r224885
2785         https://bugs.webkit.org/show_bug.cgi?id=179719
2786
2787         * UIProcess/API/APIContentRuleListStore.cpp:
2788         (API::compiledToFile):
2789         r224885 was a speculative fix that did not fix anything on the bots.
2790
2791 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
2792
2793         Unreviewed build fix after r224830.
2794
2795         * WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed
2796         to support testing on Mac Mini hardware.
2797
2798 2017-11-15  Youenn Fablet  <youenn@apple.com>
2799
2800         Add ServiceWorker to WebProcess plumbery for FormData fetch responses
2801         https://bugs.webkit.org/show_bug.cgi?id=179694
2802
2803         Reviewed by Alex Christensen.
2804
2805         Added plumbery from Service Worker up to Web Process to pass form data response bodies.
2806         A follow-up patch should read the data from Network Process and send it to the ResourceLoader.
2807
2808         * Platform/IPC/FormDataReference.h: Added.
2809         (IPC::FormDataReference::FormDataReference):
2810         (IPC::FormDataReference::takeData):
2811         (IPC::FormDataReference::encode const):
2812         (IPC::FormDataReference::decode):
2813         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2814         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
2815         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2816         * StorageProcess/StorageProcess.cpp:
2817         (WebKit::StorageProcess::didReceiveFetchFormData):
2818         * StorageProcess/StorageProcess.h:
2819         * StorageProcess/StorageProcess.messages.in:
2820         * WebKit.xcodeproj/project.pbxproj:
2821         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2822         (WebKit::ServiceWorkerClientFetch::didReceiveFormData):
2823         * WebProcess/Storage/ServiceWorkerClientFetch.h:
2824         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
2825         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2826         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
2827         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
2828
2829 2017-11-15  Alex Christensen  <achristensen@webkit.org>
2830
2831         Move a compiled WKContentRuleList to its destination before calling mmap
2832         https://bugs.webkit.org/show_bug.cgi?id=179719
2833
2834         Reviewed by Brady Eidson.
2835
2836         Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it.
2837         Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist
2838         any more.  Moving the file before mmaping and closing the file might prevent this failure.
2839
2840         * UIProcess/API/APIContentRuleListStore.cpp:
2841         (API::compiledToFile):
2842
2843 2017-11-15  Chris Dumez  <cdumez@apple.com>
2844
2845         [Service Workers] Implement Client API
2846         https://bugs.webkit.org/show_bug.cgi?id=179709
2847
2848         Reviewed by Alex Christensen.
2849
2850         * Shared/WebCoreArgumentCoders.cpp:
2851         * Shared/WebCoreArgumentCoders.h:
2852         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2853         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2854         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2855         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2856         * WebProcess/Storage/WebSWClientConnection.cpp:
2857         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2858         * WebProcess/Storage/WebSWClientConnection.h:
2859         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2860         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2861         * WebProcess/Storage/WebSWContextManagerConnection.h:
2862         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2863
2864 2017-11-15  Ryan Haddad  <ryanhaddad@apple.com>
2865
2866         Unreviewed, rolling out r224863.
2867
2868         Introduced LayoutTest crashes on iOS Simulator.
2869
2870         Reverted changeset:
2871
2872         "Move JSONValues to WTF and convert uses of InspectorValues.h
2873         to JSONValues.h"
2874         https://bugs.webkit.org/show_bug.cgi?id=173793
2875         https://trac.webkit.org/changeset/224863
2876
2877 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
2878
2879         Remove access to "com.apple.pbs.fetch_services" from WebContent sandbox
2880         https://bugs.webkit.org/show_bug.cgi?id=179689
2881         <rdar://problem/35369172>
2882
2883         Reviewed by Per Arne Vollan.
2884
2885         WebKit's WebContent process should not have any need to interact with the fetch_services
2886         API exposed to the system. These interactions (if needed) should be happening in the UIProcess,
2887         so we should prevent the untrusted Web Content Process from being able to connect.
2888
2889         * WebProcess/com.apple.WebProcess.sb.in:
2890
2891 2017-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2892
2893         Remove GTK web inspector images
2894         https://bugs.webkit.org/show_bug.cgi?id=179716
2895
2896         Reviewed by Carlos Garcia Campos.
2897
2898         * InspectorGResources.cmake:
2899
2900 2017-11-15  Gabriel Ivascu  <givascu@igalia.com>
2901
2902         [GTK] Automatically adjust font size when gtk-xft-dpi changes
2903         https://bugs.webkit.org/show_bug.cgi?id=142673
2904
2905         Some follow-up fixes for the previous patch.
2906
2907         Reviewed by Carlos Garcia Campos.
2908
2909         * UIProcess/API/glib/WebKitSettings.cpp:
2910         (webKitSettingsDispose):
2911         (webKitSettingsConstructed):
2912
2913 2017-11-14  Nan Wang  <n_wang@apple.com>
2914
2915         AX: AOM: Implement AccessibleNode class and support label and role attributes
2916         https://bugs.webkit.org/show_bug.cgi?id=179494
2917
2918         Reviewed by Ryosuke Niwa.
2919
2920         * Shared/WebPreferences.yaml:
2921         * UIProcess/API/C/WKPreferences.cpp:
2922         (WKPreferencesSetAccessibilityObjectModelEnabled):
2923         (WKPreferencesGetAccessibilityObjectModelEnabled):
2924         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2925
2926 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2927
2928         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
2929         https://bugs.webkit.org/show_bug.cgi?id=173793
2930
2931         Reviewed by Brian Burg.
2932
2933         Based on patch by Brian Burg.
2934
2935         * UIProcess/Automation/WebAutomationSession.cpp:
2936         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2937         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2938         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
2939         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
2940         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
2941         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
2942         (WebKit::WebAutomationSession::navigationOccurredForFrame):
2943         (WebKit::WebAutomationSession::documentLoadedForFrame):
2944         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
2945         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
2946         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
2947         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
2948         (WebKit::WebAutomationSession::addSingleCookie):
2949         (WebKit::WebAutomationSession::setSessionPermissions):
2950         (WebKit::WebAutomationSession::performMouseInteraction):
2951         (WebKit::WebAutomationSession::performKeyboardInteractions):
2952         * UIProcess/Automation/WebAutomationSession.h:
2953
2954 2017-11-14  Chris Dumez  <cdumez@apple.com>
2955
2956         [Service Workers] Implement container.getRegistrations()
2957         https://bugs.webkit.org/show_bug.cgi?id=179672
2958
2959         Reviewed by Brady Eidson.
2960
2961         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2962         (WebKit::WebSWServerConnection::getRegistrations):
2963         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2964         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2965         * WebProcess/Storage/WebSWClientConnection.cpp:
2966         (WebKit::WebSWClientConnection::didGetRegistrations):
2967         (WebKit::WebSWClientConnection::getRegistrations):
2968         * WebProcess/Storage/WebSWClientConnection.h:
2969         * WebProcess/Storage/WebSWClientConnection.messages.in:
2970
2971 2017-11-14  Youenn Fablet  <youenn@apple.com>
2972
2973         Implement ServiceWorker handle fetch for navigation loads
2974         https://bugs.webkit.org/show_bug.cgi?id=179404
2975
2976         Reviewed by Alex Christensen and Chris Dumez.
2977
2978         Update handle fetch algorithm to support navigation requests.
2979         In case of navigation requests, set service worker response mime type to text/html if none is provided.
2980
2981         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2982         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2983         * WebProcess/Storage/WebSWClientConnection.cpp:
2984         (WebKit::WebSWClientConnection::startFetch):
2985         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2986         (WebKit::shouldHandleFetch):
2987         (WebKit::WebServiceWorkerProvider::handleFetch):
2988
2989 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2990
2991         Remove Cocoa CFURLConnection loading code
2992         https://bugs.webkit.org/show_bug.cgi?id=179688
2993
2994         Reviewed by Antti Koivisto.
2995
2996         * NetworkProcess/Downloads/Download.h:
2997
2998 2017-11-14  Daniel Bates  <dabates@apple.com>
2999
3000         Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files
3001         for feature defines
3002
3003         Following r195498 and r201917 the Visual Studio property files for feature defines have
3004         moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops.
3005         Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these
3006         files.
3007
3008         * Configurations/FeatureDefines.xcconfig:
3009
3010 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
3011
3012         Whitelist some IOKIt properties to avoid sandbox violations on YouTube
3013         https://bugs.webkit.org/show_bug.cgi?id=179683
3014         <rdar://problem/35415368>
3015
3016         Reviewed by Dean Jackson.
3017
3018         YouTube video playback on some hardware (and some video encodings) generates sandbox violations. Add
3019         whitelist entries for the relevant IOKit properties needed to support these activities.
3020
3021         * WebProcess/com.apple.WebProcess.sb.in:
3022
3023 2017-11-14  Daniel Bates  <dabates@apple.com>
3024
3025         Mark WebChromeClient::requestStorageAccess() as final
3026         https://bugs.webkit.org/show_bug.cgi?id=179673
3027
3028         Reviewed by Sam Weinig.
3029
3030         Mark WebChromeClient::requestStorageAccess() as final so that it overrides the virtual function
3031         in ChromeClient with the same name and hence we actually call it through a ChromeClient pointer.
3032
3033         * WebProcess/WebCoreSupport/WebChromeClient.h:
3034
3035 2017-11-14  Youenn Fablet  <youenn@apple.com>
3036
3037         WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized
3038         https://bugs.webkit.org/show_bug.cgi?id=179668
3039
3040         Reviewed by Chris Dumez.
3041
3042         There may be cases where the origin table is not initialized and we would think there is no service worker registration.
3043         In such a case, we should go to the StorageProcess.
3044         StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map
3045         is correctly initialized or not.
3046
3047         Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin.
3048
3049         * WebProcess/Storage/WebSWClientConnection.cpp:
3050         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
3051         (WebKit::WebSWClientConnection::matchRegistration):
3052         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted.
3053         * WebProcess/Storage/WebSWClientConnection.h:
3054         * WebProcess/Storage/WebSWOriginTable.h:
3055         (WebKit::WebSWOriginTable::isInitialized const):
3056         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3057         (WebKit::shouldHandleFetch):
3058
3059 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
3060
3061         Consolidate sysctl-read rules in WebProcess sandbox
3062         https://bugs.webkit.org/show_bug.cgi?id=179674
3063         <rdar://problem/35367154>
3064
3065         Reviewed by Dean Jackson.
3066
3067         Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into
3068         the main function in the sandbox profile.
3069
3070         Remove the statement to grant global sysctl-read permissions that was copied into this
3071         sandbox profile in an earlier checkin. We started blocking the blanket read permissions in
3072         macOS 10.13, and want to continue to do so.
3073         
3074         The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads
3075         to occur before we hit the block declaration in the WebContent sandbox. Now that we are
3076         consistently blocking systcl reads from the start, we need to add whitelist entries for a
3077         few more entries to avoid creating new sandbox violations.
3078
3079         * WebProcess/com.apple.WebProcess.sb.in:
3080
3081 2017-11-14  Alex Christensen  <achristensen@webkit.org>
3082
3083         Remove WebKit CFURLConnection code
3084         https://bugs.webkit.org/show_bug.cgi?id=179645
3085
3086         Reviewed by Alexey Proskuryakov.
3087
3088         The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit.
3089
3090         * NetworkProcess/Downloads/Download.h:
3091         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3092         * NetworkProcess/NetworkLoad.h:
3093         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3094         (WebKit::serverTrustCredential):
3095         * NetworkProcess/mac/NetworkLoadMac.mm:
3096         * Shared/Authentication/AuthenticationManager.cpp:
3097         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
3098         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
3099         (WebKit::AuthenticationManager::cancelSingleChallenge):
3100         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
3101         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
3102         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
3103         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
3104         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
3105         * Shared/WebProcessCreationParameters.cpp:
3106         (WebKit::WebProcessCreationParameters::encode const):
3107         (WebKit::WebProcessCreationParameters::decode):
3108         * Shared/WebProcessCreationParameters.h:
3109         * Shared/mac/WebCoreArgumentCodersMac.mm:
3110         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3111         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3112         * config.h:
3113
3114 2017-11-14  Alex Christensen  <achristensen@webkit.org>
3115
3116         Remove assertions added in r224791
3117         https://bugs.webkit.org/show_bug.cgi?id=178751#c10
3118
3119         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3120         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3121         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3122         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3123         I had added assertions that sandbox extension handle consumption succeeds.
3124         In the API test IndexedDB.StructuredCloneBackwardCompatibility we get a sandbox extension handle
3125         to give access to a directory that does not exist and consumption fails.  We want it to fail,
3126         so my optimistic addition of a success assertion was incorrect.  The test passes without it
3127         and behaves like it used to.
3128
3129 2017-11-14  Tim Horton  <timothy_horton@apple.com>
3130
3131         Don't use -[NSString stringWithFormat:] to build defaults keys
3132         https://bugs.webkit.org/show_bug.cgi?id=179680
3133
3134         Reviewed by Simon Fraser.
3135
3136         * UIProcess/mac/WebPreferencesMac.mm:
3137         (WebKit::makeKey):
3138         (WebKit::debugUserDefaultsValue):
3139         Use string concatenation instead of stringWithFormat to build
3140         preference keys. This wasn't a huge cost, but it shaves a few milliseconds
3141         off process launch.
3142
3143 2017-11-14  Alex Christensen  <achristensen@webkit.org>
3144
3145         Clean up old URL parser remnants
3146         https://bugs.webkit.org/show_bug.cgi?id=179573
3147
3148         Reviewed by Darin Adler.
3149
3150         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3151         (WebKit::WebContextMenuClient::searchWithGoogle):
3152         Use https if we do end up searching with google.
3153
3154 2017-11-14  Antti Koivisto  <antti@apple.com>
3155
3156         Enable display:contents by default
3157         https://bugs.webkit.org/show_bug.cgi?id=179655
3158
3159         Reviewed by Sam Weinig.
3160
3161         * Shared/WebPreferences.yaml:
3162
3163         Make non-experimental and enabled.
3164
3165 2017-11-10  Brent Fulgham  <bfulgham@apple.com>
3166
3167         Consolidate mach-lookup calls in WebProcess sandbox
3168         https://bugs.webkit.org/show_bug.cgi?id=179650
3169         <rdar://problem/35367154>
3170
3171         Reviewed by Dean Jackson.
3172
3173         Consolidate the various calls to 'allow mach-lookup' imported during Bug 179548 into the main
3174         function in the sandbox profile. Remove some entries that are not needed by WebKit.
3175
3176         Remove the statement to grant global permission to perform mach-lookup for any xpc
3177         service name that was copied into this sandbox profile in Bug 179548. We started blocking
3178         this in macOS 10.13 and want to continue to do so.
3179         
3180         The earlier "grant global permission" in 'system.sb' apparently allowed some xpc lookups to occur
3181         before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking
3182         mach lookups we need to add whitelist entries for a few more services to avoid creating new
3183         sandbox violations.
3184
3185         * WebProcess/com.apple.WebProcess.sb.in:
3186
3187 2017-11-14  Tim Horton  <timothy_horton@apple.com>
3188
3189         Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
3190         https://bugs.webkit.org/show_bug.cgi?id=179646
3191         <rdar://problem/35337288>
3192
3193         Reviewed by Simon Fraser.
3194
3195         * UIProcess/ios/WKActionSheetAssistant.mm:
3196         (-[WKActionSheetAssistant showImageSheet]):
3197         (-[WKActionSheetAssistant showLinkSheet]):
3198         (-[WKActionSheetAssistant showDataDetectorsSheet]):
3199         * UIProcess/ios/WKContentViewInteraction.mm:
3200         (-[WKContentView _actionForLongPressFromPositionInformation:]):
3201         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3202         Make use of canBePresentedByDataDetectors with our WebCore URL instead
3203         of (sometimes unsucessfully) reparsing the URL with NSURL's parser.
3204         Also, avoid a few unnecessary round-trips through String when converting
3205         from URL to NSURL.
3206
3207 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
3208
3209         REGRESSION(r224799): WebKit crashes on Sierra due to sandbox violation
3210         https://bugs.webkit.org/show_bug.cgi?id=179656
3211         
3212         Unreviewed build fix.
3213
3214         * WebProcess/com.apple.WebProcess.sb.in: Switch to Dan's recommended version check.
3215
3216 2017-11-13  Joseph Pecoraro  <pecoraro@apple.com>
3217
3218         Give a ServiceWorker WebContentProcess a different display name
3219         https://bugs.webkit.org/show_bug.cgi?id=179653
3220
3221         Reviewed by Brady Eidson.
3222
3223         * UIProcess/WebProcessProxy.h:
3224         * UIProcess/WebProcessProxy.cpp:
3225         (WebKit::WebProcessProxy::create):
3226         Call connect after construction so virtual methods will use subclass implementations.
3227
3228         * UIProcess/ServiceWorkerProcessProxy.h:
3229         * UIProcess/ServiceWorkerProcessProxy.cpp:
3230         (WebKit::ServiceWorkerProcessProxy::create):
3231         Copy the pattern from WebProcessProxy to ensure connect() gets called after construction.
3232
3233         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
3234         Set a launch option to signal this is a Service Worker process.
3235
3236         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3237         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
3238         * WebProcess/cocoa/WebProcessCocoa.mm:
3239         (WebKit::WebProcess::initializeProcessName):
3240         Consume the launch option to configuration the process name.
3241
3242 2017-11-13  Ryosuke Niwa  <rniwa@webkit.org>
3243
3244         REGRESSION(r224799): WebKit crashes at launch on macOS Sierra due to a sandbox violation
3245         https://bugs.webkit.org/show_bug.cgi?id=179656
3246
3247         Unreviewed. Revert r224799 on macOS Sierra.
3248
3249         * WebProcess/com.apple.WebProcess.sb.in:
3250
3251 2017-11-13  Chris Dumez  <cdumez@apple.com>
3252
3253         Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
3254         https://bugs.webkit.org/show_bug.cgi?id=179649
3255
3256         Reviewed by Brady Eidson.
3257
3258         * Shared/WebCoreArgumentCoders.h:
3259         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3260         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
3261         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
3262         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3263         * WebProcess/Storage/WebSWClientConnection.cpp:
3264         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
3265         * WebProcess/Storage/WebSWClientConnection.h:
3266         * WebProcess/Storage/WebSWClientConnection.messages.in:
3267
3268 2017-11-13  Brady Eidson  <beidson@apple.com>
3269
3270         Massive "Server-process-to-context-process" connection overhaul.
3271         https://bugs.webkit.org/show_bug.cgi?id=179554
3272
3273         Reviewed by Chris Dumez.
3274
3275         * DerivedSources.make:
3276         * WebKit.xcodeproj/project.pbxproj:
3277
3278         * Shared/WebCoreArgumentCoders.h:
3279
3280         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3281         (WebKit::WebSWServerConnection::sendToContextProcess):
3282         (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted.
3283         (WebKit::WebSWServerConnection::fireInstallEvent): Deleted.
3284         (WebKit::WebSWServerConnection::fireActivateEvent): Deleted.
3285         (WebKit::WebSWServerConnection::setContextConnection): Deleted.
3286         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3287
3288         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp.
3289         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
3290         (WebKit::WebSWServerToContextConnection::messageSenderConnection):
3291         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID):
3292         (WebKit::WebSWServerToContextConnection::connectionClosed):
3293         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
3294         (WebKit::WebSWServerToContextConnection::fireInstallEvent):
3295         (WebKit::WebSWServerToContextConnection::fireActivateEvent):
3296         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h.
3297         (WebKit::WebSWServerToContextConnection::create):
3298         (WebKit::WebSWServerToContextConnection::ipcConnection const):
3299         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in.
3300
3301         * StorageProcess/StorageProcess.cpp:
3302         (WebKit::StorageProcess::didClose):
3303         (WebKit::StorageProcess::didReceiveMessage):
3304         (WebKit::StorageProcess::globalServerToContextConnection):
3305         (WebKit::StorageProcess::createServerToContextConnection):
3306         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
3307         (WebKit::StorageProcess::workerContextProcessConnection): Deleted.
3308         (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted.
3309         (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted.
3310         (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted.
3311         (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted.
3312         (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted.
3313         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted.
3314         * StorageProcess/StorageProcess.h:
3315         * StorageProcess/StorageProcess.messages.in:
3316
3317         * StorageProcess/StorageToWebProcessConnection.cpp:
3318         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
3319         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
3320         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
3321
3322         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3323         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3324         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
3325         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
3326         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
3327         (WebKit::WebSWContextManagerConnection::didFinishInstall):
3328         (WebKit::WebSWContextManagerConnection::didFinishActivation):
3329         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
3330         * WebProcess/Storage/WebSWContextManagerConnection.h:
3331         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3332
3333 2017-11-13  Brent Fulgham  <bfulgham@apple.com>
3334
3335         WebContent sandbox should not include 'system.sb'
3336         https://bugs.webkit.org/show_bug.cgi?id=179548
3337         <rdar://problem/35367154>
3338
3339         Reviewed by Darin Adler.
3340
3341         Stop including 'system.sb', and just include the portions of that sandbox that we
3342         actually use in WebContent Process. This is the first step in some further sandbox
3343         tightening.
3344
3345         * WebProcess/com.apple.WebProcess.sb.in:
3346
3347 2017-11-13  Simon Fraser  <simon.fraser@apple.com>
3348
3349         When navigating back to a page, compositing layers may not use accelerated drawing
3350         https://bugs.webkit.org/show_bug.cgi?id=178749
3351         rdar://problem/35158946
3352
3353         Reviewed by Dean Jackson.
3354
3355         Avoid assertions when a test enables accelerated drawing (which we can't support
3356         in the iOS simulator).
3357
3358         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
3359         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
3360
3361 2017-11-13  Youenn Fablet  <youenn@apple.com>
3362
3363         matchRegistration does not need to go to StorageProcess if no service worker is registered
3364         https://bugs.webkit.org/show_bug.cgi?id=179480
3365
3366         Reviewed by Chris Dumez.
3367
3368         Removed origin store handling from StorageProcess since it is now handled within SWServer.
3369         Updated clearing of web site data accordingly.
3370         Optimized matchRegistration by looking at the origin store before doing any IPC.
3371         Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess.
3372
3373         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
3374         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3375         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
3376         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
3377         * StorageProcess/StorageProcess.cpp:
3378         (WebKit::StorageProcess::deleteWebsiteData):
3379         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
3380         (WebKit::StorageProcess::swServerForSession):
3381         (WebKit::StorageProcess::swOriginStoreForSession):
3382         (WebKit::StorageProcess::registerSWServerConnection):
3383         (WebKit::StorageProcess::unregisterSWServerConnection):
3384         (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted.
3385         (WebKit::StorageProcess::swOriginStoreForSession const): Deleted.
3386         * StorageProcess/StorageProcess.h:
3387         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
3388         (WebKit::WebSWOriginStore::addToStore):
3389         (WebKit::WebSWOriginStore::removeFromStore):
3390         (WebKit::WebSWOriginStore::clearStore):
3391         (WebKit::WebSWOriginStore::add): Deleted.
3392         (WebKit::WebSWOriginStore::remove): Deleted.
3393         (WebKit::WebSWOriginStore::clear): Deleted.
3394         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
3395         * WebProcess/Storage/WebSWClientConnection.cpp:
3396         (WebKit::WebSWClientConnection::matchRegistration):
3397
3398 2017-11-13  Alex Christensen  <achristensen@webkit.org>
3399
3400         Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
3401         https://bugs.webkit.org/show_bug.cgi?id=178751
3402
3403         Reviewed by Brady Eidson.
3404
3405         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3406         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
3407         * NetworkProcess/NetworkProcess.cpp:
3408         (WebKit::NetworkProcess::initializeNetworkProcess):
3409         (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted.
3410         * NetworkProcess/NetworkProcess.h:
3411         * NetworkProcess/NetworkProcess.messages.in:
3412         * NetworkProcess/RemoteNetworkingContext.h:
3413         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3414         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3415         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
3416         * Shared/WebsiteDataStoreParameters.cpp:
3417         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
3418         * Shared/WebsiteDataStoreParameters.h:
3419         * UIProcess/WebProcessPool.cpp:
3420         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3421         (WebKit::WebProcessPool::createNewWebProcess):
3422         (WebKit::WebProcessPool::pageAddedToProcess):
3423         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3424         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
3425         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3426         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3427         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3428         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted.
3429         * WebProcess/WebPage/WebPage.cpp:
3430         (WebKit::WebPage::setSessionID):
3431         * WebProcess/WebProcess.cpp:
3432         (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted.
3433         * WebProcess/WebProcess.h:
3434         * WebProcess/WebProcess.messages.in:
3435
3436 2017-11-13  Alex Christensen  <achristensen@webkit.org>
3437
3438         Add logs to debug content extension test failures
3439         https://bugs.webkit.org/show_bug.cgi?id=179624
3440
3441         Reviewed by Chris Dumez.
3442
3443         * UIProcess/API/APIContentRuleListStore.cpp:
3444         (API::compiledToFile):
3445         Right now I'm seeing this log:
3446         "Rule list compilation failed: Unspecified error during compile."
3447         I need more information to debug what is failing on the bots.
3448
3449 2017-11-07  Brian Burg  <bburg@apple.com>
3450
3451         Web Automation: inViewCenterPoint should not include t