b110bd008c53b7e6aa70b89764776aae888e6bf9
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-09-17  Alex Christensen  <achristensen@webkit.org>
2
3         Refactoring related to Safe Browsing
4         https://bugs.webkit.org/show_bug.cgi?id=189631
5
6         Reviewed by Tim Horton.
7
8         Make SafeBrowsingResult RefCounted.
9         Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
10
11         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
12         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
13         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
14         (WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
15         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
16         (WebKit::WebPageProxy::startDrag): Deleted.
17         (WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
18         (WebKit::WebPageProxy::setDragCaretRect): Deleted.
19         (WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
20         (WebKit::WebPageProxy::platformCloneAttachment): Deleted.
21         * UIProcess/SafeBrowsingResult.h:
22         (WebKit::SafeBrowsingResult::create):
23         * UIProcess/WebFramePolicyListenerProxy.cpp:
24         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
25         * UIProcess/WebFramePolicyListenerProxy.h:
26         * UIProcess/WebFrameProxy.cpp:
27         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
28         * UIProcess/WebFrameProxy.h:
29         * UIProcess/WebPageProxy.cpp:
30         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
31         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
32         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
33         (WebKit::WebPageProxy::decidePolicyForResponse):
34         * UIProcess/WebPageProxy.h:
35
36 2018-09-17  Darin Adler  <darin@apple.com>
37
38         Use OpaqueJSString rather than JSRetainPtr inside WebKit
39         https://bugs.webkit.org/show_bug.cgi?id=189652
40
41         Reviewed by Saam Barati.
42
43         * Shared/API/c/WKString.cpp: Removed unneeded include of JSStringRef.h.
44
45         * WebProcess/Automation/WebAutomationSessionProxy.cpp: Removed unneeded
46         include of JSRetainPtr.
47         (WebKit::toJSString): Deleted.
48         (WebKit::toJSValue): Use OpaqueJSString::create.
49         (WebKit::callPropertyFunction): Ditto.
50         (WebKit::evaluate): Use adoptRef.
51         (WebKit::evaluateJavaScriptCallback): Ditto.
52         (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
53         Use OpaqueJSString::create.
54         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use
55         String rather than JSStringRef.
56
57         * WebProcess/Plugins/PDF/PDFPlugin.mm: Removed unneeded includes.
58         (WebKit::PDFPlugin::runScriptsInPDFDocument): Use OpaqueJSString::create.
59
60 2018-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
61
62         Unreviewed, fix incorrect WPE build fix made in r236009
63
64         This isn't the right place to add the typedef. I failed to notice that the WebKitWebView
65         type is not actually used anywhere in this header. Actually, the problematic function is no
66         longer declared or used anywhere and was just missed when WebKitScriptDialog was refactored,
67         so remove it.
68
69         * UIProcess/API/wpe/WebKitScriptDialog.h:
70         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
71         (webkitScriptDialogRun): Deleted.
72
73 2018-09-17  Sihui Liu  <sihui_liu@apple.com>
74
75         Move IndexedDB to Network Process
76         https://bugs.webkit.org/show_bug.cgi?id=189415
77         <rdar://problem/44396973>
78
79         Reviewed by Chris Dumez.
80
81         We are going to eliminate storage process and move its functionality to network process. 
82         The reasons why we want to do this:
83         1. Lower resource usage of having an additional process for storage operations, especially
84         memory. Single storage process takes about 5MB memory on macOS.
85         2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
86         regression in app launch. The launch time of storage process is partly attributed to this:
87         Service Workers delay page loading until receiving response from storage process.
88         3. We choose network process because UI process may have broader access in file system
89         that we don't want the storage operations to have.
90
91         This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
92         to corresponding components of network process. Moving of Service Worker and stopping to 
93         launch storage process will be done in following patches.
94
95         We expect to see the higher cpu and memory usage of network process as it is taking more work,
96         but the overall gain in memory and latency after we completely remove storage process should be 
97         positive.
98
99         * CMakeLists.txt:
100         * DerivedSources.make:
101         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
102         (WebKit::WebIDBConnectionToClient::create):
103         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
104         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
105         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
106         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
107         (WebKit::WebIDBConnectionToClient::connectionToClient):
108         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
109         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
110         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
111         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
112         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
113         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
114         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
115         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
116         (WebKit::WebIDBConnectionToClient::didCreateIndex):
117         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
118         (WebKit::WebIDBConnectionToClient::didRenameIndex):
119         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
120         (WebKit::WebIDBConnectionToClient::handleGetResult):
121         (WebKit::WebIDBConnectionToClient::didGetRecord):
122         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
123         (WebKit::WebIDBConnectionToClient::didGetCount):
124         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
125         (WebKit::WebIDBConnectionToClient::didOpenCursor):
126         (WebKit::WebIDBConnectionToClient::didIterateCursor):
127         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
128         (WebKit::WebIDBConnectionToClient::didStartTransaction):
129         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
130         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
131         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
132         (WebKit::WebIDBConnectionToClient::deleteDatabase):
133         (WebKit::WebIDBConnectionToClient::openDatabase):
134         (WebKit::WebIDBConnectionToClient::abortTransaction):
135         (WebKit::WebIDBConnectionToClient::commitTransaction):
136         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
137         (WebKit::WebIDBConnectionToClient::createObjectStore):
138         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
139         (WebKit::WebIDBConnectionToClient::renameObjectStore):
140         (WebKit::WebIDBConnectionToClient::clearObjectStore):
141         (WebKit::WebIDBConnectionToClient::createIndex):
142         (WebKit::WebIDBConnectionToClient::deleteIndex):
143         (WebKit::WebIDBConnectionToClient::renameIndex):
144         (WebKit::WebIDBConnectionToClient::putOrAdd):
145         (WebKit::WebIDBConnectionToClient::getRecord):
146         (WebKit::WebIDBConnectionToClient::getAllRecords):
147         (WebKit::WebIDBConnectionToClient::getCount):
148         (WebKit::WebIDBConnectionToClient::deleteRecord):
149         (WebKit::WebIDBConnectionToClient::openCursor):
150         (WebKit::WebIDBConnectionToClient::iterateCursor):
151         (WebKit::WebIDBConnectionToClient::establishTransaction):
152         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
153         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
154         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
155         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
156         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
157         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
158         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
159         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
160         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
161         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
162         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
163
164         Code moved from StorageToWebProcessConnection::didReceiveMessage.
165
166         (WebKit::NetworkConnectionToWebProcess::didClose):
167         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
168
169         Network process receives and stores sandbox extension of temporary files for later indexedDB
170         use.
171
172         (WebKit::NetworkConnectionToWebProcess::didClose):
173         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
174         (WebKit::generateIDBConnectionToServerIdentifier):
175         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
176         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
177         * NetworkProcess/NetworkConnectionToWebProcess.h:
178         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
179         * NetworkProcess/NetworkProcess.cpp:
180         (WebKit::NetworkProcess::NetworkProcess):
181         (WebKit::NetworkProcess::initializeNetworkProcess):
182         (WebKit::NetworkProcess::addWebsiteDataStore):
183         (WebKit::NetworkProcess::fetchWebsiteData):
184         (WebKit::NetworkProcess::deleteWebsiteData):
185         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
186         (WebKit::NetworkProcess::idbServer):
187         (WebKit::NetworkProcess::ensurePathExists):
188         (WebKit::NetworkProcess::postStorageTask):
189         (WebKit::NetworkProcess::performNextStorageTask):
190         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
191         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
192         (WebKit::NetworkProcess::indexedDatabaseOrigins):
193         (WebKit::NetworkProcess::addIndexedDatabaseSession):
194         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
195
196         Instead of asking UI process to grant sandbox extension to storage process, now network 
197         process just asks for sandbox extension fot itself.
198
199         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
200         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
201         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
202         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
203         * NetworkProcess/NetworkProcess.h:
204         * NetworkProcess/NetworkProcess.messages.in:
205         * NetworkProcess/NetworkProcessCreationParameters.cpp:
206         (WebKit::NetworkProcessCreationParameters::encode const):
207         (WebKit::NetworkProcessCreationParameters::decode):
208         * NetworkProcess/NetworkProcessCreationParameters.h:
209         * Shared/Storage/StorageProcessCreationParameters.cpp:
210         (WebKit::StorageProcessCreationParameters::encode const):
211         (WebKit::StorageProcessCreationParameters::decode):
212         * Shared/Storage/StorageProcessCreationParameters.h:
213         * Shared/WebsiteDataStoreParameters.cpp:
214         (WebKit::WebsiteDataStoreParameters::encode const):
215         (WebKit::WebsiteDataStoreParameters::decode):
216         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
217         * Shared/WebsiteDataStoreParameters.h:
218         * Sources.txt:
219         * StorageProcess/StorageProcess.cpp:
220         (WebKit::StorageProcess::initializeWebsiteDataStore):
221         (WebKit::StorageProcess::fetchWebsiteData):
222         (WebKit::StorageProcess::deleteWebsiteData):
223         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
224         (WebKit::StorageProcess::idbServer): Deleted.
225         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
226         (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
227         (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
228         (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
229         (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
230         (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
231         * StorageProcess/StorageProcess.h:
232         (WebKit::StorageProcess::queue): Deleted.
233         * StorageProcess/StorageProcess.messages.in:
234         * StorageProcess/StorageToWebProcessConnection.cpp:
235         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
236         (WebKit::StorageToWebProcessConnection::didClose):
237         (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
238         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
239         (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
240         * StorageProcess/StorageToWebProcessConnection.h:
241         * StorageProcess/StorageToWebProcessConnection.messages.in:
242         * UIProcess/Network/NetworkProcessProxy.cpp:
243         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
244         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
245         * UIProcess/Network/NetworkProcessProxy.h:
246         * UIProcess/Network/NetworkProcessProxy.messages.in:
247         * UIProcess/Storage/StorageProcessProxy.cpp:
248         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
249         * UIProcess/Storage/StorageProcessProxy.h:
250         * UIProcess/Storage/StorageProcessProxy.messages.in:
251         * UIProcess/WebProcessPool.cpp:
252         (WebKit::WebProcessPool::ensureNetworkProcess):
253         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
254         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
255         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
256         (WebKit::WebsiteDataStore::parameters):
257         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
258         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
259         (WebKit::WebsiteDataStore::fetchDataAndApply):
260         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
261         (WebKit::WebsiteDataStore::removeData):
262         (WebKit::WebsiteDataStore::storageProcessParameters):
263         (WebKit::WebsiteDataStore::parameters):
264         * WebKit.xcodeproj/project.pbxproj:
265         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
266         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
267         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
268         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
269         * WebProcess/Databases/WebDatabaseProvider.cpp:
270         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
271         * WebProcess/Network/NetworkProcessConnection.cpp:
272         (WebKit::NetworkProcessConnection::didReceiveMessage):
273         (WebKit::NetworkProcessConnection::didClose):
274         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
275         * WebProcess/Network/NetworkProcessConnection.h:
276         (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier const):
277         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
278         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
279         (WebKit::WebToStorageProcessConnection::didClose):
280         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
281         * WebProcess/Storage/WebToStorageProcessConnection.h:
282         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
283         * WebProcess/WebProcess.cpp:
284         (WebKit::WebProcess::networkProcessConnectionClosed):
285         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
286
287 2018-09-08  Darin Adler  <darin@apple.com>
288
289         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
290         https://bugs.webkit.org/show_bug.cgi?id=189455
291
292         Reviewed by Keith Miller.
293
294         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
295         (WebKit::toJSString): Use adopt function instead of adopt construuctor.
296         (WebKit::evaluate): Ditto.
297         (WebKit::evaluateJavaScriptCallback): Ditto.
298         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Ditto.
299
300 2018-09-14  Matt Lewis  <jlewis3@apple.com>
301
302         Unreviewed, rolling out r236020.
303
304         This caused an api failure on High Sierra
305
306         Reverted changeset:
307
308         "Refactoring related to Safe Browsing"
309         https://bugs.webkit.org/show_bug.cgi?id=189631
310         https://trac.webkit.org/changeset/236020
311
312 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
313
314         [Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
315         https://bugs.webkit.org/show_bug.cgi?id=189530
316
317         Reviewed by Alex Christensen.
318
319         Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
320         Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
321
322         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
323         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
324         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
325         (WebKit::NetworkDataTaskCurl::restartWithCredential):
326         * NetworkProcess/curl/NetworkDataTaskCurl.h:
327
328 2018-09-14  Alex Christensen  <achristensen@webkit.org>
329
330         Refactoring related to Safe Browsing
331         https://bugs.webkit.org/show_bug.cgi?id=189631
332
333         Reviewed by Tim Horton.
334
335         Make SafeBrowsingResult RefCounted.
336         Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
337
338         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
339         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
340         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
341         (WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
342         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
343         (WebKit::WebPageProxy::startDrag): Deleted.
344         (WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
345         (WebKit::WebPageProxy::setDragCaretRect): Deleted.
346         (WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
347         (WebKit::WebPageProxy::platformCloneAttachment): Deleted.
348         * UIProcess/SafeBrowsingResult.h:
349         (WebKit::SafeBrowsingResult::create):
350         * UIProcess/WebFramePolicyListenerProxy.cpp:
351         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
352         * UIProcess/WebFramePolicyListenerProxy.h:
353         * UIProcess/WebFrameProxy.cpp:
354         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
355         * UIProcess/WebFrameProxy.h:
356         * UIProcess/WebPageProxy.cpp:
357         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
358         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
359         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
360         (WebKit::WebPageProxy::decidePolicyForResponse):
361         * UIProcess/WebPageProxy.h:
362
363 2018-09-14  Geoffrey Garen  <ggaren@apple.com>
364
365         Clarify the configuration used by WKUIDelegate's createWebViewWithConfiguration
366         https://bugs.webkit.org/show_bug.cgi?id=189634
367
368         Reviewed by Tim Horton.
369
370         * UIProcess/API/Cocoa/WKUIDelegate.h:
371
372 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
373
374         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
375         https://bugs.webkit.org/show_bug.cgi?id=189521
376
377         Reviewed by Tim Horton.
378
379         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
380         
381         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
382         
383         Added some helper functions to null out a RefPtr<GraphicsLayer> after removing from the tree,
384         clearing the client. GraphicsLayer.m_client becomes a pointer, so it can be set to point to a singleton
385         empty client when a GraphicsLayer gets detached from its owner. More explicit layer unparenting,
386         and removed some unnecessary parent checks, and redundant unparenting.
387         
388         Other changes are just to adapt to the new ownership patterns.
389         
390         I verified that no GraphicsLayers were leaked or abandoned after this change.
391
392         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
393         (WebKit::WebInspectorClient::~WebInspectorClient):
394         (WebKit::WebInspectorClient::showPaintRect):
395         (WebKit::WebInspectorClient::animationEndedForLayer):
396         * WebProcess/WebCoreSupport/WebInspectorClient.h:
397         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
398         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
399         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
400         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
401         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
402         (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
403         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
404
405 2018-09-14  Eric Carlson  <eric.carlson@apple.com>
406
407         Support arbitrary video resolution in getUserMedia API
408         https://bugs.webkit.org/show_bug.cgi?id=178109
409         <rdar://problem/35083128>
410
411         Reviewed by Youenn Fablet.
412
413         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
414
415 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
416
417         [Curl][WebKit] Bug fix for continuously retrying with empty credentials.
418         https://bugs.webkit.org/show_bug.cgi?id=189601
419
420         Reviewed by Alex Christensen.
421
422         Added stop condition for empty credentials passed by client.
423
424         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
425         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
426         (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
427         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
428         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
429         * NetworkProcess/curl/NetworkDataTaskCurl.h:
430
431 2018-09-14  Jer Noble  <jer.noble@apple.com>
432
433         Turn SourceBufferChangeTypeEnabled on by default
434         https://bugs.webkit.org/show_bug.cgi?id=189527
435
436         Reviewed by Eric Carlson.
437
438         * Shared/WebPreferences.yaml:
439         * UIProcess/API/C/WKPreferencesRefPrivate.h:
440
441 2018-09-14  Michael Catanzaro  <mcatanzaro@igalia.com>
442
443         Unreviewed, speculative WPE build fix after r236004
444         https://bugs.webkit.org/show_bug.cgi?id=189545
445
446         * UIProcess/API/wpe/WebKitScriptDialog.h:
447
448 2018-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
449
450         [GTK] Make script dialogs modal to the current web view only
451         https://bugs.webkit.org/show_bug.cgi?id=189545
452
453         Reviewed by Michael Catanzaro.
454
455         Change the default implementation of script dialogs to use an embedded window, like the HTTP auth dialog,
456         instead of a GtkMessageDialog. This patch adds a base class WebKitWebViewDialog shared by
457         WebKitAuthenticationDialog and the new WebKitScriptDialogImpl.
458
459         * SourcesGTK.txt: Add new files to compilation.
460         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
461         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
462         (webkitAuthenticationDialogInitialize): Do not use a frame and use a better styled title.
463         (webkit_authentication_dialog_class_init): Remove implementation of vfuncs that are now implemented by the
464         parent.
465         * UIProcess/API/gtk/WebKitAuthenticationDialog.h:
466         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
467         (webkitScriptDialogAccept): Use WebKitScriptDialogImpl API.
468         (webkitScriptDialogDismiss): Ditto.
469         (webkitScriptDialogSetUserInput): Ditto.
470         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp: Added.
471         (webkitScriptDialogImplClose):
472         (webkitScriptDialogImplKeyPressEvent):
473         (webkitScriptDialogImplMap):
474         (webkitScriptDialogImplConstructed):
475         (webkitScriptDialogImplDispose):
476         (webkit_script_dialog_impl_class_init):
477         (webkitScriptDialogImplAddButton):
478         (webkitScriptDialogImplNew):
479         (webkitScriptDialogImplCancel):
480         (webkitScriptDialogImplConfirm):
481         (webkitScriptDialogImplSetEntryText):
482         * UIProcess/API/gtk/WebKitScriptDialogImpl.h: Added.
483         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
484         (webkitWebViewChildIsInternalWidget): Rename authenticationDialog as just dialog.
485         (webkitWebViewBaseAddDialog): Ditto.
486         (webkitWebViewBaseContainerRemove): Ditto.
487         (webkitWebViewBaseContainerForall): Ditto.
488         (webkitWebViewBaseConstructed): Ditto.
489         (webkitWebViewBaseSizeAllocate): Ditto.
490         (webkitWebViewBaseKeyPressEvent): Ditto.
491         (webkitWebViewBaseHandleMouseEvent): Ditto.
492         (webkitWebViewBaseButtonPressEvent): Ditto.
493         (webkitWebViewBaseButtonReleaseEvent): Ditto.
494         (webkitWebViewBaseHandleWheelEvent): Ditto.
495         (webkitWebViewBaseScrollEvent): Ditto.
496         (webkitWebViewBaseMotionNotifyEvent): Ditto.
497         (webkitWebViewBaseCrossingNotifyEvent): Ditto.
498         (webkitWebViewBaseTouchEvent): Ditto.
499         (webkitWebViewBaseFocus): Ditto.
500         (webkitWebViewBaseDestroy): Ditto.
501         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
502         * UIProcess/API/gtk/WebKitWebViewDialog.cpp: Added.
503         (webkitWebViewDialogDraw):
504         (webkitWebViewDialogSizeAllocate):
505         (webkitWebViewDialogConstructed):
506         (webkit_web_view_dialog_class_init):
507         * UIProcess/API/gtk/WebKitWebViewDialog.h: Added.
508         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
509         (webkitWebViewAuthenticate):
510         (webkitWebViewScriptDialog):
511
512 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
513
514         Unreviewed, rolling out r235954.
515
516         Breaks the watchOS build.
517
518         Reverted changeset:
519
520         "Move IndexedDB to Network Process"
521         https://bugs.webkit.org/show_bug.cgi?id=189415
522         https://trac.webkit.org/changeset/235954
523
524 2018-09-13  Chris Dumez  <cdumez@apple.com>
525
526         Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
527         https://bugs.webkit.org/show_bug.cgi?id=189590
528         <rdar://problem/44422725>
529
530         Reviewed by Geoffrey Garen.
531
532         If script calls window.open() without 'noopener' and the newly navigated window gets navigated cross-site,
533         we are currently unable to process-swap because the opener has a WindowProxy handle to this new Window and
534         may interact with it (which we currently do not support cross-process). We were dealing with this by not
535         process-swapping if window.opener is not null. This works most of the time but is not sufficient because the
536         opener may get nulled out, while the opener still has a valid WindowProxy handle to its openee.
537
538         Therefore, we now also check for a flag indicating if the frame was opened via window.open() without
539         'nooopener'. We still need to check if the browsing context has an opener for browsing context created
540         via <a target="_blank"> for example (the opener does not have a handle to the new window but the openee
541         has access to its opener).
542
543         * Shared/NavigationActionData.cpp:
544         (WebKit::NavigationActionData::encode const):
545         (WebKit::NavigationActionData::decode):
546         * Shared/NavigationActionData.h:
547         * UIProcess/API/APINavigation.h:
548         (API::Navigation::openedViaWindowOpenWithOpener const):
549         (API::Navigation::setOpenedViaWindowOpenWithOpener):
550         * UIProcess/WebPageProxy.cpp:
551         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
552         * UIProcess/WebProcessPool.cpp:
553         (WebKit::WebProcessPool::processForNavigationInternal):
554         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
555         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
556
557 2018-09-13  Dean Jackson  <dino@grorg.org>
558
559         Generate warnings for Preferences files
560         https://bugs.webkit.org/show_bug.cgi?id=189573
561
562         Reviewed by Sam Weinig.
563
564         Generate the "DO NOT EDIT" warnings, rather than have
565         them in the template (which was confusing).
566
567         While here, simplify some of the templating generation code
568         to avoid duplication.
569
570         * Scripts/GeneratePreferences.rb:
571         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
572         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
573         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
574         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
575         * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb:
576         * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb:
577         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
578
579 2018-09-13  Keith Rollin  <krollin@apple.com>
580
581         WebPageProxy::reportPageLoadResult can crash on some code paths
582         https://bugs.webkit.org/show_bug.cgi?id=189568
583
584         Reviewed by Chris Dumez.
585
586         WebPageProxy::reportPageLoadResult (which is called from
587         WebPageProxy::didFinishLoadForFrame) can sometimes crash when
588         accessing m_pageLoadStart (a std::optional) in its unloaded state.
589         Normally, m_pageLoadStart is initialized in
590         WebPageProxy::didStartProvisionalLoadForFrame, which one would expect
591         would be called before WebPageProxy::didFinishLoadForFrame. But that
592         turns out to not always be the case. It's not apparent under what
593         conditions didStartProvisionalLoadForFrame will not be called, but
594         it's happening in the wild, leading to crashes now that std::optional
595         asserts in release builds on bad accesses (see
596         https://bugs.webkit.org/show_bug.cgi?id=189568).
597
598         Fix this by checking m_pageLoadState on entry to reportPageLoadResult.
599
600         * UIProcess/WebPageProxy.cpp:
601         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
602         (WebKit::WebPageProxy::didFinishLoadForFrame):
603         (WebKit::WebPageProxy::didFailLoadForFrame):
604         (WebKit::WebPageProxy::reportPageLoadResult):
605
606 2018-09-13  Chris Dumez  <cdumez@apple.com>
607
608         ProcessSwap.BackWithoutSuspendedPage API test hits assertion under WebPageProxy::didCreateMainFrame()
609         https://bugs.webkit.org/show_bug.cgi?id=189599
610
611         Reviewed by Geoffrey Garen.
612
613         The code in WebPageProxy::reattachToWebProcess() was re-initializing m_mainFrame unconditionally in case
614         of a HistoryNavigation. The reason we need to initialize m_mainFrame in reattachToWebProcess() is if the
615         process we're reattaching to already has a WebPage (with a main frame), in which case
616         WebPageProxy::didCreateMainFrame() would not get called to initialize WebPageProxy::m_mainFrame.
617
618         The process we're reattaching to can be in such a state only if it comes from a SuspendedPageProxy (we
619         detached the WebProcessProxy from the WebPageProxy but kept the WebPage in the "suspended" WebProcess).
620         It is true that we're only reattaching to a SuspendedPageProxy's process in the event of history
621         navigations. However, it is not true that all history navigations will use a SuspendedPageProxy's process.
622         For example, no SuspendedPageProxy may be available for the history navigation because the history
623         was restored to a new view from disk, or because the WebBackForwardListItem no longer has a
624         SuspendedPageProxy (we currently only keep a single SuspendedPageProxy for the last HistoryItem).
625
626         Therefore, unconditionally initializating m_mainFrame in reattachToWebProcess() for history navigations
627         is incorrect and we should instead check if we're reattaching to a SuspendedPage's process.
628
629         Change is covered by ProcessSwap.BackWithoutSuspendedPage API test which is no longer crashes and
630         existing Back/Forward PSON API tests which are still passing.
631
632         * UIProcess/WebPageProxy.cpp:
633         (WebKit::WebPageProxy::reattachToWebProcess):
634         (WebKit::WebPageProxy::continueNavigationInNewProcess):
635         * UIProcess/WebPageProxy.h:
636
637 2018-09-13  Chris Dumez  <cdumez@apple.com>
638
639         Add release logging to help debug PSON issues
640         https://bugs.webkit.org/show_bug.cgi?id=189562
641
642         Reviewed by Ryosuke Niwa.
643
644         Add release logging to help debug issues related to process swap on navigation.
645
646         * UIProcess/WebPageProxy.cpp:
647         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
648         * UIProcess/WebProcessPool.cpp:
649         (WebKit::WebProcessPool::processForNavigation):
650         (WebKit::WebProcessPool::processForNavigationInternal):
651         * UIProcess/WebProcessPool.h:
652
653 2018-09-13  Chris Dumez  <cdumez@apple.com>
654
655         Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
656         https://bugs.webkit.org/show_bug.cgi?id=189587
657
658         Reviewed by Geoffrey Garen.
659
660         Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
661         as this is causing crashes on the bots.
662
663         * WebProcess/WebPage/WebPage.cpp:
664         (WebKit::WebPage::didCompletePageTransition):
665
666 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
667
668         Unreviewed, rolling out r235953.
669
670         Caused layout test crashes under GuardMalloc.
671
672         Reverted changeset:
673
674         "Make GraphicsLayers ref-counted, so their tree can persist
675         when disconnected from RenderLayerBackings"
676         https://bugs.webkit.org/show_bug.cgi?id=189521
677         https://trac.webkit.org/changeset/235953
678
679 2018-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
680
681         [GTK][WPE] Allow to run script dialogs asynchronously in the UI process
682         https://bugs.webkit.org/show_bug.cgi?id=189544
683
684         Reviewed by Michael Catanzaro.
685
686         Script dialogs are sync in the WebProcess, but we don't need to block the UI process while they are running. Our
687         current API doesn't allow it, because it always expects the dialog to be closed in the signal handler. API
688         changes are backwards compatible.
689
690         * UIProcess/API/glib/WebKitScriptDialog.cpp:
691         (webkitScriptDialogCreate): Added to heap allocate a WebKitScriptDialog.
692         (webkitScriptDialogIsRunning): Common implementation here, a script dialog is considered to be running if it has
693         a competion handler pending.
694         (webkit_script_dialog_ref): WebKitScriptDialog is now refcounted.
695         (webkit_script_dialog_unref): Ditto.
696         (webkit_script_dialog_close): New method to notify that we are done with the dialog.
697         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
698         (_WebKitScriptDialog::_WebKitScriptDialog): Use a single constructor and keep the completion handler.
699         * UIProcess/API/glib/WebKitUIClient.cpp: Do not call the completion handler, pass it to the web view.
700         * UIProcess/API/glib/WebKitWebView.cpp:
701         (webkitWebViewDispose): Close the current script dialog if there's any.
702         (webkit_web_view_class_init): Document how to handle dialogs asynchronously.
703         (webkitWebViewRunJavaScriptAlert): Do not stack allocate the WebKitScriptDialog, create it with
704         webkitScriptDialogCreate() passing the completion handler.
705         (webkitWebViewRunJavaScriptConfirm): Ditto.
706         (webkitWebViewRunJavaScriptPrompt): Ditto.
707         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
708         * UIProcess/API/glib/WebKitWebViewPrivate.h:
709         * UIProcess/API/gtk/WebKitScriptDialog.h:
710         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
711         (scriptDialogResponseCallback): Hnadle the response callback.
712         (webkitScriptDialogRun): Do not use gtk_dialog_run(), connect to response signal and show the dialogs instead.
713         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
714         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
715         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
716
717 2018-09-12  Dan Bernstein  <mitz@apple.com>
718
719         Update availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM seed
720         https://bugs.webkit.org/show_bug.cgi?id=189561
721
722         Reviewed by Tim Horton.
723
724         Changed WK_MAC_TBA and WK_IOS_TBA to 10.14 and 12.0, respectively, in all declarations that
725         appear in the GM seed SDKs.
726
727         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
728         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
729         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
730         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
731         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
732         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
733         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
734         * UIProcess/API/Cocoa/WKViewPrivate.h:
735         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
736         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
737         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
738         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
739         * UIProcess/API/Cocoa/_WKAttachment.h:
740         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
741         * UIProcess/API/Cocoa/_WKAutomationSession.h:
742         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
743         * UIProcess/API/Cocoa/_WKFormInputSession.h:
744         * UIProcess/API/Cocoa/_WKInputDelegate.h:
745         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
746         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
747         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
748         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
749         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
750         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
751         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
752
753 2018-09-12  Dan Bernstein  <mitz@apple.com>
754
755         [Cocoa] Complete support for Paste as Quotation
756         https://bugs.webkit.org/show_bug.cgi?id=189504
757
758         Reviewed by Wenson Hsieh.
759
760         * UIProcess/API/Cocoa/WKWebView.mm:
761         (-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included
762           in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate
763           category. If we add more actions in the category, it could make sense to fold them into
764           a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION.
765         (-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:.
766         (-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView.
767         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action.
768
769         * UIProcess/Cocoa/WebViewImpl.mm:
770         (WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the
771           PasteAsQuotation command.
772
773         * UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action.
774         * UIProcess/ios/WKContentViewInteraction.mm:
775           Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its
776           behavior.
777         (-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page.
778
779 2018-09-12  Sihui Liu  <sihui_liu@apple.com>
780
781         Move IndexedDB to Network Process
782         https://bugs.webkit.org/show_bug.cgi?id=189415
783
784         Reviewed by Geoffrey Garen.
785
786         We are going to eliminate storage process and move its functionality to network process. 
787         The reasons why we want to do this:
788         1. Lower resource usage of having an additional process for storage operations, especially
789         memory. Single storage process takes about 5MB memory on macOS.
790         2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
791         regression in app launch. The launch time of storage process is partly attributed to this:
792         Service Workers delay page loading until receiving response from storage process.
793         3. We choose network process because UI process may have broader access in file system
794         that we don't want the storage operations to have.
795
796         This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
797         to corresponding components of network process. Moving of Service Worker and stopping to 
798         launch storage process will be done in following patches.
799
800         We expect to see the higher cpu and memory usage of network process as it is taking more work,
801         but the overall gain in memory and latency after we completely remove storage process should be 
802         positive.
803
804
805         * CMakeLists.txt:
806         * DerivedSources.make:
807
808         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
809         (WebKit::WebIDBConnectionToClient::create):
810         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
811         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
812         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
813         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
814         (WebKit::WebIDBConnectionToClient::connectionToClient):
815         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
816         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
817         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
818         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
819         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
820         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
821         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
822         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
823         (WebKit::WebIDBConnectionToClient::didCreateIndex):
824         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
825         (WebKit::WebIDBConnectionToClient::didRenameIndex):
826         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
827         (WebKit::WebIDBConnectionToClient::handleGetResult):
828         (WebKit::WebIDBConnectionToClient::didGetRecord):
829         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
830         (WebKit::WebIDBConnectionToClient::didGetCount):
831         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
832         (WebKit::WebIDBConnectionToClient::didOpenCursor):
833         (WebKit::WebIDBConnectionToClient::didIterateCursor):
834         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
835         (WebKit::WebIDBConnectionToClient::didStartTransaction):
836         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
837         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
838         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
839         (WebKit::WebIDBConnectionToClient::deleteDatabase):
840         (WebKit::WebIDBConnectionToClient::openDatabase):
841         (WebKit::WebIDBConnectionToClient::abortTransaction):
842         (WebKit::WebIDBConnectionToClient::commitTransaction):
843         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
844         (WebKit::WebIDBConnectionToClient::createObjectStore):
845         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
846         (WebKit::WebIDBConnectionToClient::renameObjectStore):
847         (WebKit::WebIDBConnectionToClient::clearObjectStore):
848         (WebKit::WebIDBConnectionToClient::createIndex):
849         (WebKit::WebIDBConnectionToClient::deleteIndex):
850         (WebKit::WebIDBConnectionToClient::renameIndex):
851         (WebKit::WebIDBConnectionToClient::putOrAdd):
852         (WebKit::WebIDBConnectionToClient::getRecord):
853         (WebKit::WebIDBConnectionToClient::getAllRecords):
854         (WebKit::WebIDBConnectionToClient::getCount):
855         (WebKit::WebIDBConnectionToClient::deleteRecord):
856         (WebKit::WebIDBConnectionToClient::openCursor):
857         (WebKit::WebIDBConnectionToClient::iterateCursor):
858         (WebKit::WebIDBConnectionToClient::establishTransaction):
859         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
860         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
861         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
862         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
863         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
864         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
865         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
866         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
867         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
868         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
869         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
870
871         Code moved from StorageToWebProcessConnection::didReceiveMessage.
872
873         (WebKit::NetworkConnectionToWebProcess::didClose):
874         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
875
876         Network process receives and stores sandbox extension of temporary files for later indexedDB
877         use.
878
879         (WebKit::generateIDBConnectionToServerIdentifier):
880         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
881         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
882         * NetworkProcess/NetworkConnectionToWebProcess.h:
883         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
884         * NetworkProcess/NetworkProcess.cpp:
885         (WebKit::NetworkProcess::NetworkProcess):
886         (WebKit::NetworkProcess::initializeNetworkProcess):
887         (WebKit::NetworkProcess::addWebsiteDataStore):
888         (WebKit::NetworkProcess::fetchWebsiteData):
889         (WebKit::NetworkProcess::deleteWebsiteData):
890         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
891         (WebKit::NetworkProcess::idbServer):
892         (WebKit::NetworkProcess::ensurePathExists):
893         (WebKit::NetworkProcess::postStorageTask):
894         (WebKit::NetworkProcess::performNextStorageTask):
895         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
896         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
897         (WebKit::NetworkProcess::indexedDatabaseOrigins):
898         (WebKit::NetworkProcess::addIndexedDatabaseSession):
899         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
900
901         Instead of asking UI process to grant sandbox extension to storage process, now network 
902         process just asks for sandbox extension fot itself.
903
904         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
905         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
906         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
907         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
908         * NetworkProcess/NetworkProcess.h:
909         (WebKit::NetworkProcess::queue):
910         * NetworkProcess/NetworkProcess.messages.in:
911         * NetworkProcess/NetworkProcessCreationParameters.cpp:
912         (WebKit::NetworkProcessCreationParameters::encode const):
913         (WebKit::NetworkProcessCreationParameters::decode):
914         * NetworkProcess/NetworkProcessCreationParameters.h:
915         * Shared/Storage/StorageProcessCreationParameters.cpp:
916         (WebKit::StorageProcessCreationParameters::encode const):
917         (WebKit::StorageProcessCreationParameters::decode):
918         * Shared/Storage/StorageProcessCreationParameters.h:
919         * Shared/WebsiteDataStoreParameters.cpp:
920         (WebKit::WebsiteDataStoreParameters::encode const):
921         (WebKit::WebsiteDataStoreParameters::decode):
922         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
923         * Shared/WebsiteDataStoreParameters.h:
924         * Sources.txt:
925         * StorageProcess/StorageProcess.cpp:
926         (WebKit::StorageProcess::initializeWebsiteDataStore):
927         (WebKit::StorageProcess::fetchWebsiteData):
928         (WebKit::StorageProcess::deleteWebsiteData):
929         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
930         (WebKit::StorageProcess::idbServer): Deleted.
931         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
932         (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
933         (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
934         (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
935         (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
936         (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
937         * StorageProcess/StorageProcess.h:
938         (WebKit::StorageProcess::queue): Deleted.
939         * StorageProcess/StorageProcess.messages.in:
940         * StorageProcess/StorageToWebProcessConnection.cpp:
941         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
942         (WebKit::StorageToWebProcessConnection::didClose):
943         (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
944         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
945         (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
946         * StorageProcess/StorageToWebProcessConnection.h:
947         * StorageProcess/StorageToWebProcessConnection.messages.in:
948         * UIProcess/Network/NetworkProcessProxy.cpp:
949         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
950         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
951         * UIProcess/Network/NetworkProcessProxy.h:
952         * UIProcess/Network/NetworkProcessProxy.messages.in:
953         * UIProcess/Storage/StorageProcessProxy.cpp:
954         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
955         * UIProcess/Storage/StorageProcessProxy.h:
956         * UIProcess/Storage/StorageProcessProxy.messages.in:
957         * UIProcess/WebProcessPool.cpp:
958         (WebKit::WebProcessPool::ensureNetworkProcess):
959         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
960         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
961         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
962         (WebKit::WebsiteDataStore::parameters):
963         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
964         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
965         (WebKit::WebsiteDataStore::fetchDataAndApply):
966         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
967         (WebKit::WebsiteDataStore::removeData):
968         (WebKit::WebsiteDataStore::storageProcessParameters):
969         (WebKit::WebsiteDataStore::parameters):
970         * WebKit.xcodeproj/project.pbxproj:
971         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
972         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
973         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
974         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
975         * WebProcess/Databases/WebDatabaseProvider.cpp:
976         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
977         * WebProcess/Network/NetworkProcessConnection.cpp:
978         (WebKit::NetworkProcessConnection::didReceiveMessage):
979         (WebKit::NetworkProcessConnection::didClose):
980         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
981         * WebProcess/Network/NetworkProcessConnection.h:
982         (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier):
983         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
984         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
985
986         Code moved from WebToStorageProcessConnection::didReceiveMessage.
987
988         (WebKit::WebToStorageProcessConnection::didClose):
989         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
990         * WebProcess/Storage/WebToStorageProcessConnection.h:
991         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
992         * WebProcess/WebProcess.cpp:
993         (WebKit::WebProcess::networkProcessConnectionClosed):
994         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
995
996 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
997
998         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
999         https://bugs.webkit.org/show_bug.cgi?id=189521
1000
1001         Reviewed by Tim Horton.
1002
1003         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
1004         
1005         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
1006         
1007         All the other changes are just to adapt to the new ownership patterns.
1008         
1009         I verified that no GraphicsLayers were leaked or abandoned after this change.
1010
1011         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1012         (WebKit::WebInspectorClient::~WebInspectorClient):
1013         (WebKit::WebInspectorClient::showPaintRect):
1014         (WebKit::WebInspectorClient::animationEndedForLayer):
1015         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1016         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
1017         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1018         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
1019         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1020         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1021         (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
1022         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1023
1024 2018-09-12  Chris Dumez  <cdumez@apple.com>
1025
1026         PSON: No process swap on back navigation after URL bar navigation
1027         https://bugs.webkit.org/show_bug.cgi?id=189557
1028         <rdar://problem/44353108>
1029
1030         Reviewed by Alex Christensen.
1031
1032         Our logic in WebProcessPool::processForNavigationInternal() was wrongly using
1033         WebBackForwardList::currentItem() as source item of the navigation, instead of
1034         using Navigation::fromItem(). In case of back navigation, by the time
1035         processForNavigation() is called, the WebBackForwardList's currentItem has already
1036         been updated to be the target item, via a Sync IPC from the WebProcess. As a result,
1037         the source and target items would be the same in the following check:
1038         ` if (currentItem->itemID().processIdentifier == backForwardListItem->itemID().processIdentifier)`
1039
1040         This would cause us to reuse the same process incorrectly. Our existing API test coverage
1041         did not catch this because our target HistoryItem usually has a SuspendedPage and we decide
1042         to use the SuspendedPage's process a few lines above in WebProcessPool::processForNavigationInternal().
1043
1044         * UIProcess/WebProcessPool.cpp:
1045         (WebKit::WebProcessPool::processForNavigationInternal):
1046
1047 2018-09-12  Alex Christensen  <achristensen@webkit.org>
1048
1049         Make IPC::SharedBufferDataReference a type that decodes into but does not inherit from IPC::DataReference
1050         https://bugs.webkit.org/show_bug.cgi?id=189519
1051
1052         Reviewed by Chris Dumez.
1053
1054         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1055         * NetworkProcess/NetworkResourceLoader.cpp:
1056         (WebKit::NetworkResourceLoader::bufferingTimerFired):
1057         (WebKit::NetworkResourceLoader::sendBuffer):
1058         * Platform/IPC/DataReference.cpp:
1059         (IPC::SharedBufferDataReference::encode const): Deleted.
1060         * Platform/IPC/DataReference.h:
1061         (IPC::SharedBufferDataReference::SharedBufferDataReference): Deleted.
1062         * Platform/IPC/HandleMessage.h:
1063         * Platform/IPC/SharedBufferDataReference.h: Added.
1064         (IPC::SharedBufferDataReference::SharedBufferDataReference):
1065         (IPC::SharedBufferDataReference::encode const):
1066         * Scripts/webkit/messages.py:
1067         * Shared/API/APIData.h:
1068         * StorageProcess/StorageProcess.messages.in:
1069         * UIProcess/WebPageProxy.messages.in:
1070         * UIProcess/WebURLSchemeTask.cpp:
1071         (WebKit::WebURLSchemeTask::didReceiveData):
1072         * WebKit.xcodeproj/project.pbxproj:
1073         * WebProcess/Network/WebLoaderStrategy.cpp:
1074         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1075         * WebProcess/Network/WebResourceLoader.messages.in:
1076         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1077         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
1078         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
1079         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1080         (WebKit::WebEditorClient::registerAttachmentIdentifier):
1081         * WebProcess/WebPage/WebPage.cpp:
1082         (WebKit::WebPage::getContentsAsMHTMLData):
1083         (WebKit::WebPage::getSelectionAsWebArchiveData):
1084         (WebKit::WebPage::getMainResourceDataOfFrame):
1085         (WebKit::WebPage::getResourceDataFromFrame):
1086         (WebKit::WebPage::getWebArchiveOfFrame):
1087         (WebKit::WebPage::drawPagesToPDF):
1088         * WebProcess/WebPage/WebPage.messages.in:
1089
1090 2018-09-11  Dean Jackson  <dino@apple.com>
1091
1092         Header parsing for experimental and internal debug features
1093         https://bugs.webkit.org/show_bug.cgi?id=189486
1094         <rdar://problem/44320618>
1095
1096         Reviewed by Tim Horton.
1097
1098         Provide key-based (string) access to experimental and internal features.
1099
1100         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1101         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
1102         * UIProcess/API/C/WKPreferences.cpp:
1103         (WKPreferencesSetExperimentalFeatureForKey):
1104         (WKPreferencesResetAllInternalDebugFeatures):
1105         (WKPreferencesSetInternalDebugFeatureForKey):
1106         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1107         * UIProcess/WebPreferences.h:
1108
1109 2018-09-10  Matt Rajca  <mrajca@apple.com>
1110
1111         Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
1112         https://bugs.webkit.org/show_bug.cgi?id=189478
1113         <rdar://problem/44312650>
1114
1115         Reviewed by Eric Carlson.
1116
1117         This patch exposes APIs necessary to toggle PIP and query its status from clients of WKWebView.
1118         The existing PIP test has been updated to use the new APIs instead of simulating mouse clicks.
1119         I also increased the size of the video element in the test page so it gets picked up by the
1120         main content heuristics.
1121
1122         * UIProcess/API/Cocoa/WKWebView.mm:
1123         (-[WKWebView _updateMediaPlaybackControlsManager]): Create a media playback controls manager if necessary.
1124         (-[WKWebView _isPictureInPictureActive]): Return true if the "active" media element is in PIP.
1125         (-[WKWebView _togglePictureInPicture]): Toggle PIP on the "active" media element.
1126         (-[WKWebView _canTogglePictureInPicture]): Renamed from...
1127         (-[WKWebView _canTogglePictureInPictureForTesting]):
1128         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1129         * UIProcess/Cocoa/WebViewImpl.h:
1130         * UIProcess/Cocoa/WebViewImpl.mm:
1131         (WebKit::WebViewImpl::isPictureInPictureActive): Return true if the "active" media element is in PIP.
1132         (WebKit::WebViewImpl::togglePictureInPicture): Toggle PIP on the "active" media element.
1133         (WebKit::WebViewImpl::updateMediaPlaybackControlsManager): Let clients create a playback
1134          controls manager even when there is no Touch Bar present.
1135         (WebKit::WebViewImpl::updateMediaTouchBar): Extract some code into a helper method.
1136         (WebKit::WebViewImpl::canTogglePictureInPicture): Renamed from...
1137         (WebKit::WebViewImpl::canTogglePictureInPictureForTesting):
1138
1139 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1140
1141         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
1142         https://bugs.webkit.org/show_bug.cgi?id=189542
1143
1144         Reviewed by Alex Christensen.
1145
1146         * UIProcess/win/WebInspectorProxyWin.cpp:
1147         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Narrowed initialWindowWidth and initialWindowHeight by using static_cast.
1148
1149 2018-09-12  Chris Dumez  <cdumez@apple.com>
1150
1151         Clean up SuspendedPageProxy
1152         https://bugs.webkit.org/show_bug.cgi?id=189517
1153
1154         Reviewed by Alex Christensen.
1155
1156         Clean up SuspendedPageProxy:
1157         1. SuspendedPageProxy does not need to be RefCounted. It is even dangerous given that WebPageProxy
1158            owns the SuspendedPageProxy and SuspendedPageProxy has a WebPageProxy& data member. We definitely
1159            do not want it to outlive its WebPageProxy.
1160         2. The SuspendedPageProxy destructor does not need to be virtual.
1161         3. Have WebBackForwardListItem keep a WeakPtr<SuspendedPageProxy> instead of a SuspendedPageProxy*.
1162            This is safer and avoid having to explicitly clear the pointer.
1163         4. m_finishedSuspending data member does not need a getter and is only needed if !LOG_DISABLED.
1164
1165         * Shared/WebBackForwardListItem.cpp:
1166         (WebKit::WebBackForwardListItem::setSuspendedPage):
1167         * Shared/WebBackForwardListItem.h:
1168         (WebKit::WebBackForwardListItem::suspendedPage const):
1169         * UIProcess/SuspendedPageProxy.cpp:
1170         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1171         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1172         (WebKit::SuspendedPageProxy::webProcessDidClose):
1173         (WebKit::SuspendedPageProxy::didFinishLoad):
1174         * UIProcess/SuspendedPageProxy.h:
1175         (WebKit::SuspendedPageProxy::process const):
1176         * UIProcess/WebPageProxy.cpp:
1177         (WebKit::WebPageProxy::maybeCreateSuspendedPage):
1178         (WebKit::WebPageProxy::reattachToWebProcess):
1179         * UIProcess/WebPageProxy.h:
1180
1181 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
1182
1183         Add IGNORE_WARNING_.* macros
1184         https://bugs.webkit.org/show_bug.cgi?id=188996
1185
1186         Reviewed by Michael Catanzaro.
1187
1188         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1189         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
1190         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1191         (WebKit::NetworkProcess::platformSyncAllCookies):
1192         * PluginProcess/mac/PluginProcessMac.mm:
1193         (WebKit::beginModal):
1194         * PluginProcess/mac/PluginProcessShim.mm:
1195         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1196         (WebKit::NetscapePluginModule::tryLoad):
1197         * Shared/ios/ChildProcessIOS.mm:
1198         (WebKit::ChildProcess::initializeSandbox):
1199         * Shared/mac/ChildProcessMac.mm:
1200         (WebKit::compileAndApplySandboxSlowCase):
1201         * Shared/mac/ColorSpaceData.mm:
1202         (WebKit::ColorSpaceData::decode):
1203         * Shared/mac/SandboxExtensionMac.mm:
1204         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
1205         * UIProcess/API/Cocoa/WKWebView.mm:
1206         (-[WKWebView _web_superAccessibilityAttributeValue:]):
1207         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1208         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1209         * UIProcess/API/glib/WebKitWebView.cpp:
1210         (webkitWebViewRunAsModal):
1211         * UIProcess/API/mac/WKView.mm:
1212         (-[WKView _web_superAccessibilityAttributeValue:]):
1213         * UIProcess/Cocoa/DownloadClient.mm:
1214         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
1215         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
1216         (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
1217         * UIProcess/Cocoa/NavigationState.mm:
1218         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1219         * UIProcess/Cocoa/UIDelegate.mm:
1220         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1221         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1222         (WebKit::WebProcessPool::platformInitializeWebProcess):
1223         * UIProcess/Cocoa/WebViewImpl.mm:
1224         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
1225         (WebKit::WebViewImpl::updateWindowAndViewFrames):
1226         (WebKit::WebViewImpl::sendDragEndToPage):
1227         (WebKit::WebViewImpl::startDrag):
1228         (WebKit::WebViewImpl::characterIndexForPoint):
1229         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1230         (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
1231         (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
1232         (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
1233         (WebKit::PluginProcessProxy::exitFullscreen):
1234         * UIProcess/ios/SmartMagnificationController.mm:
1235         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1236         * UIProcess/ios/WKLegacyPDFView.mm:
1237         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
1238         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
1239         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1240         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1241         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
1242         * UIProcess/ios/forms/WKFormColorControl.mm:
1243         (-[WKColorPopover initWithView:]):
1244         * UIProcess/ios/forms/WKFormInputControl.mm:
1245         (-[WKDateTimePopover initWithView:datePickerMode:]):
1246         * UIProcess/ios/forms/WKFormPopover.h:
1247         * UIProcess/ios/forms/WKFormPopover.mm:
1248         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1249         (-[WKSelectPopover initWithView:hasGroups:]):
1250         * UIProcess/mac/PageClientImplMac.mm:
1251         (WebKit::PageClientImpl::screenToRootView):
1252         (WebKit::PageClientImpl::rootViewToScreen):
1253         * UIProcess/mac/WKFullScreenWindowController.mm:
1254         (-[WKFullScreenWindowController enterFullScreen:]):
1255         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1256         (-[WKFullScreenWindowController exitFullScreen]):
1257         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1258         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1259         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
1260         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1261         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
1262         * UIProcess/mac/WKPrintingView.mm:
1263         (-[WKPrintingView _setAutodisplay:]):
1264         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
1265         (-[WKPrintingView _drawPreview:]):
1266         (-[WKPrintingView drawRect:]):
1267         * UIProcess/mac/WKTextInputWindowController.mm:
1268         (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
1269         (-[WKTextInputPanel _hasMarkedText]):
1270         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1271         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1272         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1273         (WebKit::initializeEventRecord):
1274         (WebKit::NetscapePlugin::sendComplexTextInput):
1275         (WebKit::makeCGLPresentLayerOpaque):
1276         (WebKit::NetscapePlugin::nullEventTimerFired):
1277         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1278         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
1279         (-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]):
1280         (WebKit::PDFPlugin::handleEditingCommand):
1281         (WebKit::PDFPlugin::setActiveAnnotation):
1282         (WebKit:: const):
1283         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
1284         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1285         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
1286         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
1287         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1288         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
1289         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
1290         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1291         (WebKit::convertImageToBitmap):
1292         (WebKit::WebDragClient::declareAndWriteDragImage):
1293         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1294         * WebProcess/WebPage/mac/WebPageMac.mm:
1295         (WebKit::drawPDFPage):
1296
1297 2018-09-11  Olivia Barnett  <obarnett@apple.com>
1298
1299         Implement the Web Share API for mac
1300         https://bugs.webkit.org/show_bug.cgi?id=189443
1301
1302         Reviewed by Tim Horton.
1303
1304         * Shared/WebPreferencesDefaultValues.h:
1305         * UIProcess/API/Cocoa/WKWebView.mm:
1306         (-[WKWebView shareSheetDidDismiss:]):
1307         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1308         * UIProcess/API/mac/WKView.mm:
1309         (-[WKView shareSheetDidDismiss:]):
1310         * UIProcess/Cocoa/WebViewImpl.h:
1311         * UIProcess/Cocoa/WebViewImpl.mm:
1312         (WebKit::WebViewImpl::showShareSheet):
1313         (WebKit::WebViewImpl::shareSheetDidDismiss):
1314         Implemented function for WKShareSheetDelegate.
1315
1316         * UIProcess/Cocoa/WKShareSheet.h:
1317         * UIProcess/Cocoa/WKShareSheet.mm:
1318         (-[WKShareSheet initWithView:initWithView:]):
1319         (-[WKShareSheet presentWithParameters:completionHandler:]):
1320         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
1321         (-[WKShareSheet _cancel]):
1322         (-[WKShareSheet dismiss]):
1323         (-[WKShareSheet _dismissDisplayAnimated:]):
1324         (-[WKShareSheet invokeShareSheetWithResolution:]):
1325         (-[WKShareSheet initWithView:]): Deleted.
1326         Added mac platform checks and share sheet functionality.
1327
1328         * UIProcess/mac/PageClientImplMac.h:
1329         * UIProcess/mac/PageClientImplMac.mm:
1330         (WebKit::PageClientImpl::showShareSheet):
1331         Allows macos to invoke the system share sheet.
1332
1333 2018-09-07  Dean Jackson  <dino@apple.com>
1334
1335         Add and expose Internal features from WebKit
1336         https://bugs.webkit.org/show_bug.cgi?id=189442
1337         <rdar://problem/44243404>
1338
1339         Reviewed by Simon Fraser.
1340
1341         Experimental features have become a mess. People are using them for
1342         anything that they want to be easily toggled from a host app (e.g.
1343         Safari), which means the user-facing menu has become large and
1344         confusing.
1345
1346         Introduce the idea of Internal features, that will be exposed in a way
1347         that end-users are not expected to ever see (unless they really want
1348         to).
1349
1350         * CMakeLists.txt: Add new files.
1351         * Sources.txt:
1352         * SourcesCocoa.txt:
1353         * WebKit.xcodeproj/project.pbxproj:
1354
1355         * DerivedSources.make: Add new generated files.
1356         * Scripts/GeneratePreferences.rb: Generate the preferences stuff for Internal Debug features.
1357         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1358         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: Added.
1359
1360         * Shared/API/APIObject.h: New API object for InternalDebugFeature.
1361         * Shared/Cocoa/APIObject.mm:
1362         (API::Object::newObject):
1363
1364         * Shared/WebPreferences.yaml: Change some of the existing experimental features to "internal".
1365
1366         * UIProcess/API/APIInternalDebugFeature.cpp: New API type - just like APIExperimentalFeature.
1367         (API::InternalDebugFeature::create):
1368         (API::InternalDebugFeature::InternalDebugFeature):
1369         (API::InternalDebugFeature::~InternalDebugFeature):
1370         * UIProcess/API/APIInternalDebugFeature.h:
1371         * UIProcess/API/C/WKAPICast.h:
1372
1373         * UIProcess/API/Cocoa/WKPreferences.mm: Change the naming of the experimental feature API so that it
1374         won't clash with internal debug features. We can remove the old API once Safari has adopted.
1375         (+[WKPreferences _internalDebugFeatures]):
1376         (-[WKPreferences _isEnabledForInternalDebugFeature:]):
1377         (-[WKPreferences _setEnabled:forInternalDebugFeature:]):
1378         (-[WKPreferences _isEnabledForFeature:]):
1379         (-[WKPreferences _setEnabled:forFeature:]):
1380         (-[WKPreferences _isEnabledForExperimentalFeature:]):
1381         (-[WKPreferences _setEnabled:forExperimentalFeature:]):
1382         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1383
1384         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h: New object - same as _WKExperimentalFeature.
1385         * UIProcess/API/Cocoa/_WKInternalDebugFeature.mm:
1386         (-[_WKInternalDebugFeature dealloc]):
1387         (-[_WKInternalDebugFeature description]):
1388         (-[_WKInternalDebugFeature name]):
1389         (-[_WKInternalDebugFeature key]):
1390         (-[_WKInternalDebugFeature details]):
1391         (-[_WKInternalDebugFeature defaultValue]):
1392         (-[_WKInternalDebugFeature isHidden]):
1393         (-[_WKInternalDebugFeature _apiObject]):
1394         * UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h:
1395
1396         * UIProcess/WebPreferences.cpp: Add support for Internal Debug features.
1397         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
1398         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
1399         * UIProcess/WebPreferences.h:
1400
1401         * UIProcess/WebProcessPool.cpp: Change a comment now that it is an internal feature.
1402         (WebKit::WebProcessPool::createWebPage):
1403
1404 2018-09-11  Eric Carlson  <eric.carlson@apple.com>
1405
1406         WebPage::close should clear UserMediaPermissionRequestManager
1407         https://bugs.webkit.org/show_bug.cgi?id=189369
1408         <rdar://problem/44196724>
1409
1410         Reviewed by Youenn Fablet.
1411
1412         * WebProcess/WebPage/WebPage.cpp:
1413         (WebKit::WebPage::close): Clear m_userMediaPermissionRequestManager.
1414
1415 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1416
1417         [macOS] [WK2] Support changing foreground colors via color panel
1418         https://bugs.webkit.org/show_bug.cgi?id=189382
1419         <rdar://problem/44227311>
1420
1421         Reviewed by Ryosuke Niwa.
1422
1423         Adds support for changing font color in a richly editable element in WebKit2 via NSColorPanel. See below for
1424         more detail, as well as the WebCore ChangeLog.
1425
1426         * UIProcess/API/Cocoa/WKWebView.mm:
1427         (-[WKWebView changeColor:]):
1428
1429         Implement this selector; AppKit calls into this when changing font color using NSColorPanel.
1430
1431         * UIProcess/Cocoa/WebViewImpl.h:
1432         * UIProcess/Cocoa/WebViewImpl.mm:
1433         (WebKit::WebViewImpl::changeFontColorFromSender):
1434
1435         Creates and populates new FontAttributeChanges, with only the foreground color determined by asking the sender
1436         object for its -color.
1437
1438         * WebProcess/WebPage/mac/WebPageMac.mm:
1439
1440         Use the relevant EditAction for the incoming FontAttributeChanges, instead of always specifying
1441         EditAction::ChangeAttributes.
1442
1443         (WebKit::WebPage::changeFontAttributes):
1444
1445 2018-09-11  Myles C. Maxfield  <mmaxfield@apple.com>
1446
1447         Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
1448         https://bugs.webkit.org/show_bug.cgi?id=188008
1449
1450         Reviewed by Alex Christensen.
1451
1452         This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307.
1453         Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code.
1454
1455         * Shared/cf/ArgumentCodersCF.cpp:
1456         (IPC::encode):
1457         (IPC::decode):
1458
1459 2018-09-11  Adrian Perez de Castro  <aperez@igalia.com>
1460
1461         [WPE][GTK] API documentation is unclear about how to modify requests before sending them
1462         https://bugs.webkit.org/show_bug.cgi?id=189505
1463
1464         Reviewed by Michael Catanzaro.
1465
1466         Add notes to the API documentation to make explicit where modification
1467         of WebKitURIRequest instances affects the request data sent over the
1468         network.
1469
1470         * UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that
1471         modifications to the associated WebKitURIRequest do not affect the
1472         actual request. Point to WebKitPage::send-request instead.
1473         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto.
1474         * UIProcess/API/glib/WebKitWebView.cpp:
1475         (webkit_web_view_class_init): Ditto for the description of the
1476         WebKitWebView::decide-policy signal. Also fix the syntax of example.
1477         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1478         (webkit_web_page_class_init): Indicate that modifications to the
1479         WebKitURIRequest will change the actual network request data.
1480
1481 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1482
1483         Unreviewed, attempt to fix Apple builds after r235903
1484         https://bugs.webkit.org/show_bug.cgi?id=188872
1485
1486         If it really needs to be inlined, it will need to move to the header....
1487
1488         * UIProcess/WebPageProxy.cpp:
1489         (WebKit::WebPageProxy::pageClient const):
1490
1491 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1492
1493         Unreviewed, fix build after r235903
1494         https://bugs.webkit.org/show_bug.cgi?id=188872
1495
1496         This broke all ports except GTK. Need to add a missing header.
1497
1498         * UIProcess/PageClient.h:
1499
1500 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
1501
1502         Add missing #if ENABLE(VIDEO) WebProcess/FullScreen/WebFullScreenManager.cpp
1503         https://bugs.webkit.org/show_bug.cgi?id=189506
1504
1505         Reviewed by Tim Horton.
1506
1507         m_pipStandbyElement is only defined in
1508         WebKit/WebProcess/FullScreen/WebFullScreenManager.h
1509         only when ENABLE(VIDEO) (see
1510         https://bugs.webkit.org/show_bug.cgi?id=181338)
1511
1512         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1513         (WebKit::WebFullScreenManager::setPIPStandbyElement):
1514
1515 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1516
1517         WebPageProxy should hold a WeakPtr to its PageClient
1518         https://bugs.webkit.org/show_bug.cgi?id=188872
1519
1520         Reviewed by Ryosuke Niwa.
1521
1522         This ensures the PageClient reference is always valid when used.
1523
1524         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1525         (WebKit::WebPageProxy::startDrag):
1526         (WebKit::WebPageProxy::setDragCaretRect):
1527         * UIProcess/PageClient.h:
1528         * UIProcess/WebPageProxy.cpp:
1529         (WebKit::PageClientProtector::PageClientProtector):
1530         (WebKit::PageClientProtector::~PageClientProtector):
1531         (WebKit::WebPageProxy::WebPageProxy):
1532         (WebKit::m_resetRecentCrashCountTimer):
1533         (WebKit::WebPageProxy::pageClient const):
1534         (WebKit::WebPageProxy::reattachToWebProcess):
1535         (WebKit::WebPageProxy::initializeWebPage):
1536         (WebKit::WebPageProxy::close):
1537         (WebKit::WebPageProxy::didChangeBackForwardList):
1538         (WebKit::WebPageProxy::willGoToBackForwardListItem):
1539         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
1540         (WebKit::WebPageProxy::setViewNeedsDisplay):
1541         (WebKit::WebPageProxy::requestScroll):
1542         (WebKit::WebPageProxy::viewScrollPosition const):
1543         (WebKit::WebPageProxy::updateActivityState):
1544         (WebKit::WebPageProxy::activityStateDidChange):
1545         (WebKit::WebPageProxy::viewDidEnterWindow):
1546         (WebKit::WebPageProxy::dispatchActivityStateChange):
1547         (WebKit::WebPageProxy::layerHostingModeDidChange):
1548         (WebKit::WebPageProxy::viewSize const):
1549         (WebKit::WebPageProxy::startDrag):
1550         (WebKit::WebPageProxy::didPerformDragOperation):
1551         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
1552         (WebKit::WebPageProxy::findPlugin):
1553         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1554         (WebKit::WebPageProxy::handleTouchEvent):
1555         (WebKit::WebPageProxy::preferencesDidChange):
1556         (WebKit::WebPageProxy::didCreateMainFrame):
1557         (WebKit::WebPageProxy::didCreateSubframe):
1558         (WebKit::WebPageProxy::didStartProgress):
1559         (WebKit::WebPageProxy::didChangeProgress):
1560         (WebKit::WebPageProxy::didFinishProgress):
1561         (WebKit::WebPageProxy::didDestroyNavigation):
1562         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1563         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1564         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
1565         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
1566         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
1567         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1568         (WebKit::WebPageProxy::didCommitLoadForFrame):
1569         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1570         (WebKit::WebPageProxy::didFinishLoadForFrame):
1571         (WebKit::WebPageProxy::didFailLoadForFrame):
1572         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1573         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1574         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
1575         (WebKit::WebPageProxy::didReachLayoutMilestone):
1576         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
1577         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
1578         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
1579         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1580         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1581         (WebKit::WebPageProxy::decidePolicyForResponse):
1582         (WebKit::WebPageProxy::unableToImplementPolicy):
1583         (WebKit::WebPageProxy::didNavigateWithNavigationData):
1584         (WebKit::WebPageProxy::didPerformClientRedirect):
1585         (WebKit::WebPageProxy::didPerformServerRedirect):
1586         (WebKit::WebPageProxy::didUpdateHistoryTitle):
1587         (WebKit::WebPageProxy::closePage):
1588         (WebKit::WebPageProxy::setWindowFrame):
1589         (WebKit::WebPageProxy::getWindowFrame):
1590         (WebKit::WebPageProxy::getWindowFrameWithCallback):
1591         (WebKit::WebPageProxy::screenToRootView):
1592         (WebKit::WebPageProxy::rootViewToScreen):
1593         (WebKit::WebPageProxy::syncRootViewToScreen):
1594         (WebKit::WebPageProxy::accessibilityScreenToRootView):
1595         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
1596         (WebKit::WebPageProxy::didChangeViewportProperties):
1597         (WebKit::WebPageProxy::runOpenPanel):
1598         (WebKit::WebPageProxy::showShareSheet):
1599         (WebKit::WebPageProxy::handleDownloadRequest):
1600         (WebKit::WebPageProxy::didChangeContentSize):
1601         (WebKit::WebPageProxy::showColorPicker):
1602         (WebKit::WebPageProxy::showDataListSuggestions):
1603         (WebKit::WebPageProxy::compositionWasCanceled):
1604         (WebKit::WebPageProxy::registerInsertionUndoGrouping):
1605         (WebKit::WebPageProxy::canUndoRedo):
1606         (WebKit::WebPageProxy::executeUndoRedo):
1607         (WebKit::WebPageProxy::clearAllEditCommands):
1608         (WebKit::WebPageProxy::setTextIndicator):
1609         (WebKit::WebPageProxy::clearTextIndicator):
1610         (WebKit::WebPageProxy::setTextIndicatorAnimationProgress):
1611         (WebKit::WebPageProxy::showPopupMenu):
1612         (WebKit::WebPageProxy::showContextMenu):
1613         (WebKit::WebPageProxy::registerEditCommand):
1614         (WebKit::WebPageProxy::canUndo):
1615         (WebKit::WebPageProxy::canRedo):
1616         (WebKit::WebPageProxy::setToolTip):
1617         (WebKit::WebPageProxy::setCursor):
1618         (WebKit::WebPageProxy::setCursorHiddenUntilMouseMoves):
1619         (WebKit::WebPageProxy::didReceiveEvent):
1620         (WebKit::WebPageProxy::resetState):
1621         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1622         (WebKit::WebPageProxy::creationParameters):
1623         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
1624         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
1625         (WebKit::WebPageProxy::updateAcceleratedCompositingMode):
1626         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
1627         (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
1628         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
1629         (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
1630         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
1631         (WebKit::WebPageProxy::showCorrectionPanel):
1632         (WebKit::WebPageProxy::dismissCorrectionPanel):
1633         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
1634         (WebKit::WebPageProxy::recordAutocorrectionResponse):
1635         (WebKit::WebPageProxy::useDarkAppearance const):
1636         (WebKit::WebPageProxy::showDictationAlternativeUI):
1637         (WebKit::WebPageProxy::removeDictationAlternatives):
1638         (WebKit::WebPageProxy::dictationAlternatives):
1639         (WebKit::WebPageProxy::setEditableElementIsFocused):
1640         (WebKit::WebPageProxy::takeViewSnapshot):
1641         (WebKit::WebPageProxy::wrapCryptoKey):
1642         (WebKit::WebPageProxy::unwrapCryptoKey):
1643         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
1644         (WebKit::WebPageProxy::navigationGestureDidBegin):
1645         (WebKit::WebPageProxy::navigationGestureWillEnd):
1646         (WebKit::WebPageProxy::navigationGestureDidEnd):
1647         (WebKit::WebPageProxy::willRecordNavigationSnapshot):
1648         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
1649         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1650         (WebKit::WebPageProxy::videoControlsManagerDidChange):
1651         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
1652         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
1653         (WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult):
1654         (WebKit::WebPageProxy::didHandleAcceptedCandidate):
1655         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
1656         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
1657         (WebKit::WebPageProxy::showPlaybackTargetPicker):
1658         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
1659         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled):
1660         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState):
1661         (WebKit::WebPageProxy::didChangeBackgroundColor):
1662         (WebKit::WebPageProxy::didRestoreScrollPosition):
1663         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
1664         (WebKit::WebPageProxy::didInsertAttachment):
1665         (WebKit::WebPageProxy::didRemoveAttachment):
1666         * UIProcess/WebPageProxy.h:
1667         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
1668         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
1669         * UIProcess/gtk/WebPageProxyGtk.cpp:
1670         (WebKit::WebPageProxy::viewWidget):
1671         (WebKit::WebPageProxy::editorStateChanged):
1672         * UIProcess/ios/WebPageProxyIOS.mm:
1673         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
1674         (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
1675         (WebKit::WebPageProxy::overflowScrollViewDidScroll):
1676         (WebKit::WebPageProxy::overflowScrollWillStartScroll):
1677         (WebKit::WebPageProxy::overflowScrollDidEndScroll):
1678         (WebKit::WebPageProxy::didCommitLayerTree):
1679         (WebKit::WebPageProxy::layerTreeCommitComplete):
1680         (WebKit::WebPageProxy::didReceivePositionInformation):
1681         (WebKit::WebPageProxy::saveImageToLibrary):
1682         (WebKit::WebPageProxy::interpretKeyEvent):
1683         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
1684         (WebKit::WebPageProxy::couldNotRestorePageState):
1685         (WebKit::WebPageProxy::restorePageState):
1686         (WebKit::WebPageProxy::restorePageCenterAndScale):
1687         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
1688         (WebKit::WebPageProxy::startAssistingNode):
1689         (WebKit::WebPageProxy::stopAssistingNode):
1690         (WebKit::WebPageProxy::showInspectorHighlight):
1691         (WebKit::WebPageProxy::hideInspectorHighlight):
1692         (WebKit::WebPageProxy::showInspectorIndication):
1693         (WebKit::WebPageProxy::hideInspectorIndication):
1694         (WebKit::WebPageProxy::enableInspectorNodeSearch):
1695         (WebKit::WebPageProxy::disableInspectorNodeSearch):
1696         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
1697         (WebKit::WebPageProxy::showPlaybackTargetPicker):
1698         (WebKit::WebPageProxy::commitPotentialTapFailed):
1699         (WebKit::WebPageProxy::didNotHandleTapAsClick):
1700         (WebKit::WebPageProxy::didCompleteSyntheticClick):
1701         (WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary):
1702         (WebKit::WebPageProxy::editorStateChanged):
1703         (WebKit::WebPageProxy::showValidationMessage):
1704         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest):
1705         (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
1706         (WebKit::WebPageProxy::didConcludeEditDataInteraction):
1707         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
1708         * UIProcess/mac/WebPageProxyMac.mm:
1709         (WebKit::WebPageProxy::windowAndViewFramesChanged):
1710         (WebKit::WebPageProxy::insertDictatedTextAsync):
1711         (WebKit::WebPageProxy::setPromisedDataForImage):
1712         (WebKit::WebPageProxy::didPerformDictionaryLookup):
1713         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
1714         (WebKit::WebPageProxy::makeFirstResponder):
1715         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
1716         (WebKit::WebPageProxy::colorSpace):
1717         (WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged):
1718         (WebKit::WebPageProxy::setPluginComplexTextInputState):
1719         (WebKit::WebPageProxy::executeSavedCommandBySelector):
1720         (WebKit::WebPageProxy::intrinsicContentSizeDidChange):
1721         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
1722         (WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
1723         (WebKit::WebPageProxy::showPDFContextMenu):
1724         (WebKit::WebPageProxy::showTelephoneNumberMenu):
1725         (WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates const):
1726         (WebKit::WebPageProxy::editorStateChanged):
1727         (WebKit::WebPageProxy::startWindowDrag):
1728         (WebKit::WebPageProxy::platformWindow):
1729         (WebKit::WebPageProxy::rootViewToWindow):
1730         (WebKit::WebPageProxy::showValidationMessage):
1731         (WebKit::WebPageProxy::inspectorAttachmentView):
1732         (WebKit::WebPageProxy::remoteObjectRegistry):
1733         * UIProcess/win/WebPageProxyWin.cpp:
1734         (WebKit::WebPageProxy::viewWidget):
1735         * UIProcess/wpe/WebPageProxyWPE.cpp:
1736         (WebKit::WebPageProxy::viewBackend):
1737
1738 2018-09-11  Chris Dumez  <cdumez@apple.com>
1739
1740         Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process
1741         https://bugs.webkit.org/show_bug.cgi?id=189482
1742         <rdar://problem/44317222>
1743
1744         Reviewed by Geoffrey Garen.
1745
1746         The issue was that when we swap process on navigation, we:
1747         1. Call processDidTerminate() which calls resetState() and clears the displayed content
1748         2. Reattach the WebPageProxy to a new WebProcess
1749         3. Trigger the navigation
1750         4. Take the navigation snapshot
1751
1752         When the navigation snapshot occurs at step 4, the view is already blank in the case of
1753         process swap. To avoid the issue, we take the navigation snapshot earlier, before calling
1754         processDidTerminate() and we suppress the next navigation snapshot as it would be blank.
1755
1756         At some point, we will likely want to display the previous' WebProcess content longer,
1757         until the new WebProcess has something interesting to display. Once this is implemented,
1758         we'll likely be able to drop the early snapshotting logic.
1759
1760         * UIProcess/WebPageProxy.cpp:
1761         (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
1762         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1763         (WebKit::WebPageProxy::restoreFromSessionState):
1764         (WebKit::WebPageProxy::didCommitLoadForFrame):
1765         * UIProcess/WebPageProxy.h:
1766         (WebKit::WebPageProxy::suppressNextAutomaticNavigationSnapshot):
1767
1768 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
1769
1770         Add Web API Statistics Collection
1771         https://bugs.webkit.org/show_bug.cgi?id=187773
1772         <rdar://problem/44155162>
1773
1774         Reviewed by Brent Fulgham.
1775
1776         * Shared/WebCoreArgumentCoders.cpp:
1777         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1778         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1779         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1780
1781 == Rolled over to ChangeLog-2018-09-11 ==