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