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