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