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