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