f4b2485b20eef799a959ac72bfdc64657f016e86
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
2
3         Unreviewed, rolling out r235953.
4
5         Caused layout test crashes under GuardMalloc.
6
7         Reverted changeset:
8
9         "Make GraphicsLayers ref-counted, so their tree can persist
10         when disconnected from RenderLayerBackings"
11         https://bugs.webkit.org/show_bug.cgi?id=189521
12         https://trac.webkit.org/changeset/235953
13
14 2018-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
15
16         [GTK][WPE] Allow to run script dialogs asynchronously in the UI process
17         https://bugs.webkit.org/show_bug.cgi?id=189544
18
19         Reviewed by Michael Catanzaro.
20
21         Script dialogs are sync in the WebProcess, but we don't need to block the UI process while they are running. Our
22         current API doesn't allow it, because it always expects the dialog to be closed in the signal handler. API
23         changes are backwards compatible.
24
25         * UIProcess/API/glib/WebKitScriptDialog.cpp:
26         (webkitScriptDialogCreate): Added to heap allocate a WebKitScriptDialog.
27         (webkitScriptDialogIsRunning): Common implementation here, a script dialog is considered to be running if it has
28         a competion handler pending.
29         (webkit_script_dialog_ref): WebKitScriptDialog is now refcounted.
30         (webkit_script_dialog_unref): Ditto.
31         (webkit_script_dialog_close): New method to notify that we are done with the dialog.
32         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
33         (_WebKitScriptDialog::_WebKitScriptDialog): Use a single constructor and keep the completion handler.
34         * UIProcess/API/glib/WebKitUIClient.cpp: Do not call the completion handler, pass it to the web view.
35         * UIProcess/API/glib/WebKitWebView.cpp:
36         (webkitWebViewDispose): Close the current script dialog if there's any.
37         (webkit_web_view_class_init): Document how to handle dialogs asynchronously.
38         (webkitWebViewRunJavaScriptAlert): Do not stack allocate the WebKitScriptDialog, create it with
39         webkitScriptDialogCreate() passing the completion handler.
40         (webkitWebViewRunJavaScriptConfirm): Ditto.
41         (webkitWebViewRunJavaScriptPrompt): Ditto.
42         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
43         * UIProcess/API/glib/WebKitWebViewPrivate.h:
44         * UIProcess/API/gtk/WebKitScriptDialog.h:
45         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
46         (scriptDialogResponseCallback): Hnadle the response callback.
47         (webkitScriptDialogRun): Do not use gtk_dialog_run(), connect to response signal and show the dialogs instead.
48         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
49         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
50         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
51
52 2018-09-12  Dan Bernstein  <mitz@apple.com>
53
54         Update availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM seed
55         https://bugs.webkit.org/show_bug.cgi?id=189561
56
57         Reviewed by Tim Horton.
58
59         Changed WK_MAC_TBA and WK_IOS_TBA to 10.14 and 12.0, respectively, in all declarations that
60         appear in the GM seed SDKs.
61
62         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
63         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
64         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
65         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
66         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
67         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
68         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
69         * UIProcess/API/Cocoa/WKViewPrivate.h:
70         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
71         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
72         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
73         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
74         * UIProcess/API/Cocoa/_WKAttachment.h:
75         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
76         * UIProcess/API/Cocoa/_WKAutomationSession.h:
77         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
78         * UIProcess/API/Cocoa/_WKFormInputSession.h:
79         * UIProcess/API/Cocoa/_WKInputDelegate.h:
80         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
81         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
82         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
83         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
84         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
85         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
86         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
87
88 2018-09-12  Dan Bernstein  <mitz@apple.com>
89
90         [Cocoa] Complete support for Paste as Quotation
91         https://bugs.webkit.org/show_bug.cgi?id=189504
92
93         Reviewed by Wenson Hsieh.
94
95         * UIProcess/API/Cocoa/WKWebView.mm:
96         (-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included
97           in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate
98           category. If we add more actions in the category, it could make sense to fold them into
99           a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION.
100         (-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:.
101         (-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView.
102         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action.
103
104         * UIProcess/Cocoa/WebViewImpl.mm:
105         (WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the
106           PasteAsQuotation command.
107
108         * UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action.
109         * UIProcess/ios/WKContentViewInteraction.mm:
110           Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its
111           behavior.
112         (-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page.
113
114 2018-09-12  Sihui Liu  <sihui_liu@apple.com>
115
116         Move IndexedDB to Network Process
117         https://bugs.webkit.org/show_bug.cgi?id=189415
118
119         Reviewed by Geoffrey Garen.
120
121         We are going to eliminate storage process and move its functionality to network process. 
122         The reasons why we want to do this:
123         1. Lower resource usage of having an additional process for storage operations, especially
124         memory. Single storage process takes about 5MB memory on macOS.
125         2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
126         regression in app launch. The launch time of storage process is partly attributed to this:
127         Service Workers delay page loading until receiving response from storage process.
128         3. We choose network process because UI process may have broader access in file system
129         that we don't want the storage operations to have.
130
131         This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
132         to corresponding components of network process. Moving of Service Worker and stopping to 
133         launch storage process will be done in following patches.
134
135         We expect to see the higher cpu and memory usage of network process as it is taking more work,
136         but the overall gain in memory and latency after we completely remove storage process should be 
137         positive.
138
139
140         * CMakeLists.txt:
141         * DerivedSources.make:
142
143         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
144         (WebKit::WebIDBConnectionToClient::create):
145         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
146         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
147         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
148         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
149         (WebKit::WebIDBConnectionToClient::connectionToClient):
150         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
151         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
152         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
153         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
154         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
155         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
156         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
157         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
158         (WebKit::WebIDBConnectionToClient::didCreateIndex):
159         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
160         (WebKit::WebIDBConnectionToClient::didRenameIndex):
161         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
162         (WebKit::WebIDBConnectionToClient::handleGetResult):
163         (WebKit::WebIDBConnectionToClient::didGetRecord):
164         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
165         (WebKit::WebIDBConnectionToClient::didGetCount):
166         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
167         (WebKit::WebIDBConnectionToClient::didOpenCursor):
168         (WebKit::WebIDBConnectionToClient::didIterateCursor):
169         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
170         (WebKit::WebIDBConnectionToClient::didStartTransaction):
171         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
172         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
173         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
174         (WebKit::WebIDBConnectionToClient::deleteDatabase):
175         (WebKit::WebIDBConnectionToClient::openDatabase):
176         (WebKit::WebIDBConnectionToClient::abortTransaction):
177         (WebKit::WebIDBConnectionToClient::commitTransaction):
178         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
179         (WebKit::WebIDBConnectionToClient::createObjectStore):
180         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
181         (WebKit::WebIDBConnectionToClient::renameObjectStore):
182         (WebKit::WebIDBConnectionToClient::clearObjectStore):
183         (WebKit::WebIDBConnectionToClient::createIndex):
184         (WebKit::WebIDBConnectionToClient::deleteIndex):
185         (WebKit::WebIDBConnectionToClient::renameIndex):
186         (WebKit::WebIDBConnectionToClient::putOrAdd):
187         (WebKit::WebIDBConnectionToClient::getRecord):
188         (WebKit::WebIDBConnectionToClient::getAllRecords):
189         (WebKit::WebIDBConnectionToClient::getCount):
190         (WebKit::WebIDBConnectionToClient::deleteRecord):
191         (WebKit::WebIDBConnectionToClient::openCursor):
192         (WebKit::WebIDBConnectionToClient::iterateCursor):
193         (WebKit::WebIDBConnectionToClient::establishTransaction):
194         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
195         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
196         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
197         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
198         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
199         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
200         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
201         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
202         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
203         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
204         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
205
206         Code moved from StorageToWebProcessConnection::didReceiveMessage.
207
208         (WebKit::NetworkConnectionToWebProcess::didClose):
209         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
210
211         Network process receives and stores sandbox extension of temporary files for later indexedDB
212         use.
213
214         (WebKit::generateIDBConnectionToServerIdentifier):
215         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
216         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
217         * NetworkProcess/NetworkConnectionToWebProcess.h:
218         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
219         * NetworkProcess/NetworkProcess.cpp:
220         (WebKit::NetworkProcess::NetworkProcess):
221         (WebKit::NetworkProcess::initializeNetworkProcess):
222         (WebKit::NetworkProcess::addWebsiteDataStore):
223         (WebKit::NetworkProcess::fetchWebsiteData):
224         (WebKit::NetworkProcess::deleteWebsiteData):
225         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
226         (WebKit::NetworkProcess::idbServer):
227         (WebKit::NetworkProcess::ensurePathExists):
228         (WebKit::NetworkProcess::postStorageTask):
229         (WebKit::NetworkProcess::performNextStorageTask):
230         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
231         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
232         (WebKit::NetworkProcess::indexedDatabaseOrigins):
233         (WebKit::NetworkProcess::addIndexedDatabaseSession):
234         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
235
236         Instead of asking UI process to grant sandbox extension to storage process, now network 
237         process just asks for sandbox extension fot itself.
238
239         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
240         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
241         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
242         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
243         * NetworkProcess/NetworkProcess.h:
244         (WebKit::NetworkProcess::queue):
245         * NetworkProcess/NetworkProcess.messages.in:
246         * NetworkProcess/NetworkProcessCreationParameters.cpp:
247         (WebKit::NetworkProcessCreationParameters::encode const):
248         (WebKit::NetworkProcessCreationParameters::decode):
249         * NetworkProcess/NetworkProcessCreationParameters.h:
250         * Shared/Storage/StorageProcessCreationParameters.cpp:
251         (WebKit::StorageProcessCreationParameters::encode const):
252         (WebKit::StorageProcessCreationParameters::decode):
253         * Shared/Storage/StorageProcessCreationParameters.h:
254         * Shared/WebsiteDataStoreParameters.cpp:
255         (WebKit::WebsiteDataStoreParameters::encode const):
256         (WebKit::WebsiteDataStoreParameters::decode):
257         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
258         * Shared/WebsiteDataStoreParameters.h:
259         * Sources.txt:
260         * StorageProcess/StorageProcess.cpp:
261         (WebKit::StorageProcess::initializeWebsiteDataStore):
262         (WebKit::StorageProcess::fetchWebsiteData):
263         (WebKit::StorageProcess::deleteWebsiteData):
264         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
265         (WebKit::StorageProcess::idbServer): Deleted.
266         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
267         (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
268         (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
269         (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
270         (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
271         (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
272         * StorageProcess/StorageProcess.h:
273         (WebKit::StorageProcess::queue): Deleted.
274         * StorageProcess/StorageProcess.messages.in:
275         * StorageProcess/StorageToWebProcessConnection.cpp:
276         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
277         (WebKit::StorageToWebProcessConnection::didClose):
278         (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
279         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
280         (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
281         * StorageProcess/StorageToWebProcessConnection.h:
282         * StorageProcess/StorageToWebProcessConnection.messages.in:
283         * UIProcess/Network/NetworkProcessProxy.cpp:
284         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
285         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
286         * UIProcess/Network/NetworkProcessProxy.h:
287         * UIProcess/Network/NetworkProcessProxy.messages.in:
288         * UIProcess/Storage/StorageProcessProxy.cpp:
289         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
290         * UIProcess/Storage/StorageProcessProxy.h:
291         * UIProcess/Storage/StorageProcessProxy.messages.in:
292         * UIProcess/WebProcessPool.cpp:
293         (WebKit::WebProcessPool::ensureNetworkProcess):
294         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
295         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
296         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
297         (WebKit::WebsiteDataStore::parameters):
298         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
299         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
300         (WebKit::WebsiteDataStore::fetchDataAndApply):
301         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
302         (WebKit::WebsiteDataStore::removeData):
303         (WebKit::WebsiteDataStore::storageProcessParameters):
304         (WebKit::WebsiteDataStore::parameters):
305         * WebKit.xcodeproj/project.pbxproj:
306         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
307         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
308         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
309         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
310         * WebProcess/Databases/WebDatabaseProvider.cpp:
311         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
312         * WebProcess/Network/NetworkProcessConnection.cpp:
313         (WebKit::NetworkProcessConnection::didReceiveMessage):
314         (WebKit::NetworkProcessConnection::didClose):
315         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
316         * WebProcess/Network/NetworkProcessConnection.h:
317         (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier):
318         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
319         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
320
321         Code moved from WebToStorageProcessConnection::didReceiveMessage.
322
323         (WebKit::WebToStorageProcessConnection::didClose):
324         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
325         * WebProcess/Storage/WebToStorageProcessConnection.h:
326         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
327         * WebProcess/WebProcess.cpp:
328         (WebKit::WebProcess::networkProcessConnectionClosed):
329         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
330
331 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
332
333         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
334         https://bugs.webkit.org/show_bug.cgi?id=189521
335
336         Reviewed by Tim Horton.
337
338         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
339         
340         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
341         
342         All the other changes are just to adapt to the new ownership patterns.
343         
344         I verified that no GraphicsLayers were leaked or abandoned after this change.
345
346         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
347         (WebKit::WebInspectorClient::~WebInspectorClient):
348         (WebKit::WebInspectorClient::showPaintRect):
349         (WebKit::WebInspectorClient::animationEndedForLayer):
350         * WebProcess/WebCoreSupport/WebInspectorClient.h:
351         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
352         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
353         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
354         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
355         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
356         (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
357         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
358
359 2018-09-12  Chris Dumez  <cdumez@apple.com>
360
361         PSON: No process swap on back navigation after URL bar navigation
362         https://bugs.webkit.org/show_bug.cgi?id=189557
363         <rdar://problem/44353108>
364
365         Reviewed by Alex Christensen.
366
367         Our logic in WebProcessPool::processForNavigationInternal() was wrongly using
368         WebBackForwardList::currentItem() as source item of the navigation, instead of
369         using Navigation::fromItem(). In case of back navigation, by the time
370         processForNavigation() is called, the WebBackForwardList's currentItem has already
371         been updated to be the target item, via a Sync IPC from the WebProcess. As a result,
372         the source and target items would be the same in the following check:
373         ` if (currentItem->itemID().processIdentifier == backForwardListItem->itemID().processIdentifier)`
374
375         This would cause us to reuse the same process incorrectly. Our existing API test coverage
376         did not catch this because our target HistoryItem usually has a SuspendedPage and we decide
377         to use the SuspendedPage's process a few lines above in WebProcessPool::processForNavigationInternal().
378
379         * UIProcess/WebProcessPool.cpp:
380         (WebKit::WebProcessPool::processForNavigationInternal):
381
382 2018-09-12  Alex Christensen  <achristensen@webkit.org>
383
384         Make IPC::SharedBufferDataReference a type that decodes into but does not inherit from IPC::DataReference
385         https://bugs.webkit.org/show_bug.cgi?id=189519
386
387         Reviewed by Chris Dumez.
388
389         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
390         * NetworkProcess/NetworkResourceLoader.cpp:
391         (WebKit::NetworkResourceLoader::bufferingTimerFired):
392         (WebKit::NetworkResourceLoader::sendBuffer):
393         * Platform/IPC/DataReference.cpp:
394         (IPC::SharedBufferDataReference::encode const): Deleted.
395         * Platform/IPC/DataReference.h:
396         (IPC::SharedBufferDataReference::SharedBufferDataReference): Deleted.
397         * Platform/IPC/HandleMessage.h:
398         * Platform/IPC/SharedBufferDataReference.h: Added.
399         (IPC::SharedBufferDataReference::SharedBufferDataReference):
400         (IPC::SharedBufferDataReference::encode const):
401         * Scripts/webkit/messages.py:
402         * Shared/API/APIData.h:
403         * StorageProcess/StorageProcess.messages.in:
404         * UIProcess/WebPageProxy.messages.in:
405         * UIProcess/WebURLSchemeTask.cpp:
406         (WebKit::WebURLSchemeTask::didReceiveData):
407         * WebKit.xcodeproj/project.pbxproj:
408         * WebProcess/Network/WebLoaderStrategy.cpp:
409         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
410         * WebProcess/Network/WebResourceLoader.messages.in:
411         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
412         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
413         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
414         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
415         (WebKit::WebEditorClient::registerAttachmentIdentifier):
416         * WebProcess/WebPage/WebPage.cpp:
417         (WebKit::WebPage::getContentsAsMHTMLData):
418         (WebKit::WebPage::getSelectionAsWebArchiveData):
419         (WebKit::WebPage::getMainResourceDataOfFrame):
420         (WebKit::WebPage::getResourceDataFromFrame):
421         (WebKit::WebPage::getWebArchiveOfFrame):
422         (WebKit::WebPage::drawPagesToPDF):
423         * WebProcess/WebPage/WebPage.messages.in:
424
425 2018-09-11  Dean Jackson  <dino@apple.com>
426
427         Header parsing for experimental and internal debug features
428         https://bugs.webkit.org/show_bug.cgi?id=189486
429         <rdar://problem/44320618>
430
431         Reviewed by Tim Horton.
432
433         Provide key-based (string) access to experimental and internal features.
434
435         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
436         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
437         * UIProcess/API/C/WKPreferences.cpp:
438         (WKPreferencesSetExperimentalFeatureForKey):
439         (WKPreferencesResetAllInternalDebugFeatures):
440         (WKPreferencesSetInternalDebugFeatureForKey):
441         * UIProcess/API/C/WKPreferencesRefPrivate.h:
442         * UIProcess/WebPreferences.h:
443
444 2018-09-10  Matt Rajca  <mrajca@apple.com>
445
446         Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
447         https://bugs.webkit.org/show_bug.cgi?id=189478
448         <rdar://problem/44312650>
449
450         Reviewed by Eric Carlson.
451
452         This patch exposes APIs necessary to toggle PIP and query its status from clients of WKWebView.
453         The existing PIP test has been updated to use the new APIs instead of simulating mouse clicks.
454         I also increased the size of the video element in the test page so it gets picked up by the
455         main content heuristics.
456
457         * UIProcess/API/Cocoa/WKWebView.mm:
458         (-[WKWebView _updateMediaPlaybackControlsManager]): Create a media playback controls manager if necessary.
459         (-[WKWebView _isPictureInPictureActive]): Return true if the "active" media element is in PIP.
460         (-[WKWebView _togglePictureInPicture]): Toggle PIP on the "active" media element.
461         (-[WKWebView _canTogglePictureInPicture]): Renamed from...
462         (-[WKWebView _canTogglePictureInPictureForTesting]):
463         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
464         * UIProcess/Cocoa/WebViewImpl.h:
465         * UIProcess/Cocoa/WebViewImpl.mm:
466         (WebKit::WebViewImpl::isPictureInPictureActive): Return true if the "active" media element is in PIP.
467         (WebKit::WebViewImpl::togglePictureInPicture): Toggle PIP on the "active" media element.
468         (WebKit::WebViewImpl::updateMediaPlaybackControlsManager): Let clients create a playback
469          controls manager even when there is no Touch Bar present.
470         (WebKit::WebViewImpl::updateMediaTouchBar): Extract some code into a helper method.
471         (WebKit::WebViewImpl::canTogglePictureInPicture): Renamed from...
472         (WebKit::WebViewImpl::canTogglePictureInPictureForTesting):
473
474 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
475
476         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
477         https://bugs.webkit.org/show_bug.cgi?id=189542
478
479         Reviewed by Alex Christensen.
480
481         * UIProcess/win/WebInspectorProxyWin.cpp:
482         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Narrowed initialWindowWidth and initialWindowHeight by using static_cast.
483
484 2018-09-12  Chris Dumez  <cdumez@apple.com>
485
486         Clean up SuspendedPageProxy
487         https://bugs.webkit.org/show_bug.cgi?id=189517
488
489         Reviewed by Alex Christensen.
490
491         Clean up SuspendedPageProxy:
492         1. SuspendedPageProxy does not need to be RefCounted. It is even dangerous given that WebPageProxy
493            owns the SuspendedPageProxy and SuspendedPageProxy has a WebPageProxy& data member. We definitely
494            do not want it to outlive its WebPageProxy.
495         2. The SuspendedPageProxy destructor does not need to be virtual.
496         3. Have WebBackForwardListItem keep a WeakPtr<SuspendedPageProxy> instead of a SuspendedPageProxy*.
497            This is safer and avoid having to explicitly clear the pointer.
498         4. m_finishedSuspending data member does not need a getter and is only needed if !LOG_DISABLED.
499
500         * Shared/WebBackForwardListItem.cpp:
501         (WebKit::WebBackForwardListItem::setSuspendedPage):
502         * Shared/WebBackForwardListItem.h:
503         (WebKit::WebBackForwardListItem::suspendedPage const):
504         * UIProcess/SuspendedPageProxy.cpp:
505         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
506         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
507         (WebKit::SuspendedPageProxy::webProcessDidClose):
508         (WebKit::SuspendedPageProxy::didFinishLoad):
509         * UIProcess/SuspendedPageProxy.h:
510         (WebKit::SuspendedPageProxy::process const):
511         * UIProcess/WebPageProxy.cpp:
512         (WebKit::WebPageProxy::maybeCreateSuspendedPage):
513         (WebKit::WebPageProxy::reattachToWebProcess):
514         * UIProcess/WebPageProxy.h:
515
516 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
517
518         Add IGNORE_WARNING_.* macros
519         https://bugs.webkit.org/show_bug.cgi?id=188996
520
521         Reviewed by Michael Catanzaro.
522
523         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
524         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
525         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
526         (WebKit::NetworkProcess::platformSyncAllCookies):
527         * PluginProcess/mac/PluginProcessMac.mm:
528         (WebKit::beginModal):
529         * PluginProcess/mac/PluginProcessShim.mm:
530         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
531         (WebKit::NetscapePluginModule::tryLoad):
532         * Shared/ios/ChildProcessIOS.mm:
533         (WebKit::ChildProcess::initializeSandbox):
534         * Shared/mac/ChildProcessMac.mm:
535         (WebKit::compileAndApplySandboxSlowCase):
536         * Shared/mac/ColorSpaceData.mm:
537         (WebKit::ColorSpaceData::decode):
538         * Shared/mac/SandboxExtensionMac.mm:
539         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
540         * UIProcess/API/Cocoa/WKWebView.mm:
541         (-[WKWebView _web_superAccessibilityAttributeValue:]):
542         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
543         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
544         * UIProcess/API/glib/WebKitWebView.cpp:
545         (webkitWebViewRunAsModal):
546         * UIProcess/API/mac/WKView.mm:
547         (-[WKView _web_superAccessibilityAttributeValue:]):
548         * UIProcess/Cocoa/DownloadClient.mm:
549         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
550         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
551         (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
552         * UIProcess/Cocoa/NavigationState.mm:
553         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
554         * UIProcess/Cocoa/UIDelegate.mm:
555         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
556         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
557         (WebKit::WebProcessPool::platformInitializeWebProcess):
558         * UIProcess/Cocoa/WebViewImpl.mm:
559         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
560         (WebKit::WebViewImpl::updateWindowAndViewFrames):
561         (WebKit::WebViewImpl::sendDragEndToPage):
562         (WebKit::WebViewImpl::startDrag):
563         (WebKit::WebViewImpl::characterIndexForPoint):
564         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
565         (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
566         (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
567         (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
568         (WebKit::PluginProcessProxy::exitFullscreen):
569         * UIProcess/ios/SmartMagnificationController.mm:
570         * UIProcess/ios/WKGeolocationProviderIOS.mm:
571         * UIProcess/ios/WKLegacyPDFView.mm:
572         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
573         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
574         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
575         * UIProcess/ios/forms/WKFileUploadPanel.mm:
576         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
577         * UIProcess/ios/forms/WKFormColorControl.mm:
578         (-[WKColorPopover initWithView:]):
579         * UIProcess/ios/forms/WKFormInputControl.mm:
580         (-[WKDateTimePopover initWithView:datePickerMode:]):
581         * UIProcess/ios/forms/WKFormPopover.h:
582         * UIProcess/ios/forms/WKFormPopover.mm:
583         * UIProcess/ios/forms/WKFormSelectPopover.mm:
584         (-[WKSelectPopover initWithView:hasGroups:]):
585         * UIProcess/mac/PageClientImplMac.mm:
586         (WebKit::PageClientImpl::screenToRootView):
587         (WebKit::PageClientImpl::rootViewToScreen):
588         * UIProcess/mac/WKFullScreenWindowController.mm:
589         (-[WKFullScreenWindowController enterFullScreen:]):
590         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
591         (-[WKFullScreenWindowController exitFullScreen]):
592         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
593         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
594         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
595         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
596         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
597         * UIProcess/mac/WKPrintingView.mm:
598         (-[WKPrintingView _setAutodisplay:]):
599         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
600         (-[WKPrintingView _drawPreview:]):
601         (-[WKPrintingView drawRect:]):
602         * UIProcess/mac/WKTextInputWindowController.mm:
603         (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
604         (-[WKTextInputPanel _hasMarkedText]):
605         * UIProcess/mac/WebPopupMenuProxyMac.mm:
606         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
607         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
608         (WebKit::initializeEventRecord):
609         (WebKit::NetscapePlugin::sendComplexTextInput):
610         (WebKit::makeCGLPresentLayerOpaque):
611         (WebKit::NetscapePlugin::nullEventTimerFired):
612         * WebProcess/Plugins/PDF/PDFPlugin.mm:
613         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
614         (-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]):
615         (WebKit::PDFPlugin::handleEditingCommand):
616         (WebKit::PDFPlugin::setActiveAnnotation):
617         (WebKit:: const):
618         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
619         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
620         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
621         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
622         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
623         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
624         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
625         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
626         (WebKit::convertImageToBitmap):
627         (WebKit::WebDragClient::declareAndWriteDragImage):
628         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
629         * WebProcess/WebPage/mac/WebPageMac.mm:
630         (WebKit::drawPDFPage):
631
632 2018-09-11  Olivia Barnett  <obarnett@apple.com>
633
634         Implement the Web Share API for mac
635         https://bugs.webkit.org/show_bug.cgi?id=189443
636
637         Reviewed by Tim Horton.
638
639         * Shared/WebPreferencesDefaultValues.h:
640         * UIProcess/API/Cocoa/WKWebView.mm:
641         (-[WKWebView shareSheetDidDismiss:]):
642         * UIProcess/API/Cocoa/WKWebViewInternal.h:
643         * UIProcess/API/mac/WKView.mm:
644         (-[WKView shareSheetDidDismiss:]):
645         * UIProcess/Cocoa/WebViewImpl.h:
646         * UIProcess/Cocoa/WebViewImpl.mm:
647         (WebKit::WebViewImpl::showShareSheet):
648         (WebKit::WebViewImpl::shareSheetDidDismiss):
649         Implemented function for WKShareSheetDelegate.
650
651         * UIProcess/Cocoa/WKShareSheet.h:
652         * UIProcess/Cocoa/WKShareSheet.mm:
653         (-[WKShareSheet initWithView:initWithView:]):
654         (-[WKShareSheet presentWithParameters:completionHandler:]):
655         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
656         (-[WKShareSheet _cancel]):
657         (-[WKShareSheet dismiss]):
658         (-[WKShareSheet _dismissDisplayAnimated:]):
659         (-[WKShareSheet invokeShareSheetWithResolution:]):
660         (-[WKShareSheet initWithView:]): Deleted.
661         Added mac platform checks and share sheet functionality.
662
663         * UIProcess/mac/PageClientImplMac.h:
664         * UIProcess/mac/PageClientImplMac.mm:
665         (WebKit::PageClientImpl::showShareSheet):
666         Allows macos to invoke the system share sheet.
667
668 2018-09-07  Dean Jackson  <dino@apple.com>
669
670         Add and expose Internal features from WebKit
671         https://bugs.webkit.org/show_bug.cgi?id=189442
672         <rdar://problem/44243404>
673
674         Reviewed by Simon Fraser.
675
676         Experimental features have become a mess. People are using them for
677         anything that they want to be easily toggled from a host app (e.g.
678         Safari), which means the user-facing menu has become large and
679         confusing.
680
681         Introduce the idea of Internal features, that will be exposed in a way
682         that end-users are not expected to ever see (unless they really want
683         to).
684
685         * CMakeLists.txt: Add new files.
686         * Sources.txt:
687         * SourcesCocoa.txt:
688         * WebKit.xcodeproj/project.pbxproj:
689
690         * DerivedSources.make: Add new generated files.
691         * Scripts/GeneratePreferences.rb: Generate the preferences stuff for Internal Debug features.
692         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
693         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: Added.
694
695         * Shared/API/APIObject.h: New API object for InternalDebugFeature.
696         * Shared/Cocoa/APIObject.mm:
697         (API::Object::newObject):
698
699         * Shared/WebPreferences.yaml: Change some of the existing experimental features to "internal".
700
701         * UIProcess/API/APIInternalDebugFeature.cpp: New API type - just like APIExperimentalFeature.
702         (API::InternalDebugFeature::create):
703         (API::InternalDebugFeature::InternalDebugFeature):
704         (API::InternalDebugFeature::~InternalDebugFeature):
705         * UIProcess/API/APIInternalDebugFeature.h:
706         * UIProcess/API/C/WKAPICast.h:
707
708         * UIProcess/API/Cocoa/WKPreferences.mm: Change the naming of the experimental feature API so that it
709         won't clash with internal debug features. We can remove the old API once Safari has adopted.
710         (+[WKPreferences _internalDebugFeatures]):
711         (-[WKPreferences _isEnabledForInternalDebugFeature:]):
712         (-[WKPreferences _setEnabled:forInternalDebugFeature:]):
713         (-[WKPreferences _isEnabledForFeature:]):
714         (-[WKPreferences _setEnabled:forFeature:]):
715         (-[WKPreferences _isEnabledForExperimentalFeature:]):
716         (-[WKPreferences _setEnabled:forExperimentalFeature:]):
717         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
718
719         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h: New object - same as _WKExperimentalFeature.
720         * UIProcess/API/Cocoa/_WKInternalDebugFeature.mm:
721         (-[_WKInternalDebugFeature dealloc]):
722         (-[_WKInternalDebugFeature description]):
723         (-[_WKInternalDebugFeature name]):
724         (-[_WKInternalDebugFeature key]):
725         (-[_WKInternalDebugFeature details]):
726         (-[_WKInternalDebugFeature defaultValue]):
727         (-[_WKInternalDebugFeature isHidden]):
728         (-[_WKInternalDebugFeature _apiObject]):
729         * UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h:
730
731         * UIProcess/WebPreferences.cpp: Add support for Internal Debug features.
732         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
733         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
734         * UIProcess/WebPreferences.h:
735
736         * UIProcess/WebProcessPool.cpp: Change a comment now that it is an internal feature.
737         (WebKit::WebProcessPool::createWebPage):
738
739 2018-09-11  Eric Carlson  <eric.carlson@apple.com>
740
741         WebPage::close should clear UserMediaPermissionRequestManager
742         https://bugs.webkit.org/show_bug.cgi?id=189369
743         <rdar://problem/44196724>
744
745         Reviewed by Youenn Fablet.
746
747         * WebProcess/WebPage/WebPage.cpp:
748         (WebKit::WebPage::close): Clear m_userMediaPermissionRequestManager.
749
750 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
751
752         [macOS] [WK2] Support changing foreground colors via color panel
753         https://bugs.webkit.org/show_bug.cgi?id=189382
754         <rdar://problem/44227311>
755
756         Reviewed by Ryosuke Niwa.
757
758         Adds support for changing font color in a richly editable element in WebKit2 via NSColorPanel. See below for
759         more detail, as well as the WebCore ChangeLog.
760
761         * UIProcess/API/Cocoa/WKWebView.mm:
762         (-[WKWebView changeColor:]):
763
764         Implement this selector; AppKit calls into this when changing font color using NSColorPanel.
765
766         * UIProcess/Cocoa/WebViewImpl.h:
767         * UIProcess/Cocoa/WebViewImpl.mm:
768         (WebKit::WebViewImpl::changeFontColorFromSender):
769
770         Creates and populates new FontAttributeChanges, with only the foreground color determined by asking the sender
771         object for its -color.
772
773         * WebProcess/WebPage/mac/WebPageMac.mm:
774
775         Use the relevant EditAction for the incoming FontAttributeChanges, instead of always specifying
776         EditAction::ChangeAttributes.
777
778         (WebKit::WebPage::changeFontAttributes):
779
780 2018-09-11  Myles C. Maxfield  <mmaxfield@apple.com>
781
782         Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
783         https://bugs.webkit.org/show_bug.cgi?id=188008
784
785         Reviewed by Alex Christensen.
786
787         This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307.
788         Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code.
789
790         * Shared/cf/ArgumentCodersCF.cpp:
791         (IPC::encode):
792         (IPC::decode):
793
794 2018-09-11  Adrian Perez de Castro  <aperez@igalia.com>
795
796         [WPE][GTK] API documentation is unclear about how to modify requests before sending them
797         https://bugs.webkit.org/show_bug.cgi?id=189505
798
799         Reviewed by Michael Catanzaro.
800
801         Add notes to the API documentation to make explicit where modification
802         of WebKitURIRequest instances affects the request data sent over the
803         network.
804
805         * UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that
806         modifications to the associated WebKitURIRequest do not affect the
807         actual request. Point to WebKitPage::send-request instead.
808         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto.
809         * UIProcess/API/glib/WebKitWebView.cpp:
810         (webkit_web_view_class_init): Ditto for the description of the
811         WebKitWebView::decide-policy signal. Also fix the syntax of example.
812         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
813         (webkit_web_page_class_init): Indicate that modifications to the
814         WebKitURIRequest will change the actual network request data.
815
816 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
817
818         Unreviewed, attempt to fix Apple builds after r235903
819         https://bugs.webkit.org/show_bug.cgi?id=188872
820
821         If it really needs to be inlined, it will need to move to the header....
822
823         * UIProcess/WebPageProxy.cpp:
824         (WebKit::WebPageProxy::pageClient const):
825
826 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
827
828         Unreviewed, fix build after r235903
829         https://bugs.webkit.org/show_bug.cgi?id=188872
830
831         This broke all ports except GTK. Need to add a missing header.
832
833         * UIProcess/PageClient.h:
834
835 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
836
837         Add missing #if ENABLE(VIDEO) WebProcess/FullScreen/WebFullScreenManager.cpp
838         https://bugs.webkit.org/show_bug.cgi?id=189506
839
840         Reviewed by Tim Horton.
841
842         m_pipStandbyElement is only defined in
843         WebKit/WebProcess/FullScreen/WebFullScreenManager.h
844         only when ENABLE(VIDEO) (see
845         https://bugs.webkit.org/show_bug.cgi?id=181338)
846
847         * WebProcess/FullScreen/WebFullScreenManager.cpp:
848         (WebKit::WebFullScreenManager::setPIPStandbyElement):
849
850 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
851
852         WebPageProxy should hold a WeakPtr to its PageClient
853         https://bugs.webkit.org/show_bug.cgi?id=188872
854
855         Reviewed by Ryosuke Niwa.
856
857         This ensures the PageClient reference is always valid when used.
858
859         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
860         (WebKit::WebPageProxy::startDrag):
861         (WebKit::WebPageProxy::setDragCaretRect):
862         * UIProcess/PageClient.h:
863         * UIProcess/WebPageProxy.cpp:
864         (WebKit::PageClientProtector::PageClientProtector):
865         (WebKit::PageClientProtector::~PageClientProtector):
866         (WebKit::WebPageProxy::WebPageProxy):
867         (WebKit::m_resetRecentCrashCountTimer):
868         (WebKit::WebPageProxy::pageClient const):
869         (WebKit::WebPageProxy::reattachToWebProcess):
870         (WebKit::WebPageProxy::initializeWebPage):
871         (WebKit::WebPageProxy::close):
872         (WebKit::WebPageProxy::didChangeBackForwardList):
873         (WebKit::WebPageProxy::willGoToBackForwardListItem):
874         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
875         (WebKit::WebPageProxy::setViewNeedsDisplay):
876         (WebKit::WebPageProxy::requestScroll):
877         (WebKit::WebPageProxy::viewScrollPosition const):
878         (WebKit::WebPageProxy::updateActivityState):
879         (WebKit::WebPageProxy::activityStateDidChange):
880         (WebKit::WebPageProxy::viewDidEnterWindow):
881         (WebKit::WebPageProxy::dispatchActivityStateChange):
882         (WebKit::WebPageProxy::layerHostingModeDidChange):
883         (WebKit::WebPageProxy::viewSize const):
884         (WebKit::WebPageProxy::startDrag):
885         (WebKit::WebPageProxy::didPerformDragOperation):
886         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
887         (WebKit::WebPageProxy::findPlugin):
888         (WebKit::WebPageProxy::handleTouchEventSynchronously):
889         (WebKit::WebPageProxy::handleTouchEvent):
890         (WebKit::WebPageProxy::preferencesDidChange):
891         (WebKit::WebPageProxy::didCreateMainFrame):
892         (WebKit::WebPageProxy::didCreateSubframe):
893         (WebKit::WebPageProxy::didStartProgress):
894         (WebKit::WebPageProxy::didChangeProgress):
895         (WebKit::WebPageProxy::didFinishProgress):
896         (WebKit::WebPageProxy::didDestroyNavigation):
897         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
898         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
899         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
900         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
901         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
902         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
903         (WebKit::WebPageProxy::didCommitLoadForFrame):
904         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
905         (WebKit::WebPageProxy::didFinishLoadForFrame):
906         (WebKit::WebPageProxy::didFailLoadForFrame):
907         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
908         (WebKit::WebPageProxy::didReceiveTitleForFrame):
909         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
910         (WebKit::WebPageProxy::didReachLayoutMilestone):
911         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
912         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
913         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
914         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
915         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
916         (WebKit::WebPageProxy::decidePolicyForResponse):
917         (WebKit::WebPageProxy::unableToImplementPolicy):
918         (WebKit::WebPageProxy::didNavigateWithNavigationData):
919         (WebKit::WebPageProxy::didPerformClientRedirect):
920         (WebKit::WebPageProxy::didPerformServerRedirect):
921         (WebKit::WebPageProxy::didUpdateHistoryTitle):
922         (WebKit::WebPageProxy::closePage):
923         (WebKit::WebPageProxy::setWindowFrame):
924         (WebKit::WebPageProxy::getWindowFrame):
925         (WebKit::WebPageProxy::getWindowFrameWithCallback):
926         (WebKit::WebPageProxy::screenToRootView):
927         (WebKit::WebPageProxy::rootViewToScreen):
928         (WebKit::WebPageProxy::syncRootViewToScreen):
929         (WebKit::WebPageProxy::accessibilityScreenToRootView):
930         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
931         (WebKit::WebPageProxy::didChangeViewportProperties):
932         (WebKit::WebPageProxy::runOpenPanel):
933         (WebKit::WebPageProxy::showShareSheet):
934         (WebKit::WebPageProxy::handleDownloadRequest):
935         (WebKit::WebPageProxy::didChangeContentSize):
936         (WebKit::WebPageProxy::showColorPicker):
937         (WebKit::WebPageProxy::showDataListSuggestions):
938         (WebKit::WebPageProxy::compositionWasCanceled):
939         (WebKit::WebPageProxy::registerInsertionUndoGrouping):
940         (WebKit::WebPageProxy::canUndoRedo):
941         (WebKit::WebPageProxy::executeUndoRedo):
942         (WebKit::WebPageProxy::clearAllEditCommands):
943         (WebKit::WebPageProxy::setTextIndicator):
944         (WebKit::WebPageProxy::clearTextIndicator):
945         (WebKit::WebPageProxy::setTextIndicatorAnimationProgress):
946         (WebKit::WebPageProxy::showPopupMenu):
947         (WebKit::WebPageProxy::showContextMenu):
948         (WebKit::WebPageProxy::registerEditCommand):
949         (WebKit::WebPageProxy::canUndo):
950         (WebKit::WebPageProxy::canRedo):
951         (WebKit::WebPageProxy::setToolTip):
952         (WebKit::WebPageProxy::setCursor):
953         (WebKit::WebPageProxy::setCursorHiddenUntilMouseMoves):
954         (WebKit::WebPageProxy::didReceiveEvent):
955         (WebKit::WebPageProxy::resetState):
956         (WebKit::WebPageProxy::resetStateAfterProcessExited):
957         (WebKit::WebPageProxy::creationParameters):
958         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
959         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
960         (WebKit::WebPageProxy::updateAcceleratedCompositingMode):
961         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
962         (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
963         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
964         (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
965         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
966         (WebKit::WebPageProxy::showCorrectionPanel):
967         (WebKit::WebPageProxy::dismissCorrectionPanel):
968         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
969         (WebKit::WebPageProxy::recordAutocorrectionResponse):
970         (WebKit::WebPageProxy::useDarkAppearance const):
971         (WebKit::WebPageProxy::showDictationAlternativeUI):
972         (WebKit::WebPageProxy::removeDictationAlternatives):
973         (WebKit::WebPageProxy::dictationAlternatives):
974         (WebKit::WebPageProxy::setEditableElementIsFocused):
975         (WebKit::WebPageProxy::takeViewSnapshot):
976         (WebKit::WebPageProxy::wrapCryptoKey):
977         (WebKit::WebPageProxy::unwrapCryptoKey):
978         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
979         (WebKit::WebPageProxy::navigationGestureDidBegin):
980         (WebKit::WebPageProxy::navigationGestureWillEnd):
981         (WebKit::WebPageProxy::navigationGestureDidEnd):
982         (WebKit::WebPageProxy::willRecordNavigationSnapshot):
983         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
984         (WebKit::WebPageProxy::isPlayingMediaDidChange):
985         (WebKit::WebPageProxy::videoControlsManagerDidChange):
986         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
987         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
988         (WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult):
989         (WebKit::WebPageProxy::didHandleAcceptedCandidate):
990         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
991         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
992         (WebKit::WebPageProxy::showPlaybackTargetPicker):
993         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
994         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled):
995         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState):
996         (WebKit::WebPageProxy::didChangeBackgroundColor):
997         (WebKit::WebPageProxy::didRestoreScrollPosition):
998         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
999         (WebKit::WebPageProxy::didInsertAttachment):
1000         (WebKit::WebPageProxy::didRemoveAttachment):
1001         * UIProcess/WebPageProxy.h:
1002         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
1003         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
1004         * UIProcess/gtk/WebPageProxyGtk.cpp:
1005         (WebKit::WebPageProxy::viewWidget):
1006         (WebKit::WebPageProxy::editorStateChanged):
1007         * UIProcess/ios/WebPageProxyIOS.mm:
1008         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
1009         (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
1010         (WebKit::WebPageProxy::overflowScrollViewDidScroll):
1011         (WebKit::WebPageProxy::overflowScrollWillStartScroll):
1012         (WebKit::WebPageProxy::overflowScrollDidEndScroll):
1013         (WebKit::WebPageProxy::didCommitLayerTree):
1014         (WebKit::WebPageProxy::layerTreeCommitComplete):
1015         (WebKit::WebPageProxy::didReceivePositionInformation):
1016         (WebKit::WebPageProxy::saveImageToLibrary):
1017         (WebKit::WebPageProxy::interpretKeyEvent):
1018         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
1019         (WebKit::WebPageProxy::couldNotRestorePageState):
1020         (WebKit::WebPageProxy::restorePageState):
1021         (WebKit::WebPageProxy::restorePageCenterAndScale):
1022         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
1023         (WebKit::WebPageProxy::startAssistingNode):
1024         (WebKit::WebPageProxy::stopAssistingNode):
1025         (WebKit::WebPageProxy::showInspectorHighlight):
1026         (WebKit::WebPageProxy::hideInspectorHighlight):
1027         (WebKit::WebPageProxy::showInspectorIndication):
1028         (WebKit::WebPageProxy::hideInspectorIndication):
1029         (WebKit::WebPageProxy::enableInspectorNodeSearch):
1030         (WebKit::WebPageProxy::disableInspectorNodeSearch):
1031         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
1032         (WebKit::WebPageProxy::showPlaybackTargetPicker):
1033         (WebKit::WebPageProxy::commitPotentialTapFailed):
1034         (WebKit::WebPageProxy::didNotHandleTapAsClick):
1035         (WebKit::WebPageProxy::didCompleteSyntheticClick):
1036         (WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary):
1037         (WebKit::WebPageProxy::editorStateChanged):
1038         (WebKit::WebPageProxy::showValidationMessage):
1039         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest):
1040         (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
1041         (WebKit::WebPageProxy::didConcludeEditDataInteraction):
1042         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
1043         * UIProcess/mac/WebPageProxyMac.mm:
1044         (WebKit::WebPageProxy::windowAndViewFramesChanged):
1045         (WebKit::WebPageProxy::insertDictatedTextAsync):
1046         (WebKit::WebPageProxy::setPromisedDataForImage):
1047         (WebKit::WebPageProxy::didPerformDictionaryLookup):
1048         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
1049         (WebKit::WebPageProxy::makeFirstResponder):
1050         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
1051         (WebKit::WebPageProxy::colorSpace):
1052         (WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged):
1053         (WebKit::WebPageProxy::setPluginComplexTextInputState):
1054         (WebKit::WebPageProxy::executeSavedCommandBySelector):
1055         (WebKit::WebPageProxy::intrinsicContentSizeDidChange):
1056         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
1057         (WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
1058         (WebKit::WebPageProxy::showPDFContextMenu):
1059         (WebKit::WebPageProxy::showTelephoneNumberMenu):
1060         (WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates const):
1061         (WebKit::WebPageProxy::editorStateChanged):
1062         (WebKit::WebPageProxy::startWindowDrag):
1063         (WebKit::WebPageProxy::platformWindow):
1064         (WebKit::WebPageProxy::rootViewToWindow):
1065         (WebKit::WebPageProxy::showValidationMessage):
1066         (WebKit::WebPageProxy::inspectorAttachmentView):
1067         (WebKit::WebPageProxy::remoteObjectRegistry):
1068         * UIProcess/win/WebPageProxyWin.cpp:
1069         (WebKit::WebPageProxy::viewWidget):
1070         * UIProcess/wpe/WebPageProxyWPE.cpp:
1071         (WebKit::WebPageProxy::viewBackend):
1072
1073 2018-09-11  Chris Dumez  <cdumez@apple.com>
1074
1075         Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process
1076         https://bugs.webkit.org/show_bug.cgi?id=189482
1077         <rdar://problem/44317222>
1078
1079         Reviewed by Geoffrey Garen.
1080
1081         The issue was that when we swap process on navigation, we:
1082         1. Call processDidTerminate() which calls resetState() and clears the displayed content
1083         2. Reattach the WebPageProxy to a new WebProcess
1084         3. Trigger the navigation
1085         4. Take the navigation snapshot
1086
1087         When the navigation snapshot occurs at step 4, the view is already blank in the case of
1088         process swap. To avoid the issue, we take the navigation snapshot earlier, before calling
1089         processDidTerminate() and we suppress the next navigation snapshot as it would be blank.
1090
1091         At some point, we will likely want to display the previous' WebProcess content longer,
1092         until the new WebProcess has something interesting to display. Once this is implemented,
1093         we'll likely be able to drop the early snapshotting logic.
1094
1095         * UIProcess/WebPageProxy.cpp:
1096         (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
1097         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1098         (WebKit::WebPageProxy::restoreFromSessionState):
1099         (WebKit::WebPageProxy::didCommitLoadForFrame):
1100         * UIProcess/WebPageProxy.h:
1101         (WebKit::WebPageProxy::suppressNextAutomaticNavigationSnapshot):
1102
1103 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
1104
1105         Add Web API Statistics Collection
1106         https://bugs.webkit.org/show_bug.cgi?id=187773
1107         <rdar://problem/44155162>
1108
1109         Reviewed by Brent Fulgham.
1110
1111         * Shared/WebCoreArgumentCoders.cpp:
1112         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1113         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1114         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
1115
1116 == Rolled over to ChangeLog-2018-09-11 ==