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