Begin deprecating C API
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-09-24  Alex Christensen  <achristensen@webkit.org>
2
3         Begin deprecating C API
4         https://bugs.webkit.org/show_bug.cgi?id=189810
5
6         Reviewed by Andy Estes.
7
8         * Shared/API/c/WKDeprecated.h: Added.
9         * UIProcess/API/C/WKPage.h:
10         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
11         (setUpPagePolicyClient):
12         (-[WKBrowsingContextController setPolicyDelegate:]):
13         * WebKit.xcodeproj/project.pbxproj:
14
15 2018-09-24  Chris Dumez  <cdumez@apple.com>
16
17         Unreviewed, rolling out r236368.
18
19         Caused WebKit.NetworkProcessCrashWithPendingConnection API
20         test to crash (Bug 189926)
21
22         Reverted changeset:
23
24         "Extending the lifetime of a NetworkProcessProxy /
25         StorageProcessProxy may cause it to have a stale
26         WebProcessPool pointer"
27         https://bugs.webkit.org/show_bug.cgi?id=189851
28         https://trac.webkit.org/changeset/236368
29
30 2018-09-21  Simon Fraser  <simon.fraser@apple.com>
31
32         Remove the old "AcceleratedCompositingForOverflowScroll" code
33         https://bugs.webkit.org/show_bug.cgi?id=189870
34
35         Reviewed by Zalan Bujtas.
36
37         The "AcceleratedCompositingForOverflowScroll" code was added to allow overflow:scroll to use
38         composited scrolling if an overflow:scroll could be made a stacking context without affecting
39         z-order. We need overflow:scroll to be accelerated always, so a different approach is needed.
40         Remove this old code (unused by any platform?) to make working on new code easier.
41
42         * Shared/WebPreferences.yaml:
43         * UIProcess/API/C/WKPreferences.cpp:
44         (WKPreferencesSetAcceleratedCompositingForOverflowScrollEnabled): Deleted.
45         (WKPreferencesGetAcceleratedCompositingForOverflowScrollEnabled): Deleted.
46         * UIProcess/API/C/WKPreferencesRefPrivate.h:
47
48 2018-09-24  Chris Dumez  <cdumez@apple.com>
49
50         Do not do early processing of incoming sync IPC unless we're waiting for a sync IPC reply
51         https://bugs.webkit.org/show_bug.cgi?id=186941
52
53         Reviewed by Alex Christensen.
54
55         The comment was claiming we were processing incoming sync messages while waiting for a
56         sync IPC reply to prevent deadlocks. However, the code was failing to check if we were
57         waiting for a sync IPC reply. As a result, incoming sync IPC messages would get processed
58         early no matter what, jumping the line. This was the source of the flakiness in the blob
59         tests since the IPC to register the blob in the network process was async and the follow-up
60         IPC to ask the network process for the blob size was sync. The sync message to get the blob
61         size would jump the line and get processed before the async message to register the blob.
62         As a result, the network process would not know about the blob yet and return size 0. Of
63         course, this could happen if the network process was sending sync IPC at the time. However,
64         the network process never sends any sync IPC and therefore, should never process incoming
65         IPC messages out of order.
66
67         * Platform/IPC/Connection.cpp:
68         (IPC::Connection::processIncomingMessage):
69
70 2018-09-24  Daniel Bates  <dabates@apple.com>
71
72         [iOS] Key code is 0 for many hardware keyboard keys
73         https://bugs.webkit.org/show_bug.cgi?id=189604
74
75         Reviewed by Wenson Hsieh.
76
77         For a hardware keyboard-generated event (an event with a non-nill event._hidEvent) pass
78         the key code for the event. Otherwise, do what we do now and pass 0 as the event is likely
79         a software keyboard-generated event.
80
81         * Platform/spi/ios/UIKitSPI.h: Add some more SPI.
82         * UIProcess/ios/WKContentViewInteraction.mm:
83         (-[WKContentView handleKeyEvent:]):
84
85 2018-09-24  Brian Burg  <bburg@apple.com>
86
87         Web Inspector: topContentInset is not accounted for when inspecting a WKWebView and docked to side
88         https://bugs.webkit.org/show_bug.cgi?id=189859
89
90         Reviewed by Joseph Pecoraro.
91
92         * UIProcess/mac/WebInspectorProxyMac.mm:
93         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
94         Add special cases for inspecting a WKWebView. We already special-case for WKView.
95
96 2018-09-24  Miguel Gomez  <magomez@igalia.com>
97
98         [GTK][WPE] Compositing indicators are not working
99         https://bugs.webkit.org/show_bug.cgi?id=189915
100
101         Reviewed by Žan Doberšek.
102
103         Pass the debugBorder and repaintCount parameters to the TextureMapperLayer when required.
104
105         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
106         (WebKit::CoordinatedGraphicsScene::updateSceneState):
107
108 2018-09-21  Dean Jackson  <dino@apple.com>
109
110         Add PointerEvent, plus feature flag, plus Web Platform Tests
111         https://bugs.webkit.org/show_bug.cgi?id=189867
112         <rdar://problem/44697384>
113
114         Reviewed by Simon Fraser.
115
116         Add PointerEvents as an experimental feature.
117
118         * Shared/WebPreferences.yaml:
119
120 2018-09-21  Brian Burg  <bburg@apple.com>
121
122         Web Inspector: dock buttons disappear if Web Inspector goes fullscreen
123         https://bugs.webkit.org/show_bug.cgi?id=189865
124         <rdar://problem/42600534>
125
126         Reviewed by Matt Baker.
127
128         When a fullscreen Safari tab has a docked Inspector, and the "detach" button
129         is clicked, Inspector goes into its own fullscreen window. In that window,
130         there are no buttons for docking to side or bottom.
131
132         It turns out that we always send setDockingUnavailable(true) if the inspector
133         window is fullscreen. This eventually causes the inspector to reflect that
134         by hiding the docking-related buttons.
135
136         * UIProcess/mac/WebInspectorProxyMac.mm:
137         (WebKit::WebInspectorProxy::platformCanAttach):
138         This early exit does not seem to serve any purpose, so remove it.
139
140 2018-09-21  Chris Dumez  <cdumez@apple.com>
141
142         Extending the lifetime of a NetworkProcessProxy / StorageProcessProxy may cause it to have a stale WebProcessPool pointer
143         https://bugs.webkit.org/show_bug.cgi?id=189851
144
145         Reviewed by Alex Christensen.
146
147         Extending the lifetime of a NetworkProcessProxy / StorageProcessProxy may cause it to have a stale WebProcessPool pointer:
148         - NetworkProcessProxy::m_processPool
149         - StorageProcessProxy::m_processPool
150
151         Those data members are C++ references because it is expected that the WebProcessPool owns the NetworkProcessProxy and
152         StorageProcessProxy. However, since NetworkProcessProxy / StorageProcessProxy are refcounted, it has happened that code
153         extends the lifetime of those past their process pool, leading to stale prrocess pool usage. The fix for these crashes
154         so far as been to ref the WebProcessPool instead of the NetworkProcessProxy / StorageProcessProxy. However, given how
155         error-prone this is, this patch updates NetworkProcessProxy / StorageProcessProxy so that they forward their refcounting
156         to the WebProcessPool.
157
158         * UIProcess/ChildProcessProxy.h:
159         * UIProcess/Network/NetworkProcessProxy.cpp:
160         (WebKit::NetworkProcessProxy::ref):
161         (WebKit::NetworkProcessProxy::deref):
162         (WebKit::NetworkProcessProxy::didClose):
163         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
164         (WebKit::NetworkProcessProxy::create): Deleted.
165         * UIProcess/Network/NetworkProcessProxy.h:
166         * UIProcess/Plugins/PluginProcessProxy.h:
167         * UIProcess/Storage/StorageProcessProxy.cpp:
168         (WebKit::StorageProcessProxy::ref):
169         (WebKit::StorageProcessProxy::deref):
170         (WebKit::StorageProcessProxy::create): Deleted.
171         * UIProcess/Storage/StorageProcessProxy.h:
172         * UIProcess/WebProcessPool.cpp:
173         (WebKit::WebProcessPool::ensureNetworkProcess):
174         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
175         * UIProcess/WebProcessPool.h:
176         * UIProcess/WebProcessProxy.h:
177
178 2018-09-21  Alex Christensen  <achristensen@webkit.org>
179
180         Use a Variant for FormDataElement
181         https://bugs.webkit.org/show_bug.cgi?id=189777
182
183         Reviewed by Chris Dumez.
184
185         * NetworkProcess/NetworkResourceLoadParameters.cpp:
186         (WebKit::NetworkResourceLoadParameters::encode const):
187         * NetworkProcess/NetworkResourceLoader.cpp:
188         * Shared/SessionState.h:
189         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
190         (WebKit::toHTTPBody):
191
192 2018-09-21  Alex Christensen  <achristensen@webkit.org>
193
194         Simply authentication code even more!
195         https://bugs.webkit.org/show_bug.cgi?id=189719
196
197         Reviewed by Andy Estes.
198
199         Just when you thought it couldn't get simpler and more elegant, it can!
200
201         * NetworkProcess/Downloads/Download.cpp:
202         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
203         * NetworkProcess/NetworkLoad.cpp:
204         * NetworkProcess/PingLoad.cpp:
205         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
206         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
207         * Shared/Authentication/AuthenticationChallengeDisposition.h: Added.
208         * Shared/Authentication/AuthenticationManager.cpp:
209         (WebKit::AuthenticationManager::completeAuthenticationChallenge):
210         (WebKit::AuthenticationManager::useCredentialForChallenge): Deleted.
211         (WebKit::AuthenticationManager::useCredentialForSingleChallenge): Deleted.
212         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge): Deleted.
213         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): Deleted.
214         (WebKit::AuthenticationManager::cancelChallenge): Deleted.
215         (WebKit::AuthenticationManager::cancelSingleChallenge): Deleted.
216         (WebKit::AuthenticationManager::performDefaultHandling): Deleted.
217         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): Deleted.
218         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue): Deleted.
219         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): Deleted.
220         * Shared/Authentication/AuthenticationManager.h:
221         * Shared/Authentication/AuthenticationManager.messages.in:
222         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
223         (WebKit::AuthenticationManager::initializeConnection):
224         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
225         (WKAuthenticationDecisionListenerUseCredential):
226         * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
227         (-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
228         * UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
229         (webkit_authentication_request_authenticate):
230         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
231         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
232         * UIProcess/Authentication/AuthenticationDecisionListener.cpp:
233         (WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
234         (WebKit::AuthenticationDecisionListener::~AuthenticationDecisionListener):
235         (WebKit::AuthenticationDecisionListener::useCredential):
236         (WebKit::AuthenticationDecisionListener::cancel):
237         (WebKit::AuthenticationDecisionListener::performDefaultHandling):
238         (WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue):
239         * UIProcess/Authentication/AuthenticationDecisionListener.h:
240         (WebKit::AuthenticationDecisionListener::create):
241         * UIProcess/Cocoa/DownloadClient.mm:
242         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
243         * UIProcess/Cocoa/NavigationState.mm:
244         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
245         * WebKit.xcodeproj/project.pbxproj:
246
247 2018-09-21  Chris Dumez  <cdumez@apple.com>
248
249         Regression(Mojave): Resuming a WK2 download crashes
250         https://bugs.webkit.org/show_bug.cgi?id=189838
251         <rdar://problem/44618538>
252
253         Reviewed by Alex Christensen.
254
255         Update our workaround to tweak the download resume data to include the actual download path so that
256         it works on macOS Mojave and up. Unfortunately, the resume data internal representation has changed,
257         causing our previous workaround to fail.
258
259         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
260         (WebKit::Download::resume):
261
262 2018-09-21  Youenn Fablet  <youenn@apple.com>
263
264         Whitelist two additional plugins
265         https://bugs.webkit.org/show_bug.cgi?id=189832
266         <rdar://problem/44628127>
267
268         Reviewed by Brent Fulgham.
269
270         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
271         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):
272
273 2018-09-21  Woodrow Wang  <woodrow_wang@apple.com>
274
275         Clear persistent storage between tests for resourceLoadStatistics
276         https://bugs.webkit.org/show_bug.cgi?id=189684
277         <rdar://problem/44540099>
278
279         Reviewed by Chris Dumez.
280
281         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
282         (WKWebsiteDataStoreStatisticsResetToConsistentState):
283         * UIProcess/Network/NetworkProcessProxy.cpp:
284         (WebKit::NetworkProcessProxy::didClose):
285         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
286         * UIProcess/WebResourceLoadStatisticsStore.cpp:
287         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
288
289         Remove function only called in testing for resetting statistics to consistent
290         state. 
291
292         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): Deleted.
293
294         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
295         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
296         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
297
298 2018-09-20  Ryan Haddad  <ryanhaddad@apple.com>
299
300         Unreviewed, rolling out r236289.
301
302         Caused 8 TestWebKitAPI.ContentFiltering test failures.
303
304         Reverted changeset:
305
306         "InjectedBundle parameters often need initialization function
307         called before unarchiving"
308         https://bugs.webkit.org/show_bug.cgi?id=189709
309         https://trac.webkit.org/changeset/236289
310
311 2018-09-20  Youenn Fablet  <youenn@apple.com>
312
313         Allow additional plug-ins to run unsandboxed
314         https://bugs.webkit.org/show_bug.cgi?id=189791
315         <rdar://problem/44628127>
316
317         Reviewed by Brent Fulgham.
318
319         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
320         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):
321
322 2018-09-20  Brent Fulgham  <bfulgham@apple.com>
323
324         InjectedBundle parameters often need initialization function called before unarchiving
325         https://bugs.webkit.org/show_bug.cgi?id=189709
326         <rdar://problem/44573653>
327
328         Reviewed by Chris Dumez.
329
330         Handle the case where the InjectedBundle parameters do not successfully decode because they contain
331         an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
332         after the bundle initialiation function runs, which gives the embedding program the opportunity to
333         register additional classes that are safe for serialization.
334         
335         Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
336         This new method returns 'true' if the serialization was successful, otherwise it returns false.
337
338         Revise 'initialize' to call this new method and check the return value. If it fails, try decoding the
339         bundle parameters after the bundle's initialization function is called.
340
341         * WebProcess/InjectedBundle/InjectedBundle.h:
342         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
343         (WebKit::InjectedBundle::initialize): Use the new method.
344         (WebKit::InjectedBundle::decodeBundleParameters): Added.
345         (WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
346         'classesForCoder' method to unarchive the passed bundle parameters, rather than the
347         NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
348         NSDictionary object may itself hold other kinds of objects.
349
350 2018-09-20  Jer Noble  <jer.noble@apple.com>
351
352         Enable Modern EME by default
353         https://bugs.webkit.org/show_bug.cgi?id=189794
354
355         Reviewed by Jon Lee.
356
357         * Shared/WebPreferences.yaml:
358
359 2018-09-20  Thibault Saunier  <tsaunier@igalia.com>
360
361         [GTK][WPE] Make sure MediaDeviceEnabled and PeerConnectionEnabled are always synced with enable-media-stream
362         https://bugs.webkit.org/show_bug.cgi?id=188704
363
364         By default m_isMediaDevicesEnabled and m_isScreenCaptureEnabled are false but
365         m_isMediaStreamEnabled is true meaning that in the WPE minibrowser getUserMedia
366         was disabled even if we explicitly set `"enable-media-stream", TRUE`.
367
368         Reviewed by Michael Catanzaro.
369
370         * UIProcess/API/glib/WebKitSettings.cpp:
371         (webKitSettingsConstructed):
372
373 2018-09-20  Justin Michaud  <justin_michaud@apple.com>
374
375         Implement CSS Custom Properties and Values Skeleton
376         https://bugs.webkit.org/show_bug.cgi?id=189694
377
378         Reviewed by Simon Fraser.
379
380         Add feature flag for CSS custom properties and values api
381
382         * Shared/WebPreferences.yaml:
383         * WebProcess/InjectedBundle/InjectedBundle.cpp:
384         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
385
386 2018-09-19  Dean Jackson  <dino@apple.com>
387
388         Temporarily move fullscreen back to experimental features
389         https://bugs.webkit.org/show_bug.cgi?id=189770
390         <rdar://problem/44619282>
391
392         Revert this change now that there is a commit to cherry-pick.
393
394         * Shared/WebPreferences.yaml:
395
396 2018-09-20  Chris Dumez  <cdumez@apple.com>
397
398         Unreviewed crash fix after r236226.
399
400         We need to protect |this| in WebProcessProxy::requestTermination().
401
402         * UIProcess/WebProcessProxy.cpp:
403         (WebKit::WebProcessProxy::requestTermination):
404
405 2018-09-20  Antti Koivisto  <antti@apple.com>
406
407         REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac
408         https://bugs.webkit.org/show_bug.cgi?id=189663
409         <rdar://problem/44184955>
410
411         Reviewed by Geoff Garen and Chris Dumez.
412
413         We need to keep the layer tree of the previous page alive and visible until we have something
414         to render on the new page. With PSON on Mac this means that we should keep displaying the
415         layer tree from the previus process.
416
417         This patch moves the management of 'attaching' the drawing area (Mac only concept) from web process
418         to UI process. This is when we parent the layer tree to the view root layer. It also ensures that
419         the layer tree is not deleted too early on process swap and that it still eventually gets deleted.
420
421         * UIProcess/DrawingAreaProxy.h:
422         (WebKit::DrawingAreaProxy::attachInWebProcess):
423         * UIProcess/SuspendedPageProxy.cpp:
424         (WebKit::messageNamesToIgnoreWhileSuspended):
425         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
426
427         We no longer tear down drawing area (layer tree) for suspended pages automatically. Send an explicit
428         message for it.
429
430         * UIProcess/SuspendedPageProxy.h:
431         * UIProcess/WebPageProxy.cpp:
432         (WebKit::WebPageProxy::didCompletePageTransition):
433
434         Attach the drawing area if appropriate.
435
436         (WebKit::WebPageProxy::resetStateAfterProcessExited):
437
438         Call PageClien::processWillSwap instead of processDidExit when appropriate.
439
440         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
441
442         This is called when we have switched to the new layer tree.
443         Tear down the drawing area in the previus process.
444
445         * UIProcess/WebPageProxy.h:
446         * UIProcess/WebPageProxy.messages.in:
447         * UIProcess/ios/PageClientImplIOS.h:
448         * UIProcess/ios/PageClientImplIOS.mm:
449         (WebKit::PageClientImpl::processWillSwap):
450
451         On iOS this just call processDidExit for now.
452
453         * UIProcess/mac/PageClientImplMac.h:
454         * UIProcess/mac/PageClientImplMac.mm:
455         (WebKit::PageClientImpl::processWillSwap):
456         (WebKit::PageClientImpl::processDidExit):
457
458         Add processWillSwap separately from processDidExit. They are currently the same
459         except processWillSwap doesn't clear the root layer.
460
461         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
462         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
463         (WebKit::TiledCoreAnimationDrawingAreaProxy::attachInWebProcess):
464
465         Send a message to the web process to attach the drawing area.
466
467         * WebProcess/WebPage/DrawingArea.h:
468         (WebKit::DrawingArea::attach):
469         (WebKit::DrawingArea::attachDrawingArea): Deleted.
470
471         Rename to be less redundant.
472
473         * WebProcess/WebPage/DrawingArea.messages.in:
474         * WebProcess/WebPage/WebPage.cpp:
475         (WebKit::WebPage::reinitializeWebPage):
476
477         Don't attach drawing area automatically. It will be done by a message from UI process.
478
479         (WebKit::WebPage::setLayerTreeStateIsFrozen):
480
481         Layer tree is always frozen in a suspended process (if it exists).
482
483         (WebKit::WebPage::didReceivePolicyDecision):
484
485         Suspend immediately when receiving policy decision to avoid flash on 'about:blank' loading.
486
487         (WebKit::WebPage::didStartPageTransition):
488         (WebKit::WebPage::didCompletePageTransition):
489
490         Notify UI process of transition completion.
491
492         (WebKit::WebPage::setIsSuspended):
493         (WebKit::WebPage::tearDownDrawingAreaForSuspend):
494         * WebProcess/WebPage/WebPage.h:
495         * WebProcess/WebPage/WebPage.messages.in:
496         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
497         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
498         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
499
500         Don't attach drawing area automatically. It will be done by a message from UI process.
501
502         (WebKit::TiledCoreAnimationDrawingArea::attach):
503         (WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Deleted.
504
505 2018-09-20  Tomas Popela  <tpopela@redhat.com>
506
507         [GTK] Always prints in portrait when landscape is requested
508         https://bugs.webkit.org/show_bug.cgi?id=189543
509
510         Reviewed by Michael Catanzaro.
511
512         We have to change the surface size based on the requested orientation.
513         Otherwise only portrait will be printed as it's hardcoded.
514
515         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
516
517 2018-09-19  Dean Jackson  <dino@grorg.org>
518
519         Temporarily move fullscreen back to experimental features
520         https://bugs.webkit.org/show_bug.cgi?id=189770
521         <rdar://problem/44619282>
522
523         Reviewed by Simon Fraser.
524
525         Make fullscreen an experimental feature again.
526
527         * Shared/WebPreferences.yaml:
528
529 2018-09-19  Dawei Fenton  <realdawei@apple.com>
530
531         Unreviewed, rolling out r236229.
532
533         caused API timouts on mac and ios
534
535         Reverted changeset:
536
537         "Clear persistent storage between tests for
538         resourceLoadStatistics"
539         https://bugs.webkit.org/show_bug.cgi?id=189684
540         https://trac.webkit.org/changeset/236229
541
542 2018-09-19  Alex Christensen  <achristensen@webkit.org>
543
544         REGRESSION(236154) C API clients not using WKPageSetPageNavigationClient couldn't complete HTTPS requests
545         https://bugs.webkit.org/show_bug.cgi?id=189771
546
547         Reviewed by Tim Horton.
548
549         * UIProcess/API/APINavigationClient.h:
550         (API::NavigationClient::didReceiveAuthenticationChallenge):
551         Perform default behavior if there's an authentication challenge but we're using the default navigation client.
552         I wish we had infrastructure to test this but WebKitTestRunner uses WKPageSetNavigationClient
553         and we don't have the ability to do networking from API tests.  This is a growing problem I intend to solve.
554
555 2018-09-19  Woodrow Wang  <woodrow_wang@apple.com>
556
557         Clear persistent storage between tests for resourceLoadStatistics
558         https://bugs.webkit.org/show_bug.cgi?id=189684
559         <rdar://problem/44540099>
560
561         Reviewed by Chris Dumez.
562
563         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
564         (WKWebsiteDataStoreStatisticsResetToConsistentState):
565         * UIProcess/WebResourceLoadStatisticsStore.cpp:
566         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
567
568         Remove function only called in testing for resetting statistics to consistent
569         state. 
570         
571         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): Deleted.
572
573 2018-09-19  Chris Dumez  <cdumez@apple.com>
574
575         Crash under WebPageProxy::decidePolicyForNavigationAction()
576         https://bugs.webkit.org/show_bug.cgi?id=189763
577         <rdar://problem/44597111>
578
579         Reviewed by Alex Christensen.
580
581         Update WebNavigationState::navigation() / WebNavigationState::takeNavigation()
582         to return a pointer instead of a reference as we have evidence that they can
583         return null. I kept the debug assertions to try and catch the cases where we
584         return null but at least we stop crashing in release builds.
585
586         * UIProcess/WebNavigationState.cpp:
587         (WebKit::WebNavigationState::navigation):
588         (WebKit::WebNavigationState::takeNavigation):
589         * UIProcess/WebNavigationState.h:
590         * UIProcess/WebPageProxy.cpp:
591         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
592         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
593         (WebKit::WebPageProxy::didCommitLoadForFrame):
594         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
595         (WebKit::WebPageProxy::didFinishLoadForFrame):
596         (WebKit::WebPageProxy::didFailLoadForFrame):
597         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
598         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
599         (WebKit::WebPageProxy::decidePolicyForResponse):
600
601 2018-09-19  Chris Dumez  <cdumez@apple.com>
602
603         Crash under WebProcessProxy::suspendedPageWasDestroyed(WebKit::SuspendedPageProxy&)
604         https://bugs.webkit.org/show_bug.cgi?id=189721
605         <rdar://problem/44359788>
606
607         Reviewed by Geoffrey Garen.
608
609         Fix crash when destroying a SuspendedPageProxy whose WebProcessProxy was already
610         destroyed.
611
612         * UIProcess/SuspendedPageProxy.cpp:
613         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
614         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
615         * UIProcess/SuspendedPageProxy.h:
616         (WebKit::SuspendedPageProxy::process const):
617         Update SuspendedPageProxy::m_process to be a RefPtr<> instead of a raw pointer, similarly
618         to what we do in WebPageProxy. Relying on the WebProcessProxy to not get destroyed is
619         risky as this crash demonstrates.
620
621         * UIProcess/WebProcessProxy.cpp:
622         (WebKit::WebProcessProxy::requestTermination):
623         When a WebProcessProxy is terminated (by client or WebKit due to memory / cpu usage), call
624         webProcessDidClose() on all SuspendedPages, similarly to what we do in case of a crash in
625         processDidTerminateOrFailedToLaunch(). Failing to do so means that the SuspendedPageProxy
626         may still have a pointer to this WebProcessProxy, even though WebProcessProxy::shutDown()
627         has been called (which may destroy the WebProcessProxy).
628
629 2018-09-19  John Wilander  <wilander@apple.com>
630
631         Resource Load Statistics: Add optional cap on partitioned cache max age
632         https://bugs.webkit.org/show_bug.cgi?id=189711
633         <rdar://problem/39246837>
634
635         Reviewed by Antti Koivisto and Chris Dumez.
636
637         These changes add the capability to set a max age cap for prevalent resources
638         and consults it when retrieving cache entries. If an entry is capped and found
639         to be too old, it will not be used but instead removed from the cache.
640
641         This functionality is off by default because no cap is set by default.
642
643         * NetworkProcess/NetworkProcess.cpp:
644         (WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
645         (WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
646             Infrastructure for testing.
647         * NetworkProcess/NetworkProcess.h:
648         * NetworkProcess/NetworkProcess.messages.in:
649         * NetworkProcess/NetworkResourceLoader.cpp:
650         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
651             Now sends in the session ID in the retrieve call.
652         * NetworkProcess/cache/NetworkCache.cpp:
653         (WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap):
654             Static convenience function.
655         (WebKit::NetworkCache::makeUseDecision):
656             Now receives an optional maxAge parameter and checks
657             hasReachedPrevalentResourceAgeCap() first.
658         (WebKit::NetworkCache::Cache::retrieve):
659             Now takes a session ID.
660         * NetworkProcess/cache/NetworkCache.h:
661         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
662         (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
663             Added UseDecision::NoDueToPrevalentResourceAgeCap which causes a
664             return of WebCore::DiagnosticLoggingKeys::otherKey().
665         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
666         (WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
667         (WKWebsiteDataStoreStatisticsResetToConsistentState):
668             Infrastructure for testing.
669         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
670         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
671         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
672             Now supports a user default ResourceLoadStatisticsCacheMaxAgeCap.
673         * UIProcess/Network/NetworkProcessProxy.cpp:
674         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
675         (WebKit::NetworkProcessProxy::grantStorageAccess):
676         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
677         (WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
678         (WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
679         (WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
680         (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
681         (WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources):
682         (WebKit::nextRequestStorageAccessContextId): Deleted.
683             Deleted this to make all code use the generic generateCallbackID().
684         * UIProcess/Network/NetworkProcessProxy.h:
685         * UIProcess/Network/NetworkProcessProxy.messages.in:
686             Used to transfer the setting from the UI process to the network process. 
687         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
688         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
689         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
690         * UIProcess/WebResourceLoadStatisticsStore.cpp:
691         (WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
692         * UIProcess/WebResourceLoadStatisticsStore.h:
693         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
694         (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
695         (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
696         * UIProcess/WebsiteData/WebsiteDataStore.h:
697
698 2018-09-18  Brent Fulgham  <bfulgham@apple.com>
699
700         [iOS] Allow WebContent process to check the "Protocol Characteristics" of files to which it has access
701         https://bugs.webkit.org/show_bug.cgi?id=189712
702         <rdar://problem/44386429>
703
704         Reviewed by Alex Christensen.
705
706         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
707
708 2018-09-18  Chris Dumez  <cdumez@apple.com>
709
710         [iOS] Crash under WebPageProxy::navigationGestureSnapshotWasRemoved()
711         https://bugs.webkit.org/show_bug.cgi?id=189714
712         <rdar://problem/32839498>
713
714         Reviewed by Tim Horton.
715
716         The ViewGestureController::removeSwipeSnapshot() implementation for iOS calls
717         navigationGestureSnapshotWasRemoved() on m_webPageProxyForBackForwardListForCurrentSwipe.
718         m_webPageProxyForBackForwardListForCurrentSwipe can differ from m_webPageProxy, and
719         is a RefPtr<>. This means that this WebPageProxy's WKWebView might have been deallocated,
720         in which case we'll crash when trying to use the pageClient in
721         WebPageProxy::navigationGestureSnapshotWasRemoved(). To address the issue, we now return
722         early in WebPageProxy::navigationGestureSnapshotWasRemoved() if m_isClosed is true,
723         after resetting m_isShowingNavigationGestureSnapshot to false but *before* trying to use
724         the pageClient. When a WKWebView is deallocated, it calls WebPageProxy::close(), which
725         sets m_isClosed to true.
726
727         * UIProcess/WebPageProxy.cpp:
728         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
729
730 2018-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
731
732         [Curl] Limit capturing extra metrics for Web Inspector when not required.
733         https://bugs.webkit.org/show_bug.cgi?id=189520
734
735         Reviewed by Alex Christensen.
736
737         Respect the value of NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() to reduce the process
738         time when they are not needed.
739
740         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
741         (WebKit::NetworkDataTaskCurl::createCurlRequest):
742
743 2018-09-18  Alex Christensen  <achristensen@webkit.org>
744
745         Make WebPageProxy always have a API::NavigationClient instead of always having a API::LoaderClient and API::PolicyClient
746         https://bugs.webkit.org/show_bug.cgi?id=189012
747
748         Reviewed by Andy Estes.
749
750         When WebKit2 was being developed, we initially made the C API WKPageSetPagePolicyClient and WKPageSetPageLoaderClient.
751         When we released WKWebView, it was using WKNavigationDelegate, equivalent to WKPageSetPageNavigationClient.
752         To support one or the other, we would use the navigation client if it was present, but if not we would fall back to the
753         loader or policy client.  Since the loader and policy clients are now being minimally supported only until legacy
754         software migrates to the navigation client, we are adding new functionality to the navigation client.
755         Making the navigation client the default and using the loader or policy client only if they are present supports
756         the legacy software and makes us have fewer forgotten null checks when adding new functionality to the navigation client.
757
758         * UIProcess/API/C/WKPage.cpp:
759         (WKPageSetPageNavigationClient):
760         * UIProcess/Cocoa/NavigationState.h:
761         * UIProcess/Cocoa/NavigationState.mm:
762         (WebKit::NavigationState::createNavigationClient):
763         * UIProcess/WebPageProxy.cpp:
764         (WebKit::WebPageProxy::WebPageProxy):
765         (WebKit::WebPageProxy::setNavigationClient):
766         (WebKit::WebPageProxy::setLoaderClient):
767         (WebKit::WebPageProxy::setPolicyClient):
768         (WebKit::WebPageProxy::close):
769         (WebKit::WebPageProxy::didChangeBackForwardList):
770         (WebKit::WebPageProxy::willGoToBackForwardListItem):
771         (WebKit::WebPageProxy::findPlugin):
772         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
773         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
774         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
775         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
776         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
777         (WebKit::WebPageProxy::didCommitLoadForFrame):
778         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
779         (WebKit::WebPageProxy::didFinishLoadForFrame):
780         (WebKit::WebPageProxy::didFailLoadForFrame):
781         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
782         (WebKit::WebPageProxy::didReachLayoutMilestone):
783         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
784         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
785         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
786         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
787         (WebKit::WebPageProxy::decidePolicyForResponse):
788         (WebKit::WebPageProxy::contentRuleListNotification):
789         (WebKit::WebPageProxy::webGLPolicyForURL):
790         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
791         (WebKit::WebPageProxy::processDidBecomeUnresponsive):
792         (WebKit::WebPageProxy::processDidBecomeResponsive):
793         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
794         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
795         (WebKit::WebPageProxy::wrapCryptoKey):
796         (WebKit::WebPageProxy::unwrapCryptoKey):
797         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
798         (WebKit::WebPageProxy::navigationGestureDidBegin):
799         (WebKit::WebPageProxy::navigationGestureWillEnd):
800         (WebKit::WebPageProxy::navigationGestureDidEnd):
801         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
802         * UIProcess/WebPageProxy.h:
803
804 2018-09-18  Alex Christensen  <achristensen@webkit.org>
805
806         Clean up AuthenticationChallengeProxy
807         https://bugs.webkit.org/show_bug.cgi?id=189668
808
809         Reviewed by Youenn Fablet.
810
811         At its core, it's a CompletionHandler with some information.
812         Make it more elegant and simple with no change in behavior and reduce the complexity of this security-sensitive object.
813
814         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
815         (toNSURLSessionAuthChallengeDisposition):
816         * Shared/Authentication/AuthenticationManager.cpp:
817         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
818         * Shared/Authentication/AuthenticationManager.h:
819         * UIProcess/API/C/WKAuthenticationChallenge.cpp:
820         (WKAuthenticationChallengeGetDecisionListener):
821         (WKAuthenticationChallengeGetProtectionSpace):
822         (WKAuthenticationChallengeGetProposedCredential):
823         (WKAuthenticationChallengeGetPreviousFailureCount):
824         * UIProcess/API/C/WKPage.cpp:
825         (WKPageSetPageNavigationClient):
826         * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
827         (-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]):
828         (-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
829         (-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]):
830         (-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]):
831         (-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]):
832         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
833         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
834         (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy): Deleted.
835         (WebKit::AuthenticationChallengeProxy::useCredential): Deleted.
836         (WebKit::AuthenticationChallengeProxy::cancel): Deleted.
837         (WebKit::AuthenticationChallengeProxy::performDefaultHandling): Deleted.
838         (WebKit::AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue): Deleted.
839         (WebKit::AuthenticationChallengeProxy::proposedCredential const): Deleted.
840         (WebKit::AuthenticationChallengeProxy::protectionSpace const): Deleted.
841         (WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore): Deleted.
842         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
843         (WebKit::AuthenticationChallengeProxy::create):
844         (WebKit::AuthenticationChallengeProxy::listener const):
845         (WebKit::AuthenticationChallengeProxy::previousFailureCount const): Deleted.
846         * UIProcess/Authentication/AuthenticationDecisionListener.cpp:
847         (WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
848         (WebKit::AuthenticationDecisionListener::~AuthenticationDecisionListener):
849         (WebKit::AuthenticationDecisionListener::useCredential):
850         (WebKit::AuthenticationDecisionListener::cancel):
851         (WebKit::AuthenticationDecisionListener::performDefaultHandling):
852         (WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue):
853         (WebKit::AuthenticationDecisionListener::detachChallenge): Deleted.
854         * UIProcess/Authentication/AuthenticationDecisionListener.h:
855         (WebKit::AuthenticationDecisionListener::create):
856         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
857         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
858         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const): Deleted.
859         * UIProcess/Cocoa/DownloadClient.mm:
860         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
861         * UIProcess/Cocoa/NavigationState.mm:
862         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
863         * UIProcess/Downloads/DownloadProxy.cpp:
864         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
865         * UIProcess/Network/NetworkProcessProxy.cpp:
866         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
867         * UIProcess/ServiceWorkerProcessProxy.cpp:
868         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
869         * UIProcess/WebPageProxy.cpp:
870         (WebKit::WebPageProxy::secKeyProxyStore):
871         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
872         * UIProcess/WebPageProxy.h:
873
874 2018-09-18  Ben Richards  <benton_richards@apple.com>
875
876         Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
877         https://bugs.webkit.org/show_bug.cgi?id=188601
878
879         Reviewed by Dan Bernstein.
880
881         Added a script to the process entitlements build phase of the WebContent service that copies resource
882         files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
883         be used by clients who would like to make a custom WebContent service.
884
885         * Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
886         * WebKit.xcodeproj/project.pbxproj:
887         * WebProcess/API/Cocoa/WKWebProcess.h: Drive-by fix to make this header compileable alone.
888
889 2018-09-18  Ryan Haddad  <ryanhaddad@apple.com>
890
891         Unreviewed, rolling out r236138.
892
893         Caused API test and layout test failures on iOS.
894
895         Reverted changeset:
896
897         "REGRESSION (PSON): White or Black flash occurs when process
898         swapping on navigation on Mac"
899         https://bugs.webkit.org/show_bug.cgi?id=189663
900         https://trac.webkit.org/changeset/236138
901
902 2018-09-18  Eric Carlson  <eric.carlson@apple.com>
903
904         Always log when granting/revoking capture sandbox extensions
905         https://bugs.webkit.org/show_bug.cgi?id=189701
906         <rdar://problem/44564029>
907
908         Reviewed by Youenn Fablet.
909
910         * UIProcess/UserMediaProcessManager.cpp:
911         (WebKit::UserMediaProcessManager::willCreateMediaStream): Always log.
912         (WebKit::UserMediaProcessManager::endedCaptureSession): Ditto.
913
914         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
915         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Ditto.
916         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Ditto.
917
918 2018-09-18  Youenn Fablet  <youenn@apple.com>
919
920         Enable Unified Plan by default
921         https://bugs.webkit.org/show_bug.cgi?id=189675
922
923         Reviewed by Eric Carlson.
924
925         * Shared/WebPreferences.yaml:
926
927 2018-09-18  Antti Koivisto  <antti@apple.com>
928
929         REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac
930         https://bugs.webkit.org/show_bug.cgi?id=189663
931         <rdar://problem/44184955>
932
933         Reviewed by Geoff Garen.
934
935         We need to keep the layer tree of the previous page alive and visible until we have something
936         to render on the new page. With PSON on Mac this means that we should keep displaying the
937         layer tree from the previus process.
938
939         This patch moves the management of 'attaching' the drawing area (Mac only concept) from web process
940         to UI process. This is when we parent the layer tree to the view root layer. It also ensures that
941         the layer tree is not deleted too early on process swap and that it still eventually gets deleted.
942
943         * UIProcess/DrawingAreaProxy.h:
944         (WebKit::DrawingAreaProxy::attachInWebProcess):
945         * UIProcess/SuspendedPageProxy.cpp:
946         (WebKit::messageNamesToIgnoreWhileSuspended):
947         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
948
949         We no longer tear down drawing area (layer tree) for suspended pages automatically. Send an explicit
950         message for it.
951
952         * UIProcess/SuspendedPageProxy.h:
953         * UIProcess/WebPageProxy.cpp:
954         (WebKit::WebPageProxy::reattachToWebProcess):
955
956         Only call didRelaunchProcess when process actually relaunched (not navigation process launch) to
957         match not calling processDidExit in resetStateAfterProcessExited.
958
959         (WebKit::WebPageProxy::didCompletePageTransition):
960
961         Attach the drawing area if appropriate.
962
963         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
964
965         Send suspend message to WebPage immediately instead waiting for the runloop callback. This is needed so we
966         can avoid flashing the initial empty document load when the new Page object is created.
967
968         (WebKit::WebPageProxy::resetStateAfterProcessExited):
969
970         Don't call processDidExit when suspending, not exiting the process (this function needs a new name or rafactoring).
971         This avoids clearing the drawing area and flashing to black.
972
973         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
974
975         This is called when we have switched to the new layer tree.
976         Tear down the drawing area in the previus process.
977
978         * UIProcess/WebPageProxy.h:
979         * UIProcess/WebPageProxy.messages.in:
980         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
981         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
982         (WebKit::TiledCoreAnimationDrawingAreaProxy::attachInWebProcess):
983
984         Send a message to the web process to attach the drawing area.
985
986         * WebProcess/WebPage/DrawingArea.h:
987         (WebKit::DrawingArea::attach):
988         (WebKit::DrawingArea::attachDrawingArea): Deleted.
989
990         Rename to be less redundant.
991
992         * WebProcess/WebPage/DrawingArea.messages.in:
993         * WebProcess/WebPage/WebPage.cpp:
994         (WebKit::WebPage::reinitializeWebPage):
995
996         Don't attach drawing area automatically. It will be done by a message from UI process.
997
998         (WebKit::WebPage::setLayerTreeStateIsFrozen):
999
1000         Layer tree is always frozen in a suspended process (if it exists).
1001
1002         (WebKit::WebPage::didStartPageTransition):
1003         (WebKit::WebPage::didCompletePageTransition):
1004
1005         Notify UI process of transition completion.
1006
1007         (WebKit::WebPage::setIsSuspended):
1008         (WebKit::WebPage::tearDownDrawingAreaForSuspend):
1009         * WebProcess/WebPage/WebPage.h:
1010         * WebProcess/WebPage/WebPage.messages.in:
1011         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1012         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1013         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1014
1015         Don't attach drawing area automatically. It will be done by a message from UI process.
1016
1017         (WebKit::TiledCoreAnimationDrawingArea::attach):
1018         (WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Deleted.
1019
1020 2018-09-18  Claudio Saavedra  <csaavedra@igalia.com>
1021
1022         [WPE] Implement mouse event modifiers
1023         https://bugs.webkit.org/show_bug.cgi?id=189697
1024
1025         Reviewed by Carlos Garcia Campos.
1026
1027         Only "CapsLocks" is missing, as WPE doesn't support that modifier.
1028         * Shared/wpe/WebEventFactory.cpp:
1029         (WebKit::modifiersForEventModifiers):
1030         (WebKit::WebEventFactory::createWebKeyboardEvent):
1031         (WebKit::WebEventFactory::createWebMouseEvent):
1032         (WebKit::modifiersForEvent): Deleted.
1033
1034 2018-09-17  Zan Dobersek  <zdobersek@igalia.com>
1035
1036         Unreviewed build fix after r236101.
1037
1038         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1039         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
1040         Correct a BinarySemaphore::wait() call which now accepts no arguments.
1041
1042 2018-09-17  Yusuke Suzuki  <utatane.tea@gmail.com>
1043
1044         [WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
1045         https://bugs.webkit.org/show_bug.cgi?id=185339
1046
1047         Reviewed by Mark Lam.
1048
1049         * Platform/IPC/Connection.cpp:
1050         (IPC::Connection::SyncMessageState::wait):
1051         * Shared/mac/SecItemShim.cpp:
1052         (WebKit::sendSecItemRequest):
1053         Use BinarySemaphore.
1054
1055         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1056         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
1057         * UIProcess/WebStorage/StorageManager.cpp:
1058         (WebKit::StorageManager::applicationWillTerminate):
1059         * UIProcess/ios/WKActionSheetAssistant.mm:
1060         (appLinkForURL):
1061         Use BinarySemaphore to wait for async completion handler. We also fix memory leak
1062         since the old code does not call dispatch_release for the used semaphore.
1063
1064 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
1065
1066         Many modern media control tests leak documents in testing
1067         https://bugs.webkit.org/show_bug.cgi?id=189437
1068
1069         Reviewed by Darin Adler.
1070
1071         In order to accurately detect leaks in media controls tests which use lots of
1072         SVGImages, we have to:
1073         - Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
1074           to clear references to elements.
1075         - Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
1076           to drop the last handle to the CachedResource for an SVGImage.
1077         - Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
1078           to run again after that timer has fired.
1079         
1080         This should fix most of the spurious leak reports involving SVGImage documents.
1081
1082         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1083         (WKBundlePageCallAfterTasksAndTimers):
1084         (WKBundlePagePostTask): Deleted.
1085         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
1086
1087 2018-09-17  Dan Bernstein  <mitz@apple.com>
1088
1089         Try to fix Apple internal builds with the iOS 12.0 SDK.
1090
1091         * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 12.0.
1092
1093 2018-09-17  Ryan Haddad  <ryanhaddad@apple.com>
1094
1095         Unreviewed, rolling out r236092 because it breaks internal builds. Also,  remove stray '+' character from ChangeLog file.
1096
1097         * Scripts/copy-webcontent-resources-to-private-headers.sh: Removed.
1098         * WebKit.xcodeproj/project.pbxproj:
1099
1100 2018-08-17  Ben Richards  <benton_richards@apple.com>
1101
1102         Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
1103         https://bugs.webkit.org/show_bug.cgi?id=188601
1104
1105         Reviewed by Dan Bernstein.
1106
1107         Added a script to the process entitlements build phase of the WebContent service that copies resource
1108         files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
1109         be used by clients who would like to make a custom WebContent service.
1110
1111         * Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
1112         * WebKit.xcodeproj/project.pbxproj:
1113
1114
1115 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
1116
1117         Add more Fullscreen logging
1118         https://bugs.webkit.org/show_bug.cgi?id=189656
1119
1120         Reviewed by Jer Noble.
1121
1122         Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
1123         the fullscreen element.
1124
1125         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1126         (WebKit::WebFullScreenManager::WebFullScreenManager):
1127         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
1128         (WebKit::WebFullScreenManager::setPIPStandbyElement):
1129         (WebKit::WebFullScreenManager::enterFullScreenForElement):
1130         (WebKit::WebFullScreenManager::exitFullScreenForElement):
1131         (WebKit::WebFullScreenManager::willEnterFullScreen):
1132         (WebKit::WebFullScreenManager::didEnterFullScreen):
1133         (WebKit::WebFullScreenManager::willExitFullScreen):
1134         (WebKit::WebFullScreenManager::didExitFullScreen):
1135         (WebKit::WebFullScreenManager::close):
1136         * WebProcess/FullScreen/WebFullScreenManager.h:
1137
1138 2018-09-17  Tim Horton  <timothy_horton@apple.com>
1139
1140         Swipe snapshot can get stuck if swiping is disabled while it is visible
1141         https://bugs.webkit.org/show_bug.cgi?id=189667
1142         <rdar://problem/40367780>
1143
1144         Reviewed by Simon Fraser.
1145
1146         If navigation gestures are disabled while a swipe snapshot is visible,
1147         WKWebView will tear down the ViewGestureController, which means that
1148         the SnapshotRemovalTracker will no longer be around to ever remove
1149         the snapshot.
1150
1151         It's currently very hard to write a test for this because we have
1152         yet to come up with a good mechanism for testing swiping on iOS.
1153
1154         * UIProcess/API/Cocoa/WKWebView.mm:
1155         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1156         Instead of tearing down the ViewGestureController when navigation
1157         gestures are disabled, just set a bit on it that disables gestures.
1158
1159         * UIProcess/Cocoa/ViewGestureController.cpp:
1160         (WebKit::ViewGestureController::canSwipeInDirection const):
1161         * UIProcess/Cocoa/ViewGestureController.h:
1162         (WebKit::ViewGestureController::setSwipeGestureEnabled):
1163         (WebKit::ViewGestureController::isSwipeGestureEnabled):
1164         Add a bit to ViewGestureController that makes starting new gestures
1165         always fail, but allows e.g. snapshots from existing swipes to continue
1166         their usual behavior.
1167
1168 2018-09-17  Alex Christensen  <achristensen@webkit.org>
1169
1170         Expose WKWebProcess.h as a private header
1171         https://bugs.webkit.org/show_bug.cgi?id=189636
1172
1173         * WebKit.xcodeproj/project.pbxproj:
1174
1175 2018-09-17  Alex Christensen  <achristensen@webkit.org>
1176
1177         Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
1178         https://bugs.webkit.org/show_bug.cgi?id=189636
1179
1180         Reviewed by Dan Bernstein.
1181
1182         Fix a few build failures along the way.
1183
1184         * PluginProcess/mac/PluginControllerProxyMac.mm:
1185         (WebKit::PluginControllerProxy::windowAndViewFramesChanged):
1186         (WebKit::PluginControllerProxy::updateLayerHostingContext):
1187         * PluginProcess/mac/PluginProcessMac.mm:
1188         (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
1189         (WebKit::PluginProcess::platformInitializeProcess):
1190         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1191         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1192         (WebKit::XPCServiceMain):
1193         (main):
1194         * SourcesCocoa.txt:
1195         * UIProcess/API/Cocoa/WKProcessPool.mm:
1196         (+[WKProcessPool _webContentProcessXPCMain]): Deleted.
1197         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1198         * WebKit.xcodeproj/project.pbxproj:
1199         * WebProcess/API: Added.
1200         * WebProcess/API/Cocoa: Added.
1201         * WebProcess/API/Cocoa/WKWebProcess.cpp: Added.
1202         (WKWebProcessMain):
1203         * WebProcess/API/Cocoa/WKWebProcess.h: Added.
1204         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1205         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
1206         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
1207         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1208
1209 2018-09-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1210
1211         [Curl] Respond with requested authentication scheme for authentication challenge.
1212         https://bugs.webkit.org/show_bug.cgi?id=189318
1213
1214         Reviewed by Alex Christensen.
1215
1216         Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
1217         mode, the round-trip communication between the client and the server is handled by libcurl
1218         internally. That's okay for many cases. But when initial request has a credentials
1219         (i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
1220         the returned response is not 401.
1221
1222         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1223         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
1224         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
1225         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
1226         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
1227         (WebKit::NetworkDataTaskCurl::restartWithCredential):
1228         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1229
1230 2018-09-17  Woodrow Wang  <woodrow_wang@apple.com>
1231
1232         Clear pending resource load statistics' writes after tests
1233         https://bugs.webkit.org/show_bug.cgi?id=189632
1234         <rdar://problem/44469275>
1235
1236         Reviewed by Chris Dumez.
1237
1238         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1239         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1240
1241 2018-09-17  Chris Dumez  <cdumez@apple.com>
1242
1243         PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
1244         https://bugs.webkit.org/show_bug.cgi?id=189602
1245         <rdar://problem/44430549>
1246
1247         Reviewed by Geoff Garen.
1248
1249         The following fixes were made to our process swap on navigation logic:
1250         - Browsing contexts opened via window.open() with 'noopener' option now only same if
1251           they are cross-site, instead of doing a stricter cross-origin check.
1252         - Support process swapping when opening a new window via <a target="_blank" rel="noopener">
1253           that is cross-site.
1254
1255         In order to support this, the following changes were made:
1256         - Stop passing a 'isCrossOriginWindowOpenNavigation' flag to the UIProcess when navigating because:
1257           - This is specific to window.open() and does not apply to other windows opened by DOM
1258           - This forces the origin check to happens on WebContent process side instead of relying on the
1259             one in WebProcessPool in the UIProcess
1260         - Pass the origin of the requester to the UIProcess when navigating, so that the WebProcessPool
1261           can use the requester's host for the cross-site check for the initial navigation in a new window
1262           created by DOM.
1263         - Add 2 flags to WebPageProxy which indicate if the page was created by the DOM and if any provisional
1264           loads have been committed. The WebProcessPool uses theses flags to recognize initial loads in
1265           new windows created by the DOM, so that it uses the requester's origin for the cross-site check.
1266
1267         * Shared/NavigationActionData.cpp:
1268         (WebKit::NavigationActionData::encode const):
1269         (WebKit::NavigationActionData::decode):
1270         * Shared/NavigationActionData.h:
1271         * UIProcess/API/APINavigation.h:
1272         (API::Navigation::setRequesterOrigin):
1273         (API::Navigation::requesterOrigin const):
1274         * UIProcess/WebPageProxy.cpp:
1275         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1276         (WebKit::WebPageProxy::didCommitLoadForFrame):
1277         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1278         (WebKit::WebPageProxy::createNewPage):
1279         * UIProcess/WebPageProxy.h:
1280         (WebKit::WebPageProxy::setOpenedByDOM):
1281         (WebKit::WebPageProxy::openedByDOM const):
1282         (WebKit::WebPageProxy::hasCommittedAnyProvisionalLoads const):
1283         * UIProcess/WebProcessPool.cpp:
1284         (WebKit::shouldUseSameProcessBasedOnURLs):
1285         (WebKit::WebProcessPool::processForNavigationInternal):
1286         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1287         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1288
1289 2018-09-17  Alexey Proskuryakov  <ap@apple.com>
1290
1291         Revert https://trac.webkit.org/r235910, because the new test times out.
1292         Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
1293         https://bugs.webkit.org/show_bug.cgi?id=188008
1294
1295         * Shared/cf/ArgumentCodersCF.cpp:
1296         (IPC::encode):
1297         (IPC::decode):
1298
1299 2018-09-17  Alex Christensen  <achristensen@webkit.org>
1300
1301         Refactoring related to Safe Browsing
1302         https://bugs.webkit.org/show_bug.cgi?id=189631
1303
1304         Reviewed by Tim Horton.
1305
1306         Make SafeBrowsingResult RefCounted.
1307         Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
1308
1309         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1310         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
1311         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
1312         (WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
1313         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
1314         (WebKit::WebPageProxy::startDrag): Deleted.
1315         (WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
1316         (WebKit::WebPageProxy::setDragCaretRect): Deleted.
1317         (WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
1318         (WebKit::WebPageProxy::platformCloneAttachment): Deleted.
1319         * UIProcess/SafeBrowsingResult.h:
1320         (WebKit::SafeBrowsingResult::create):
1321         * UIProcess/WebFramePolicyListenerProxy.cpp:
1322         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
1323         * UIProcess/WebFramePolicyListenerProxy.h:
1324         * UIProcess/WebFrameProxy.cpp:
1325         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
1326         * UIProcess/WebFrameProxy.h:
1327         * UIProcess/WebPageProxy.cpp:
1328         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1329         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1330         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1331         (WebKit::WebPageProxy::decidePolicyForResponse):
1332         * UIProcess/WebPageProxy.h:
1333
1334 2018-09-17  Darin Adler  <darin@apple.com>
1335
1336         Use OpaqueJSString rather than JSRetainPtr inside WebKit
1337         https://bugs.webkit.org/show_bug.cgi?id=189652
1338
1339         Reviewed by Saam Barati.
1340
1341         * Shared/API/c/WKString.cpp: Removed unneeded include of JSStringRef.h.
1342
1343         * WebProcess/Automation/WebAutomationSessionProxy.cpp: Removed unneeded
1344         include of JSRetainPtr.
1345         (WebKit::toJSString): Deleted.
1346         (WebKit::toJSValue): Use OpaqueJSString::create.
1347         (WebKit::callPropertyFunction): Ditto.
1348         (WebKit::evaluate): Use adoptRef.
1349         (WebKit::evaluateJavaScriptCallback): Ditto.
1350         (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
1351         Use OpaqueJSString::create.
1352         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use
1353         String rather than JSStringRef.
1354
1355         * WebProcess/Plugins/PDF/PDFPlugin.mm: Removed unneeded includes.
1356         (WebKit::PDFPlugin::runScriptsInPDFDocument): Use OpaqueJSString::create.
1357
1358 2018-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1359
1360         Unreviewed, fix incorrect WPE build fix made in r236009
1361
1362         This isn't the right place to add the typedef. I failed to notice that the WebKitWebView
1363         type is not actually used anywhere in this header. Actually, the problematic function is no
1364         longer declared or used anywhere and was just missed when WebKitScriptDialog was refactored,
1365         so remove it.
1366
1367         * UIProcess/API/wpe/WebKitScriptDialog.h:
1368         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
1369         (webkitScriptDialogRun): Deleted.
1370
1371 2018-09-17  Sihui Liu  <sihui_liu@apple.com>
1372
1373         Move IndexedDB to Network Process
1374         https://bugs.webkit.org/show_bug.cgi?id=189415
1375         <rdar://problem/44396973>
1376
1377         Reviewed by Chris Dumez.
1378
1379         We are going to eliminate storage process and move its functionality to network process. 
1380         The reasons why we want to do this:
1381         1. Lower resource usage of having an additional process for storage operations, especially
1382         memory. Single storage process takes about 5MB memory on macOS.
1383         2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
1384         regression in app launch. The launch time of storage process is partly attributed to this:
1385         Service Workers delay page loading until receiving response from storage process.
1386         3. We choose network process because UI process may have broader access in file system
1387         that we don't want the storage operations to have.
1388
1389         This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
1390         to corresponding components of network process. Moving of Service Worker and stopping to 
1391         launch storage process will be done in following patches.
1392
1393         We expect to see the higher cpu and memory usage of network process as it is taking more work,
1394         but the overall gain in memory and latency after we completely remove storage process should be 
1395         positive.
1396
1397         * CMakeLists.txt:
1398         * DerivedSources.make:
1399         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
1400         (WebKit::WebIDBConnectionToClient::create):
1401         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1402         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
1403         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
1404         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
1405         (WebKit::WebIDBConnectionToClient::connectionToClient):
1406         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
1407         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
1408         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
1409         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
1410         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
1411         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
1412         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
1413         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
1414         (WebKit::WebIDBConnectionToClient::didCreateIndex):
1415         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
1416         (WebKit::WebIDBConnectionToClient::didRenameIndex):
1417         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
1418         (WebKit::WebIDBConnectionToClient::handleGetResult):
1419         (WebKit::WebIDBConnectionToClient::didGetRecord):
1420         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
1421         (WebKit::WebIDBConnectionToClient::didGetCount):
1422         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
1423         (WebKit::WebIDBConnectionToClient::didOpenCursor):
1424         (WebKit::WebIDBConnectionToClient::didIterateCursor):
1425         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
1426         (WebKit::WebIDBConnectionToClient::didStartTransaction):
1427         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
1428         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
1429         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
1430         (WebKit::WebIDBConnectionToClient::deleteDatabase):
1431         (WebKit::WebIDBConnectionToClient::openDatabase):
1432         (WebKit::WebIDBConnectionToClient::abortTransaction):
1433         (WebKit::WebIDBConnectionToClient::commitTransaction):
1434         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1435         (WebKit::WebIDBConnectionToClient::createObjectStore):
1436         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
1437         (WebKit::WebIDBConnectionToClient::renameObjectStore):
1438         (WebKit::WebIDBConnectionToClient::clearObjectStore):
1439         (WebKit::WebIDBConnectionToClient::createIndex):
1440         (WebKit::WebIDBConnectionToClient::deleteIndex):
1441         (WebKit::WebIDBConnectionToClient::renameIndex):
1442         (WebKit::WebIDBConnectionToClient::putOrAdd):
1443         (WebKit::WebIDBConnectionToClient::getRecord):
1444         (WebKit::WebIDBConnectionToClient::getAllRecords):
1445         (WebKit::WebIDBConnectionToClient::getCount):
1446         (WebKit::WebIDBConnectionToClient::deleteRecord):
1447         (WebKit::WebIDBConnectionToClient::openCursor):
1448         (WebKit::WebIDBConnectionToClient::iterateCursor):
1449         (WebKit::WebIDBConnectionToClient::establishTransaction):
1450         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1451         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
1452         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
1453         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
1454         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
1455         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
1456         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
1457         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
1458         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
1459         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1460         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1461
1462         Code moved from StorageToWebProcessConnection::didReceiveMessage.
1463
1464         (WebKit::NetworkConnectionToWebProcess::didClose):
1465         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1466
1467         Network process receives and stores sandbox extension of temporary files for later indexedDB
1468         use.
1469
1470         (WebKit::NetworkConnectionToWebProcess::didClose):
1471         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1472         (WebKit::generateIDBConnectionToServerIdentifier):
1473         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
1474         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
1475         * NetworkProcess/NetworkConnectionToWebProcess.h:
1476         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1477         * NetworkProcess/NetworkProcess.cpp:
1478         (WebKit::NetworkProcess::NetworkProcess):
1479         (WebKit::NetworkProcess::initializeNetworkProcess):
1480         (WebKit::NetworkProcess::addWebsiteDataStore):
1481         (WebKit::NetworkProcess::fetchWebsiteData):
1482         (WebKit::NetworkProcess::deleteWebsiteData):
1483         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1484         (WebKit::NetworkProcess::idbServer):
1485         (WebKit::NetworkProcess::ensurePathExists):
1486         (WebKit::NetworkProcess::postStorageTask):
1487         (WebKit::NetworkProcess::performNextStorageTask):
1488         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
1489         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
1490         (WebKit::NetworkProcess::indexedDatabaseOrigins):
1491         (WebKit::NetworkProcess::addIndexedDatabaseSession):
1492         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
1493
1494         Instead of asking UI process to grant sandbox extension to storage process, now network 
1495         process just asks for sandbox extension fot itself.
1496
1497         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
1498         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
1499         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
1500         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
1501         * NetworkProcess/NetworkProcess.h:
1502         * NetworkProcess/NetworkProcess.messages.in:
1503         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1504         (WebKit::NetworkProcessCreationParameters::encode const):
1505         (WebKit::NetworkProcessCreationParameters::decode):
1506         * NetworkProcess/NetworkProcessCreationParameters.h:
1507         * Shared/Storage/StorageProcessCreationParameters.cpp:
1508         (WebKit::StorageProcessCreationParameters::encode const):
1509         (WebKit::StorageProcessCreationParameters::decode):
1510         * Shared/Storage/StorageProcessCreationParameters.h:
1511         * Shared/WebsiteDataStoreParameters.cpp:
1512         (WebKit::WebsiteDataStoreParameters::encode const):
1513         (WebKit::WebsiteDataStoreParameters::decode):
1514         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1515         * Shared/WebsiteDataStoreParameters.h:
1516         * Sources.txt:
1517         * StorageProcess/StorageProcess.cpp:
1518         (WebKit::StorageProcess::initializeWebsiteDataStore):
1519         (WebKit::StorageProcess::fetchWebsiteData):
1520         (WebKit::StorageProcess::deleteWebsiteData):
1521         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1522         (WebKit::StorageProcess::idbServer): Deleted.
1523         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
1524         (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
1525         (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
1526         (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
1527         (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
1528         (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
1529         * StorageProcess/StorageProcess.h:
1530         (WebKit::StorageProcess::queue): Deleted.
1531         * StorageProcess/StorageProcess.messages.in:
1532         * StorageProcess/StorageToWebProcessConnection.cpp:
1533         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
1534         (WebKit::StorageToWebProcessConnection::didClose):
1535         (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
1536         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
1537         (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
1538         * StorageProcess/StorageToWebProcessConnection.h:
1539         * StorageProcess/StorageToWebProcessConnection.messages.in:
1540         * UIProcess/Network/NetworkProcessProxy.cpp:
1541         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
1542         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
1543         * UIProcess/Network/NetworkProcessProxy.h:
1544         * UIProcess/Network/NetworkProcessProxy.messages.in:
1545         * UIProcess/Storage/StorageProcessProxy.cpp:
1546         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
1547         * UIProcess/Storage/StorageProcessProxy.h:
1548         * UIProcess/Storage/StorageProcessProxy.messages.in:
1549         * UIProcess/WebProcessPool.cpp:
1550         (WebKit::WebProcessPool::ensureNetworkProcess):
1551         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1552         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1553         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1554         (WebKit::WebsiteDataStore::parameters):
1555         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1556         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
1557         (WebKit::WebsiteDataStore::fetchDataAndApply):
1558         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
1559         (WebKit::WebsiteDataStore::removeData):
1560         (WebKit::WebsiteDataStore::storageProcessParameters):
1561         (WebKit::WebsiteDataStore::parameters):
1562         * WebKit.xcodeproj/project.pbxproj:
1563         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1564         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
1565         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
1566         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
1567         * WebProcess/Databases/WebDatabaseProvider.cpp:
1568         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
1569         * WebProcess/Network/NetworkProcessConnection.cpp:
1570         (WebKit::NetworkProcessConnection::didReceiveMessage):
1571         (WebKit::NetworkProcessConnection::didClose):
1572         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
1573         * WebProcess/Network/NetworkProcessConnection.h:
1574         (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier const):
1575         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1576         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1577         (WebKit::WebToStorageProcessConnection::didClose):
1578         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
1579         * WebProcess/Storage/WebToStorageProcessConnection.h:
1580         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
1581         * WebProcess/WebProcess.cpp:
1582         (WebKit::WebProcess::networkProcessConnectionClosed):
1583         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
1584
1585 2018-09-08  Darin Adler  <darin@apple.com>
1586
1587         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
1588         https://bugs.webkit.org/show_bug.cgi?id=189455
1589
1590         Reviewed by Keith Miller.
1591
1592         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1593         (WebKit::toJSString): Use adopt function instead of adopt construuctor.
1594         (WebKit::evaluate): Ditto.
1595         (WebKit::evaluateJavaScriptCallback): Ditto.
1596         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Ditto.
1597
1598 2018-09-14  Matt Lewis  <jlewis3@apple.com>
1599
1600         Unreviewed, rolling out r236020.
1601
1602         This caused an api failure on High Sierra
1603
1604         Reverted changeset:
1605
1606         "Refactoring related to Safe Browsing"
1607         https://bugs.webkit.org/show_bug.cgi?id=189631
1608         https://trac.webkit.org/changeset/236020
1609
1610 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1611
1612         [Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
1613         https://bugs.webkit.org/show_bug.cgi?id=189530
1614
1615         Reviewed by Alex Christensen.
1616
1617         Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
1618         Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
1619
1620         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1621         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
1622         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
1623         (WebKit::NetworkDataTaskCurl::restartWithCredential):
1624         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1625
1626 2018-09-14  Alex Christensen  <achristensen@webkit.org>
1627
1628         Refactoring related to Safe Browsing
1629         https://bugs.webkit.org/show_bug.cgi?id=189631
1630
1631         Reviewed by Tim Horton.
1632
1633         Make SafeBrowsingResult RefCounted.
1634         Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
1635
1636         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1637         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
1638         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
1639         (WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
1640         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
1641         (WebKit::WebPageProxy::startDrag): Deleted.
1642         (WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
1643         (WebKit::WebPageProxy::setDragCaretRect): Deleted.
1644         (WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
1645         (WebKit::WebPageProxy::platformCloneAttachment): Deleted.
1646         * UIProcess/SafeBrowsingResult.h:
1647         (WebKit::SafeBrowsingResult::create):
1648         * UIProcess/WebFramePolicyListenerProxy.cpp:
1649         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
1650         * UIProcess/WebFramePolicyListenerProxy.h:
1651         * UIProcess/WebFrameProxy.cpp:
1652         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
1653         * UIProcess/WebFrameProxy.h:
1654         * UIProcess/WebPageProxy.cpp:
1655         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1656         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1657         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1658         (WebKit::WebPageProxy::decidePolicyForResponse):
1659         * UIProcess/WebPageProxy.h:
1660
1661 2018-09-14  Geoffrey Garen  <ggaren@apple.com>
1662
1663         Clarify the configuration used by WKUIDelegate's createWebViewWithConfiguration
1664         https://bugs.webkit.org/show_bug.cgi?id=189634
1665
1666         Reviewed by Tim Horton.
1667
1668         * UIProcess/API/Cocoa/WKUIDelegate.h:
1669
1670 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
1671
1672         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
1673         https://bugs.webkit.org/show_bug.cgi?id=189521
1674
1675         Reviewed by Tim Horton.
1676
1677         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
1678         
1679         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
1680         
1681         Added some helper functions to null out a RefPtr<GraphicsLayer> after removing from the tree,
1682         clearing the client. GraphicsLayer.m_client becomes a pointer, so it can be set to point to a singleton
1683         empty client when a GraphicsLayer gets detached from its owner. More explicit layer unparenting,
1684         and removed some unnecessary parent checks, and redundant unparenting.
1685         
1686         Other changes are just to adapt to the new ownership patterns.
1687         
1688         I verified that no GraphicsLayers were leaked or abandoned after this change.
1689
1690         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1691         (WebKit::WebInspectorClient::~WebInspectorClient):
1692         (WebKit::WebInspectorClient::showPaintRect):
1693         (WebKit::WebInspectorClient::animationEndedForLayer):
1694         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1695         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
1696         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1697         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
1698         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1699         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1700         (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
1701         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1702
1703 2018-09-14  Eric Carlson  <eric.carlson@apple.com>
1704
1705         Support arbitrary video resolution in getUserMedia API
1706         https://bugs.webkit.org/show_bug.cgi?id=178109
1707         <rdar://problem/35083128>
1708
1709         Reviewed by Youenn Fablet.
1710
1711         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1712
1713 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1714
1715         [Curl][WebKit] Bug fix for continuously retrying with empty credentials.
1716         https://bugs.webkit.org/show_bug.cgi?id=189601
1717
1718         Reviewed by Alex Christensen.
1719
1720         Added stop condition for empty credentials passed by client.
1721
1722         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1723         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
1724         (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
1725         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
1726         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
1727         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1728
1729 2018-09-14  Jer Noble  <jer.noble@apple.com>
1730
1731         Turn SourceBufferChangeTypeEnabled on by default
1732         https://bugs.webkit.org/show_bug.cgi?id=189527
1733
1734         Reviewed by Eric Carlson.
1735
1736         * Shared/WebPreferences.yaml:
1737         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1738
1739 2018-09-14  Michael Catanzaro  <mcatanzaro@igalia.com>
1740
1741         Unreviewed, speculative WPE build fix after r236004
1742         https://bugs.webkit.org/show_bug.cgi?id=189545
1743
1744         * UIProcess/API/wpe/WebKitScriptDialog.h:
1745
1746 2018-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1747
1748         [GTK] Make script dialogs modal to the current web view only
1749         https://bugs.webkit.org/show_bug.cgi?id=189545
1750
1751         Reviewed by Michael Catanzaro.
1752
1753         Change the default implementation of script dialogs to use an embedded window, like the HTTP auth dialog,
1754         instead of a GtkMessageDialog. This patch adds a base class WebKitWebViewDialog shared by
1755         WebKitAuthenticationDialog and the new WebKitScriptDialogImpl.
1756
1757         * SourcesGTK.txt: Add new files to compilation.
1758         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
1759         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
1760         (webkitAuthenticationDialogInitialize): Do not use a frame and use a better styled title.
1761         (webkit_authentication_dialog_class_init): Remove implementation of vfuncs that are now implemented by the
1762         parent.
1763         * UIProcess/API/gtk/WebKitAuthenticationDialog.h:
1764         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
1765         (webkitScriptDialogAccept): Use WebKitScriptDialogImpl API.
1766         (webkitScriptDialogDismiss): Ditto.
1767         (webkitScriptDialogSetUserInput): Ditto.
1768         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp: Added.
1769         (webkitScriptDialogImplClose):
1770         (webkitScriptDialogImplKeyPressEvent):
1771         (webkitScriptDialogImplMap):
1772         (webkitScriptDialogImplConstructed):
1773         (webkitScriptDialogImplDispose):
1774         (webkit_script_dialog_impl_class_init):
1775         (webkitScriptDialogImplAddButton):
1776         (webkitScriptDialogImplNew):
1777         (webkitScriptDialogImplCancel):
1778         (webkitScriptDialogImplConfirm):
1779         (webkitScriptDialogImplSetEntryText):
1780         * UIProcess/API/gtk/WebKitScriptDialogImpl.h: Added.
1781         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1782         (webkitWebViewChildIsInternalWidget): Rename authenticationDialog as just dialog.
1783         (webkitWebViewBaseAddDialog): Ditto.
1784         (webkitWebViewBaseContainerRemove): Ditto.
1785         (webkitWebViewBaseContainerForall): Ditto.
1786         (webkitWebViewBaseConstructed): Ditto.
1787         (webkitWebViewBaseSizeAllocate): Ditto.
1788         (webkitWebViewBaseKeyPressEvent): Ditto.
1789         (webkitWebViewBaseHandleMouseEvent): Ditto.
1790         (webkitWebViewBaseButtonPressEvent): Ditto.
1791         (webkitWebViewBaseButtonReleaseEvent): Ditto.
1792         (webkitWebViewBaseHandleWheelEvent): Ditto.
1793         (webkitWebViewBaseScrollEvent): Ditto.
1794         (webkitWebViewBaseMotionNotifyEvent): Ditto.
1795         (webkitWebViewBaseCrossingNotifyEvent): Ditto.
1796         (webkitWebViewBaseTouchEvent): Ditto.
1797         (webkitWebViewBaseFocus): Ditto.
1798         (webkitWebViewBaseDestroy): Ditto.
1799         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1800         * UIProcess/API/gtk/WebKitWebViewDialog.cpp: Added.
1801         (webkitWebViewDialogDraw):
1802         (webkitWebViewDialogSizeAllocate):
1803         (webkitWebViewDialogConstructed):
1804         (webkit_web_view_dialog_class_init):
1805         * UIProcess/API/gtk/WebKitWebViewDialog.h: Added.
1806         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1807         (webkitWebViewAuthenticate):
1808         (webkitWebViewScriptDialog):
1809
1810 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
1811
1812         Unreviewed, rolling out r235954.
1813
1814         Breaks the watchOS build.
1815
1816         Reverted changeset:
1817
1818         "Move IndexedDB to Network Process"
1819         https://bugs.webkit.org/show_bug.cgi?id=189415
1820         https://trac.webkit.org/changeset/235954
1821
1822 2018-09-13  Chris Dumez  <cdumez@apple.com>
1823
1824         Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
1825         https://bugs.webkit.org/show_bug.cgi?id=189590
1826         <rdar://problem/44422725>
1827
1828         Reviewed by Geoffrey Garen.
1829
1830         If script calls window.open() without 'noopener' and the newly navigated window gets navigated cross-site,
1831         we are currently unable to process-swap because the opener has a WindowProxy handle to this new Window and
1832         may interact with it (which we currently do not support cross-process). We were dealing with this by not
1833         process-swapping if window.opener is not null. This works most of the time but is not sufficient because the
1834         opener may get nulled out, while the opener still has a valid WindowProxy handle to its openee.
1835
1836         Therefore, we now also check for a flag indicating if the frame was opened via window.open() without
1837         'nooopener'. We still need to check if the browsing context has an opener for browsing context created
1838         via <a target="_blank"> for example (the opener does not have a handle to the new window but the openee
1839         has access to its opener).
1840
1841         * Shared/NavigationActionData.cpp:
1842         (WebKit::NavigationActionData::encode const):
1843         (WebKit::NavigationActionData::decode):
1844         * Shared/NavigationActionData.h:
1845         * UIProcess/API/APINavigation.h:
1846         (API::Navigation::openedViaWindowOpenWithOpener const):
1847         (API::Navigation::setOpenedViaWindowOpenWithOpener):
1848         * UIProcess/WebPageProxy.cpp:
1849         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1850         * UIProcess/WebProcessPool.cpp:
1851         (WebKit::WebProcessPool::processForNavigationInternal):
1852         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1853         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1854
1855 2018-09-13  Dean Jackson  <dino@grorg.org>
1856
1857         Generate warnings for Preferences files
1858         https://bugs.webkit.org/show_bug.cgi?id=189573
1859
1860         Reviewed by Sam Weinig.
1861
1862         Generate the "DO NOT EDIT" warnings, rather than have
1863         them in the template (which was confusing).
1864
1865         While here, simplify some of the templating generation code
1866         to avoid duplication.
1867
1868         * Scripts/GeneratePreferences.rb:
1869         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
1870         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1871         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1872         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
1873         * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb:
1874         * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb:
1875         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
1876
1877 2018-09-13  Keith Rollin  <krollin@apple.com>
1878
1879         WebPageProxy::reportPageLoadResult can crash on some code paths
1880         https://bugs.webkit.org/show_bug.cgi?id=189568
1881
1882         Reviewed by Chris Dumez.
1883
1884         WebPageProxy::reportPageLoadResult (which is called from
1885         WebPageProxy::didFinishLoadForFrame) can sometimes crash when
1886         accessing m_pageLoadStart (a std::optional) in its unloaded state.
1887         Normally, m_pageLoadStart is initialized in
1888         WebPageProxy::didStartProvisionalLoadForFrame, which one would expect
1889         would be called before WebPageProxy::didFinishLoadForFrame. But that
1890         turns out to not always be the case. It's not apparent under what
1891         conditions didStartProvisionalLoadForFrame will not be called, but
1892         it's happening in the wild, leading to crashes now that std::optional
1893         asserts in release builds on bad accesses (see
1894         https://bugs.webkit.org/show_bug.cgi?id=189568).
1895
1896         Fix this by checking m_pageLoadState on entry to reportPageLoadResult.
1897
1898         * UIProcess/WebPageProxy.cpp:
1899         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1900         (WebKit::WebPageProxy::didFinishLoadForFrame):
1901         (WebKit::WebPageProxy::didFailLoadForFrame):
1902         (WebKit::WebPageProxy::reportPageLoadResult):
1903
1904 2018-09-13  Chris Dumez  <cdumez@apple.com>
1905
1906         ProcessSwap.BackWithoutSuspendedPage API test hits assertion under WebPageProxy::didCreateMainFrame()
1907         https://bugs.webkit.org/show_bug.cgi?id=189599
1908
1909         Reviewed by Geoffrey Garen.
1910
1911         The code in WebPageProxy::reattachToWebProcess() was re-initializing m_mainFrame unconditionally in case
1912         of a HistoryNavigation. The reason we need to initialize m_mainFrame in reattachToWebProcess() is if the
1913         process we're reattaching to already has a WebPage (with a main frame), in which case
1914         WebPageProxy::didCreateMainFrame() would not get called to initialize WebPageProxy::m_mainFrame.
1915
1916         The process we're reattaching to can be in such a state only if it comes from a SuspendedPageProxy (we
1917         detached the WebProcessProxy from the WebPageProxy but kept the WebPage in the "suspended" WebProcess).
1918         It is true that we're only reattaching to a SuspendedPageProxy's process in the event of history
1919         navigations. However, it is not true that all history navigations will use a SuspendedPageProxy's process.
1920         For example, no SuspendedPageProxy may be available for the history navigation because the history
1921         was restored to a new view from disk, or because the WebBackForwardListItem no longer has a
1922         SuspendedPageProxy (we currently only keep a single SuspendedPageProxy for the last HistoryItem).
1923
1924         Therefore, unconditionally initializating m_mainFrame in reattachToWebProcess() for history navigations
1925         is incorrect and we should instead check if we're reattaching to a SuspendedPage's process.
1926
1927         Change is covered by ProcessSwap.BackWithoutSuspendedPage API test which is no longer crashes and
1928         existing Back/Forward PSON API tests which are still passing.
1929
1930         * UIProcess/WebPageProxy.cpp:
1931         (WebKit::WebPageProxy::reattachToWebProcess):
1932         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1933         * UIProcess/WebPageProxy.h:
1934
1935 2018-09-13  Chris Dumez  <cdumez@apple.com>
1936
1937         Add release logging to help debug PSON issues
1938         https://bugs.webkit.org/show_bug.cgi?id=189562
1939
1940         Reviewed by Ryosuke Niwa.
1941
1942         Add release logging to help debug issues related to process swap on navigation.
1943
1944         * UIProcess/WebPageProxy.cpp:
1945         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1946         * UIProcess/WebProcessPool.cpp:
1947         (WebKit::WebProcessPool::processForNavigation):
1948         (WebKit::WebProcessPool::processForNavigationInternal):
1949         * UIProcess/WebProcessPool.h:
1950
1951 2018-09-13  Chris Dumez  <cdumez@apple.com>
1952
1953         Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
1954         https://bugs.webkit.org/show_bug.cgi?id=189587
1955
1956         Reviewed by Geoffrey Garen.
1957
1958         Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
1959         as this is causing crashes on the bots.
1960
1961         * WebProcess/WebPage/WebPage.cpp:
1962         (WebKit::WebPage::didCompletePageTransition):
1963
1964 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
1965
1966         Unreviewed, rolling out r235953.
1967
1968         Caused layout test crashes under GuardMalloc.
1969
1970         Reverted changeset:
1971
1972         "Make GraphicsLayers ref-counted, so their tree can persist
1973         when disconnected from RenderLayerBackings"
1974         https://bugs.webkit.org/show_bug.cgi?id=189521
1975         https://trac.webkit.org/changeset/235953
1976
1977 2018-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1978
1979         [GTK][WPE] Allow to run script dialogs asynchronously in the UI process
1980         https://bugs.webkit.org/show_bug.cgi?id=189544
1981
1982         Reviewed by Michael Catanzaro.
1983
1984         Script dialogs are sync in the WebProcess, but we don't need to block the UI process while they are running. Our
1985         current API doesn't allow it, because it always expects the dialog to be closed in the signal handler. API
1986         changes are backwards compatible.
1987
1988         * UIProcess/API/glib/WebKitScriptDialog.cpp:
1989         (webkitScriptDialogCreate): Added to heap allocate a WebKitScriptDialog.
1990         (webkitScriptDialogIsRunning): Common implementation here, a script dialog is considered to be running if it has
1991         a competion handler pending.
1992         (webkit_script_dialog_ref): WebKitScriptDialog is now refcounted.
1993         (webkit_script_dialog_unref): Ditto.
1994         (webkit_script_dialog_close): New method to notify that we are done with the dialog.
1995         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
1996         (_WebKitScriptDialog::_WebKitScriptDialog): Use a single constructor and keep the completion handler.
1997         * UIProcess/API/glib/WebKitUIClient.cpp: Do not call the completion handler, pass it to the web view.
1998         * UIProcess/API/glib/WebKitWebView.cpp:
1999         (webkitWebViewDispose): Close the current script dialog if there's any.
2000         (webkit_web_view_class_init): Document how to handle dialogs asynchronously.
2001         (webkitWebViewRunJavaScriptAlert): Do not stack allocate the WebKitScriptDialog, create it with
2002         webkitScriptDialogCreate() passing the completion handler.
2003         (webkitWebViewRunJavaScriptConfirm): Ditto.
2004         (webkitWebViewRunJavaScriptPrompt): Ditto.
2005         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
2006         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2007         * UIProcess/API/gtk/WebKitScriptDialog.h:
2008         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
2009         (scriptDialogResponseCallback): Hnadle the response callback.
2010         (webkitScriptDialogRun): Do not use gtk_dialog_run(), connect to response signal and show the dialogs instead.
2011         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2012         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2013         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
2014
2015 2018-09-12  Dan Bernstein  <mitz@apple.com>
2016
2017         Update availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM seed
2018         https://bugs.webkit.org/show_bug.cgi?id=189561
2019
2020         Reviewed by Tim Horton.
2021
2022         Changed WK_MAC_TBA and WK_IOS_TBA to 10.14 and 12.0, respectively, in all declarations that
2023         appear in the GM seed SDKs.
2024
2025         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
2026         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
2027         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2028         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2029         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2030         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2031         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2032         * UIProcess/API/Cocoa/WKViewPrivate.h:
2033         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2034         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2035         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2036         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2037         * UIProcess/API/Cocoa/_WKAttachment.h:
2038         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
2039         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2040         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2041         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2042         * UIProcess/API/Cocoa/_WKInputDelegate.h:
2043         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
2044         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2045         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2046         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2047         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
2048         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
2049         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2050
2051 2018-09-12  Dan Bernstein  <mitz@apple.com>
2052
2053         [Cocoa] Complete support for Paste as Quotation
2054         https://bugs.webkit.org/show_bug.cgi?id=189504
2055
2056         Reviewed by Wenson Hsieh.
2057
2058         * UIProcess/API/Cocoa/WKWebView.mm:
2059         (-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included
2060           in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate
2061           category. If we add more actions in the category, it could make sense to fold them into
2062           a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION.
2063         (-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:.
2064         (-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView.
2065         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action.
2066
2067         * UIProcess/Cocoa/WebViewImpl.mm:
2068         (WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the
2069           PasteAsQuotation command.
2070
2071         * UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action.
2072         * UIProcess/ios/WKContentViewInteraction.mm:
2073           Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its
2074           behavior.
2075         (-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page.
2076
2077 2018-09-12  Sihui Liu  <sihui_liu@apple.com>
2078
2079         Move IndexedDB to Network Process
2080         https://bugs.webkit.org/show_bug.cgi?id=189415
2081
2082         Reviewed by Geoffrey Garen.
2083
2084         We are going to eliminate storage process and move its functionality to network process. 
2085         The reasons why we want to do this:
2086         1. Lower resource usage of having an additional process for storage operations, especially
2087         memory. Single storage process takes about 5MB memory on macOS.
2088         2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
2089         regression in app launch. The launch time of storage process is partly attributed to this:
2090         Service Workers delay page loading until receiving response from storage process.
2091         3. We choose network process because UI process may have broader access in file system
2092         that we don't want the storage operations to have.
2093
2094         This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
2095         to corresponding components of network process. Moving of Service Worker and stopping to 
2096         launch storage process will be done in following patches.
2097
2098         We expect to see the higher cpu and memory usage of network process as it is taking more work,
2099         but the overall gain in memory and latency after we completely remove storage process should be 
2100         positive.
2101
2102
2103         * CMakeLists.txt:
2104         * DerivedSources.make:
2105
2106         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
2107         (WebKit::WebIDBConnectionToClient::create):
2108         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
2109         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
2110         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
2111         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
2112         (WebKit::WebIDBConnectionToClient::connectionToClient):
2113         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
2114         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
2115         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
2116         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
2117         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
2118         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
2119         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
2120         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
2121         (WebKit::WebIDBConnectionToClient::didCreateIndex):
2122         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
2123         (WebKit::WebIDBConnectionToClient::didRenameIndex):
2124         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
2125         (WebKit::WebIDBConnectionToClient::handleGetResult):
2126         (WebKit::WebIDBConnectionToClient::didGetRecord):
2127         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
2128         (WebKit::WebIDBConnectionToClient::didGetCount):
2129         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
2130         (WebKit::WebIDBConnectionToClient::didOpenCursor):
2131         (WebKit::WebIDBConnectionToClient::didIterateCursor):
2132         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
2133         (WebKit::WebIDBConnectionToClient::didStartTransaction):
2134         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
2135         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
2136         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
2137         (WebKit::WebIDBConnectionToClient::deleteDatabase):
2138         (WebKit::WebIDBConnectionToClient::openDatabase):
2139         (WebKit::WebIDBConnectionToClient::abortTransaction):
2140         (WebKit::WebIDBConnectionToClient::commitTransaction):
2141         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
2142         (WebKit::WebIDBConnectionToClient::createObjectStore):
2143         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
2144         (WebKit::WebIDBConnectionToClient::renameObjectStore):
2145         (WebKit::WebIDBConnectionToClient::clearObjectStore):
2146         (WebKit::WebIDBConnectionToClient::createIndex):
2147         (WebKit::WebIDBConnectionToClient::deleteIndex):
2148         (WebKit::WebIDBConnectionToClient::renameIndex):
2149         (WebKit::WebIDBConnectionToClient::putOrAdd):
2150         (WebKit::WebIDBConnectionToClient::getRecord):
2151         (WebKit::WebIDBConnectionToClient::getAllRecords):
2152         (WebKit::WebIDBConnectionToClient::getCount):
2153         (WebKit::WebIDBConnectionToClient::deleteRecord):
2154         (WebKit::WebIDBConnectionToClient::openCursor):
2155         (WebKit::WebIDBConnectionToClient::iterateCursor):
2156         (WebKit::WebIDBConnectionToClient::establishTransaction):
2157         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
2158         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
2159         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
2160         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
2161         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
2162         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
2163         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
2164         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
2165         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
2166         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2167         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
2168
2169         Code moved from StorageToWebProcessConnection::didReceiveMessage.
2170
2171         (WebKit::NetworkConnectionToWebProcess::didClose):
2172         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2173
2174         Network process receives and stores sandbox extension of temporary files for later indexedDB
2175         use.
2176
2177         (WebKit::generateIDBConnectionToServerIdentifier):
2178         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
2179         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
2180         * NetworkProcess/NetworkConnectionToWebProcess.h:
2181         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2182         * NetworkProcess/NetworkProcess.cpp:
2183         (WebKit::NetworkProcess::NetworkProcess):
2184         (WebKit::NetworkProcess::initializeNetworkProcess):
2185         (WebKit::NetworkProcess::addWebsiteDataStore):
2186         (WebKit::NetworkProcess::fetchWebsiteData):
2187         (WebKit::NetworkProcess::deleteWebsiteData):
2188         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2189         (WebKit::NetworkProcess::idbServer):
2190         (WebKit::NetworkProcess::ensurePathExists):
2191         (WebKit::NetworkProcess::postStorageTask):
2192         (WebKit::NetworkProcess::performNextStorageTask):
2193         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
2194         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
2195         (WebKit::NetworkProcess::indexedDatabaseOrigins):
2196         (WebKit::NetworkProcess::addIndexedDatabaseSession):
2197         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
2198
2199         Instead of asking UI process to grant sandbox extension to storage process, now network 
2200         process just asks for sandbox extension fot itself.
2201
2202         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
2203         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
2204         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
2205         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
2206         * NetworkProcess/NetworkProcess.h:
2207         (WebKit::NetworkProcess::queue):
2208         * NetworkProcess/NetworkProcess.messages.in:
2209         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2210         (WebKit::NetworkProcessCreationParameters::encode const):
2211         (WebKit::NetworkProcessCreationParameters::decode):
2212         * NetworkProcess/NetworkProcessCreationParameters.h:
2213         * Shared/Storage/StorageProcessCreationParameters.cpp:
2214         (WebKit::StorageProcessCreationParameters::encode const):
2215         (WebKit::StorageProcessCreationParameters::decode):
2216         * Shared/Storage/StorageProcessCreationParameters.h:
2217         * Shared/WebsiteDataStoreParameters.cpp:
2218         (WebKit::WebsiteDataStoreParameters::encode const):
2219         (WebKit::WebsiteDataStoreParameters::decode):
2220         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
2221         * Shared/WebsiteDataStoreParameters.h:
2222         * Sources.txt:
2223         * StorageProcess/StorageProcess.cpp:
2224         (WebKit::StorageProcess::initializeWebsiteDataStore):
2225         (WebKit::StorageProcess::fetchWebsiteData):
2226         (WebKit::StorageProcess::deleteWebsiteData):
2227         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2228         (WebKit::StorageProcess::idbServer): Deleted.
2229         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
2230         (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
2231         (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
2232         (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
2233         (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
2234         (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
2235         * StorageProcess/StorageProcess.h:
2236         (WebKit::StorageProcess::queue): Deleted.
2237         * StorageProcess/StorageProcess.messages.in:
2238         * StorageProcess/StorageToWebProcessConnection.cpp:
2239         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2240         (WebKit::StorageToWebProcessConnection::didClose):
2241         (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
2242         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
2243         (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
2244         * StorageProcess/StorageToWebProcessConnection.h:
2245         * StorageProcess/StorageToWebProcessConnection.messages.in:
2246         * UIProcess/Network/NetworkProcessProxy.cpp:
2247         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
2248         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
2249         * UIProcess/Network/NetworkProcessProxy.h:
2250         * UIProcess/Network/NetworkProcessProxy.messages.in:
2251         * UIProcess/Storage/StorageProcessProxy.cpp:
2252         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
2253         * UIProcess/Storage/StorageProcessProxy.h:
2254         * UIProcess/Storage/StorageProcessProxy.messages.in:
2255         * UIProcess/WebProcessPool.cpp:
2256         (WebKit::WebProcessPool::ensureNetworkProcess):
2257         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2258         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2259         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2260         (WebKit::WebsiteDataStore::parameters):
2261         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2262         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
2263         (WebKit::WebsiteDataStore::fetchDataAndApply):
2264         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
2265         (WebKit::WebsiteDataStore::removeData):
2266         (WebKit::WebsiteDataStore::storageProcessParameters):
2267         (WebKit::WebsiteDataStore::parameters):
2268         * WebKit.xcodeproj/project.pbxproj:
2269         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2270         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
2271         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
2272         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
2273         * WebProcess/Databases/WebDatabaseProvider.cpp:
2274         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
2275         * WebProcess/Network/NetworkProcessConnection.cpp:
2276         (WebKit::NetworkProcessConnection::didReceiveMessage):
2277         (WebKit::NetworkProcessConnection::didClose):
2278         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
2279         * WebProcess/Network/NetworkProcessConnection.h:
2280         (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier):
2281         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2282         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
2283
2284         Code moved from WebToStorageProcessConnection::didReceiveMessage.
2285
2286         (WebKit::WebToStorageProcessConnection::didClose):
2287         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
2288         * WebProcess/Storage/WebToStorageProcessConnection.h:
2289         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
2290         * WebProcess/WebProcess.cpp:
2291         (WebKit::WebProcess::networkProcessConnectionClosed):
2292         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
2293
2294 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
2295
2296         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
2297         https://bugs.webkit.org/show_bug.cgi?id=189521
2298
2299         Reviewed by Tim Horton.
2300
2301         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
2302         
2303         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
2304         
2305         All the other changes are just to adapt to the new ownership patterns.
2306         
2307         I verified that no GraphicsLayers were leaked or abandoned after this change.
2308
2309         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2310         (WebKit::WebInspectorClient::~WebInspectorClient):
2311         (WebKit::WebInspectorClient::showPaintRect):
2312         (WebKit::WebInspectorClient::animationEndedForLayer):
2313         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2314         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
2315         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
2316         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
2317         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
2318         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2319         (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
2320         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2321
2322 2018-09-12  Chris Dumez  <cdumez@apple.com>
2323
2324         PSON: No process swap on back navigation after URL bar navigation
2325         https://bugs.webkit.org/show_bug.cgi?id=189557
2326         <rdar://problem/44353108>
2327
2328         Reviewed by Alex Christensen.
2329
2330         Our logic in WebProcessPool::processForNavigationInternal() was wrongly using
2331         WebBackForwardList::currentItem() as source item of the navigation, instead of
2332         using Navigation::fromItem(). In case of back navigation, by the time
2333         processForNavigation() is called, the WebBackForwardList's currentItem has already
2334         been updated to be the target item, via a Sync IPC from the WebProcess. As a result,
2335         the source and target items would be the same in the following check:
2336         ` if (currentItem->itemID().processIdentifier == backForwardListItem->itemID().processIdentifier)`
2337
2338         This would cause us to reuse the same process incorrectly. Our existing API test coverage
2339         did not catch this because our target HistoryItem usually has a SuspendedPage and we decide
2340         to use the SuspendedPage's process a few lines above in WebProcessPool::processForNavigationInternal().
2341
2342         * UIProcess/WebProcessPool.cpp:
2343         (WebKit::WebProcessPool::processForNavigationInternal):
2344
2345 2018-09-12  Alex Christensen  <achristensen@webkit.org>
2346
2347         Make IPC::SharedBufferDataReference a type that decodes into but does not inherit from IPC::DataReference
2348         https://bugs.webkit.org/show_bug.cgi?id=189519
2349
2350         Reviewed by Chris Dumez.
2351
2352         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2353         * NetworkProcess/NetworkResourceLoader.cpp:
2354         (WebKit::NetworkResourceLoader::bufferingTimerFired):
2355         (WebKit::NetworkResourceLoader::sendBuffer):
2356         * Platform/IPC/DataReference.cpp:
2357         (IPC::SharedBufferDataReference::encode const): Deleted.
2358         * Platform/IPC/DataReference.h:
2359         (IPC::SharedBufferDataReference::SharedBufferDataReference): Deleted.
2360         * Platform/IPC/HandleMessage.h:
2361         * Platform/IPC/SharedBufferDataReference.h: Added.
2362         (IPC::SharedBufferDataReference::SharedBufferDataReference):
2363         (IPC::SharedBufferDataReference::encode const):
2364         * Scripts/webkit/messages.py:
2365         * Shared/API/APIData.h:
2366         * StorageProcess/StorageProcess.messages.in:
2367         * UIProcess/WebPageProxy.messages.in:
2368         * UIProcess/WebURLSchemeTask.cpp:
2369         (WebKit::WebURLSchemeTask::didReceiveData):
2370         * WebKit.xcodeproj/project.pbxproj:
2371         * WebProcess/Network/WebLoaderStrategy.cpp:
2372         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
2373         * WebProcess/Network/WebResourceLoader.messages.in:
2374         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
2375         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
2376         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
2377         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2378         (WebKit::WebEditorClient::registerAttachmentIdentifier):
2379         * WebProcess/WebPage/WebPage.cpp:
2380         (WebKit::WebPage::getContentsAsMHTMLData):
2381         (WebKit::WebPage::getSelectionAsWebArchiveData):
2382         (WebKit::WebPage::getMainResourceDataOfFrame):
2383         (WebKit::WebPage::getResourceDataFromFrame):
2384         (WebKit::WebPage::getWebArchiveOfFrame):
2385         (WebKit::WebPage::drawPagesToPDF):
2386         * WebProcess/WebPage/WebPage.messages.in:
2387
2388 2018-09-11  Dean Jackson  <dino@apple.com>
2389
2390         Header parsing for experimental and internal debug features
2391         https://bugs.webkit.org/show_bug.cgi?id=189486
2392         <rdar://problem/44320618>
2393
2394         Reviewed by Tim Horton.
2395
2396         Provide key-based (string) access to experimental and internal features.
2397
2398         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
2399         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
2400         * UIProcess/API/C/WKPreferences.cpp:
2401         (WKPreferencesSetExperimentalFeatureForKey):
2402         (WKPreferencesResetAllInternalDebugFeatures):
2403         (WKPreferencesSetInternalDebugFeatureForKey):
2404         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2405         * UIProcess/WebPreferences.h:
2406
2407 2018-09-10  Matt Rajca  <mrajca@apple.com>
2408
2409         Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
2410         https://bugs.webkit.org/show_bug.cgi?id=189478
2411         <rdar://problem/44312650>
2412
2413         Reviewed by Eric Carlson.
2414
2415         This patch exposes APIs necessary to toggle PIP and query its status from clients of WKWebView.
2416         The existing PIP test has been updated to use the new APIs instead of simulating mouse clicks.
2417         I also increased the size of the video element in the test page so it gets picked up by the
2418         main content heuristics.
2419
2420         * UIProcess/API/Cocoa/WKWebView.mm:
2421         (-[WKWebView _updateMediaPlaybackControlsManager]): Create a media playback controls manager if necessary.
2422         (-[WKWebView _isPictureInPictureActive]): Return true if the "active" media element is in PIP.
2423         (-[WKWebView _togglePictureInPicture]): Toggle PIP on the "active" media element.
2424         (-[WKWebView _canTogglePictureInPicture]): Renamed from...
2425         (-[WKWebView _canTogglePictureInPictureForTesting]):
2426         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2427         * UIProcess/Cocoa/WebViewImpl.h:
2428         * UIProcess/Cocoa/WebViewImpl.mm:
2429         (WebKit::WebViewImpl::isPictureInPictureActive): Return true if the "active" media element is in PIP.
2430         (WebKit::WebViewImpl::togglePictureInPicture): Toggle PIP on the "active" media element.
2431         (WebKit::WebViewImpl::updateMediaPlaybackControlsManager): Let clients create a playback
2432          controls manager even when there is no Touch Bar present.
2433         (WebKit::WebViewImpl::updateMediaTouchBar): Extract some code into a helper method.
2434         (WebKit::WebViewImpl::canTogglePictureInPicture): Renamed from...
2435         (WebKit::WebViewImpl::canTogglePictureInPictureForTesting):
2436
2437 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
2438
2439         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
2440         https://bugs.webkit.org/show_bug.cgi?id=189542
2441
2442         Reviewed by Alex Christensen.
2443
2444         * UIProcess/win/WebInspectorProxyWin.cpp:
2445         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Narrowed initialWindowWidth and initialWindowHeight by using static_cast.
2446
2447 2018-09-12  Chris Dumez  <cdumez@apple.com>
2448
2449         Clean up SuspendedPageProxy
2450         https://bugs.webkit.org/show_bug.cgi?id=189517
2451
2452         Reviewed by Alex Christensen.
2453
2454         Clean up SuspendedPageProxy:
2455         1. SuspendedPageProxy does not need to be RefCounted. It is even dangerous given that WebPageProxy
2456            owns the SuspendedPageProxy and SuspendedPageProxy has a WebPageProxy& data member. We definitely
2457            do not want it to outlive its WebPageProxy.
2458         2. The SuspendedPageProxy destructor does not need to be virtual.
2459         3. Have WebBackForwardListItem keep a WeakPtr<SuspendedPageProxy> instead of a SuspendedPageProxy*.
2460            This is safer and avoid having to explicitly clear the pointer.
2461         4. m_finishedSuspending data member does not need a getter and is only needed if !LOG_DISABLED.
2462
2463         * Shared/WebBackForwardListItem.cpp:
2464         (WebKit::WebBackForwardListItem::setSuspendedPage):
2465         * Shared/WebBackForwardListItem.h:
2466         (WebKit::WebBackForwardListItem::suspendedPage const):
2467         * UIProcess/SuspendedPageProxy.cpp:
2468         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2469         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2470         (WebKit::SuspendedPageProxy::webProcessDidClose):
2471         (WebKit::SuspendedPageProxy::didFinishLoad):
2472         * UIProcess/SuspendedPageProxy.h:
2473         (WebKit::SuspendedPageProxy::process const):
2474         * UIProcess/WebPageProxy.cpp:
2475         (WebKit::WebPageProxy::maybeCreateSuspendedPage):
2476         (WebKit::WebPageProxy::reattachToWebProcess):
2477         * UIProcess/WebPageProxy.h:
2478
2479 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
2480
2481         Add IGNORE_WARNING_.* macros
2482         https://bugs.webkit.org/show_bug.cgi?id=188996
2483
2484         Reviewed by Michael Catanzaro.
2485
2486         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2487         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
2488         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2489         (WebKit::NetworkProcess::platformSyncAllCookies):
2490         * PluginProcess/mac/PluginProcessMac.mm:
2491         (WebKit::beginModal):
2492         * PluginProcess/mac/PluginProcessShim.mm:
2493         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2494         (WebKit::NetscapePluginModule::tryLoad):
2495         * Shared/ios/ChildProcessIOS.mm:
2496         (WebKit::ChildProcess::initializeSandbox):
2497         * Shared/mac/ChildProcessMac.mm:
2498         (WebKit::compileAndApplySandboxSlowCase):
2499         * Shared/mac/ColorSpaceData.mm:
2500         (WebKit::ColorSpaceData::decode):
2501         * Shared/mac/SandboxExtensionMac.mm:
2502         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
2503         * UIProcess/API/Cocoa/WKWebView.mm:
2504         (-[WKWebView _web_superAccessibilityAttributeValue:]):
2505         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2506         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2507         * UIProcess/API/glib/WebKitWebView.cpp:
2508         (webkitWebViewRunAsModal):
2509         * UIProcess/API/mac/WKView.mm:
2510         (-[WKView _web_superAccessibilityAttributeValue:]):
2511         * UIProcess/Cocoa/DownloadClient.mm:
2512         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
2513         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
2514         (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
2515         * UIProcess/Cocoa/NavigationState.mm:
2516         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2517         * UIProcess/Cocoa/UIDelegate.mm:
2518         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
2519         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2520         (WebKit::WebProcessPool::platformInitializeWebProcess):
2521         * UIProcess/Cocoa/WebViewImpl.mm:
2522         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
2523         (WebKit::WebViewImpl::updateWindowAndViewFrames):
2524         (WebKit::WebViewImpl::sendDragEndToPage):
2525         (WebKit::WebViewImpl::startDrag):
2526         (WebKit::WebViewImpl::characterIndexForPoint):
2527         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2528         (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
2529         (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
2530         (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
2531         (WebKit::PluginProcessProxy::exitFullscreen):
2532         * UIProcess/ios/SmartMagnificationController.mm:
2533         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2534         * UIProcess/ios/WKLegacyPDFView.mm:
2535         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
2536         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
2537         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2538         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2539         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
2540         * UIProcess/ios/forms/WKFormColorControl.mm:
2541         (-[WKColorPopover initWithView:]):
2542         * UIProcess/ios/forms/WKFormInputControl.mm:
2543         (-[WKDateTimePopover initWithView:datePickerMode:]):
2544         * UIProcess/ios/forms/WKFormPopover.h:
2545         * UIProcess/ios/forms/WKFormPopover.mm:
2546         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2547         (-[WKSelectPopover initWithView:hasGroups:]):
2548         * UIProcess/mac/PageClientImplMac.mm:
2549         (WebKit::PageClientImpl::screenToRootView):
2550         (WebKit::PageClientImpl::rootViewToScreen):
2551         * UIProcess/mac/WKFullScreenWindowController.mm:
2552         (-[WKFullScreenWindowController enterFullScreen:]):
2553         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2554         (-[WKFullScreenWindowController exitFullScreen]):
2555         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2556         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2557         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
2558         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2559         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2560         * UIProcess/mac/WKPrintingView.mm:
2561         (-[WKPrintingView _setAutodisplay:]):
2562         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
2563         (-[WKPrintingView _drawPreview:]):
2564         (-[WKPrintingView drawRect:]):
2565         * UIProcess/mac/WKTextInputWindowController.mm:
2566         (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
2567         (-[WKTextInputPanel _hasMarkedText]):
2568         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2569         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2570         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2571         (WebKit::initializeEventRecord):
2572         (WebKit::NetscapePlugin::sendComplexTextInput):
2573         (WebKit::makeCGLPresentLayerOpaque):
2574         (WebKit::NetscapePlugin::nullEventTimerFired):
2575         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2576         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
2577         (-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]):
2578         (WebKit::PDFPlugin::handleEditingCommand):
2579         (WebKit::PDFPlugin::setActiveAnnotation):
2580         (WebKit:: const):
2581         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
2582         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
2583         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
2584         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
2585         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
2586         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
2587         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
2588         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2589         (WebKit::convertImageToBitmap):
2590         (WebKit::WebDragClient::declareAndWriteDragImage):
2591         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2592         * WebProcess/WebPage/mac/WebPageMac.mm:
2593         (WebKit::drawPDFPage):
2594
2595 2018-09-11  Olivia Barnett  <obarnett@apple.com>
2596
2597         Implement the Web Share API for mac
2598         https://bugs.webkit.org/show_bug.cgi?id=189443
2599
2600         Reviewed by Tim Horton.
2601
2602         * Shared/WebPreferencesDefaultValues.h:
2603         * UIProcess/API/Cocoa/WKWebView.mm:
2604         (-[WKWebView shareSheetDidDismiss:]):
2605         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2606         * UIProcess/API/mac/WKView.mm:
2607         (-[WKView shareSheetDidDismiss:]):
2608         * UIProcess/Cocoa/WebViewImpl.h:
2609         * UIProcess/Cocoa/WebViewImpl.mm:
2610         (WebKit::WebViewImpl::showShareSheet):
2611         (WebKit::WebViewImpl::shareSheetDidDismiss):
2612         Implemented function for WKShareSheetDelegate.
2613
2614         * UIProcess/Cocoa/WKShareSheet.h:
2615         * UIProcess/Cocoa/WKShareSheet.mm:
2616         (-[WKShareSheet initWithView:initWithView:]):
2617         (-[WKShareSheet presentWithParameters:completionHandler:]):
2618         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
2619         (-[WKShareSheet _cancel]):
2620         (-[WKShareSheet dismiss]):
2621         (-[WKShareSheet _dismissDisplayAnimated:]):
2622         (-[WKShareSheet invokeShareSheetWithResolution:]):
2623         (-[WKShareSheet initWithView:]): Deleted.
2624         Added mac platform checks and share sheet functionality.
2625
2626         * UIProcess/mac/PageClientImplMac.h:
2627         * UIProcess/mac/PageClientImplMac.mm:
2628         (WebKit::PageClientImpl::showShareSheet):
2629         Allows macos to invoke the system share sheet.
2630
2631 2018-09-07  Dean Jackson  <dino@apple.com>
2632
2633         Add and expose Internal features from WebKit
2634         https://bugs.webkit.org/show_bug.cgi?id=189442
2635         <rdar://problem/44243404>
2636
2637         Reviewed by Simon Fraser.
2638
2639         Experimental features have become a mess. People are using them for
2640         anything that they want to be easily toggled from a host app (e.g.
2641         Safari), which means the user-facing menu has become large and
2642         confusing.
2643
2644         Introduce the idea of Internal features, that will be exposed in a way
2645         that end-users are not expected to ever see (unless they really want
2646         to).
2647
2648         * CMakeLists.txt: Add new files.
2649         * Sources.txt:
2650         * SourcesCocoa.txt:
2651         * WebKit.xcodeproj/project.pbxproj:
2652
2653         * DerivedSources.make: Add new generated files.
2654         * Scripts/GeneratePreferences.rb: Generate the preferences stuff for Internal Debug features.
2655         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
2656         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: Added.
2657
2658         * Shared/API/APIObject.h: New API object for InternalDebugFeature.
2659         * Shared/Cocoa/APIObject.mm:
2660         (API::Object::newObject):
2661
2662         * Shared/WebPreferences.yaml: Change some of the existing experimental features to "internal".
2663
2664         * UIProcess/API/APIInternalDebugFeature.cpp: New API type - just like APIExperimentalFeature.
2665         (API::InternalDebugFeature::create):
2666         (API::InternalDebugFeature::InternalDebugFeature):
2667         (API::InternalDebugFeature::~InternalDebugFeature):
2668         * UIProcess/API/APIInternalDebugFeature.h:
2669         * UIProcess/API/C/WKAPICast.h:
2670
2671         * UIProcess/API/Cocoa/WKPreferences.mm: Change the naming of the experimental feature API so that it
2672         won't clash with internal debug features. We can remove the old API once Safari has adopted.
2673         (+[WKPreferences _internalDebugFeatures]):
2674         (-[WKPreferences _isEnabledForInternalDebugFeature:]):
2675         (-[WKPreferences _setEnabled:forInternalDebugFeature:]):
2676         (-[WKPreferences _isEnabledForFeature:]):
2677         (-[WKPreferences _setEnabled:forFeature:]):
2678         (-[WKPreferences _isEnabledForExperimentalFeature:]):
2679         (-[WKPreferences _setEnabled:forExperimentalFeature:]):
2680         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2681
2682         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h: New object - same as _WKExperimentalFeature.
2683         * UIProcess/API/Cocoa/_WKInternalDebugFeature.mm:
2684         (-[_WKInternalDebugFeature dealloc]):
2685         (-[_WKInternalDebugFeature description]):
2686         (-[_WKInternalDebugFeature name]):
2687         (-[_WKInternalDebugFeature key]):
2688         (-[_WKInternalDebugFeature details]):
2689         (-[_WKInternalDebugFeature defaultValue]):
2690         (-[_WKInternalDebugFeature isHidden]):
2691         (-[_WKInternalDebugFeature _apiObject]):
2692         * UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h:
2693
2694         * UIProcess/WebPreferences.cpp: Add support for Internal Debug features.
2695         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
2696         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
2697         * UIProcess/WebPreferences.h:
2698
2699         * UIProcess/WebProcessPool.cpp: Change a comment now that it is an internal feature.
2700         (WebKit::WebProcessPool::createWebPage):
2701
2702 2018-09-11  Eric Carlson  <eric.carlson@apple.com>
2703
2704         WebPage::close should clear UserMediaPermissionRequestManager
2705         https://bugs.webkit.org/show_bug.cgi?id=189369
2706         <rdar://problem/44196724>
2707
2708         Reviewed by Youenn Fablet.
2709
2710         * WebProcess/WebPage/WebPage.cpp:
2711         (WebKit::WebPage::close): Clear m_userMediaPermissionRequestManager.
2712
2713 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2714
2715         [macOS] [WK2] Support changing foreground colors via color panel
2716         https://bugs.webkit.org/show_bug.cgi?id=189382
2717         <rdar://problem/44227311>
2718
2719         Reviewed by Ryosuke Niwa.
2720
2721         Adds support for changing font color in a richly editable element in WebKit2 via NSColorPanel. See below for
2722         more detail, as well as the WebCore ChangeLog.
2723
2724         * UIProcess/API/Cocoa/WKWebView.mm:
2725         (-[WKWebView changeColor:]):
2726
2727         Implement this selector; AppKit calls into this when changing font color using NSColorPanel.
2728
2729         * UIProcess/Cocoa/WebViewImpl.h:
2730         * UIProcess/Cocoa/WebViewImpl.mm:
2731         (WebKit::WebViewImpl::changeFontColorFromSender):
2732
2733         Creates and populates new FontAttributeChanges, with only the foreground color determined by asking the sender
2734         object for its -color.
2735
2736         * WebProcess/WebPage/mac/WebPageMac.mm:
2737
2738         Use the relevant EditAction for the incoming FontAttributeChanges, instead of always specifying
2739         EditAction::ChangeAttributes.
2740
2741         (WebKit::WebPage::changeFontAttributes):
2742
2743 2018-09-11  Myles C. Maxfield  <mmaxfield@apple.com>
2744
2745         Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
2746         https://bugs.webkit.org/show_bug.cgi?id=188008
2747
2748         Reviewed by Alex Christensen.
2749
2750         This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307.
2751         Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code.
2752
2753         * Shared/cf/ArgumentCodersCF.cpp:
2754         (IPC::encode):
2755         (IPC::decode):
2756
2757 2018-09-11  Adrian Perez de Castro  <aperez@igalia.com>
2758
2759         [WPE][GTK] API documentation is unclear about how to modify requests before sending them
2760         https://bugs.webkit.org/show_bug.cgi?id=189505
2761
2762         Reviewed by Michael Catanzaro.
2763
2764         Add notes to the API documentation to make explicit where modification
2765         of WebKitURIRequest instances affects the request data sent over the
2766         network.
2767
2768         * UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that
2769         modifications to the associated WebKitURIRequest do not affect the
2770         actual request. Point to WebKitPage::send-request instead.
2771         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto.
2772         * UIProcess/API/glib/WebKitWebView.cpp:
2773         (webkit_web_view_class_init): Ditto for the description of the
2774         WebKitWebView::decide-policy signal. Also fix the syntax of example.
2775         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2776         (webkit_web_page_class_init): Indicate that modifications to the
2777         WebKitURIRequest will change the actual network request data.
2778
2779 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2780
2781         Unreviewed, attempt to fix Apple builds after r235903
2782         https://bugs.webkit.org/show_bug.cgi?id=188872
2783
2784         If it really needs to be inlined, it will need to move to the header....
2785
2786         * UIProcess/WebPageProxy.cpp:
2787         (WebKit::WebPageProxy::pageClient const):
2788
2789 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2790
2791         Unreviewed, fix build after r235903
2792         https://bugs.webkit.org/show_bug.cgi?id=188872
2793
2794         This broke all ports except GTK. Need to add a missing header.
2795
2796         * UIProcess/PageClient.h:
2797
2798 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
2799
2800         Add missing #if ENABLE(VIDEO) WebProcess/FullScreen/WebFullScreenManager.cpp
2801         https://bugs.webkit.org/show_bug.cgi?id=189506
2802
2803         Reviewed by Tim Horton.
2804
2805         m_pipStandbyElement is only defined in
2806         WebKit/WebProcess/FullScreen/WebFullScreenManager.h
2807         only when ENABLE(VIDEO) (see
2808         https://bugs.webkit.org/show_bug.cgi?id=181338)
2809
2810         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2811         (WebKit::WebFullScreenManager::setPIPStandbyElement):
2812
2813 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2814
2815         WebPageProxy should hold a WeakPtr to its PageClient
2816         https://bugs.webkit.org/show_bug.cgi?id=188872
2817
2818         Reviewed by Ryosuke Niwa.
2819
2820         This ensures the PageClient reference is always valid when used.
2821
2822         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2823         (WebKit::WebPageProxy::startDrag):
2824         (WebKit::WebPageProxy::setDragCaretRect):
2825         * UIProcess/PageClient.h:
2826         * UIProcess/WebPageProxy.cpp:
2827         (WebKit::PageClientProtector::PageClientProtector):
2828         (WebKit::PageClientProtector::~PageClientProtector):
2829         (WebKit::WebPageProxy::WebPageProxy):
2830         (WebKit::m_resetRecentCrashCountTimer):
2831         (WebKit::WebPageProxy::pageClient const):
2832         (WebKit::WebPageProxy::reattachToWebProcess):
2833         (WebKit::WebPageProxy::initializeWebPage):
2834         (WebKit::WebPageProxy::close):
2835         (WebKit::WebPageProxy::didChangeBackForwardList):
2836         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2837         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
2838         (WebKit::WebPageProxy::setViewNeedsDisplay):
2839         (WebKit::WebPageProxy::requestScroll):
2840         (WebKit::WebPageProxy::viewScrollPosition const):
2841         (WebKit::WebPageProxy::updateActivityState):
2842         (WebKit::WebPageProxy::activityStateDidChange):
2843         (WebKit::WebPageProxy::viewDidEnterWindow):
2844         (WebKit::WebPageProxy::dispatchActivityStateChange):
2845         (WebKit::WebPageProxy::layerHostingModeDidChange):
2846         (WebKit::WebPageProxy::viewSize const):
2847         (WebKit::WebPageProxy::startDrag):
2848         (WebKit::WebPageProxy::didPerformDragOperation):
2849         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
2850         (WebKit::WebPageProxy::findPlugin):
2851         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2852         (WebKit::WebPageProxy::handleTouchEvent):
2853         (WebKit::WebPageProxy::preferencesDidChange):
2854         (WebKit::WebPageProxy::didCreateMainFrame):
2855         (WebKit::WebPageProxy::didCreateSubframe):
2856         (WebKit::WebPageProxy::didStartProgress):
2857         (WebKit::WebPageProxy::didChangeProgress):
2858         (WebKit::WebPageProxy::didFinishProgress):
2859         (WebKit::WebPageProxy::didDestroyNavigation):
2860         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2861         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2862         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2863         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2864         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2865         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2866         (WebKit::WebPageProxy::didCommitLoadForFrame):
2867         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2868         (WebKit::WebPageProxy::didFinishLoadForFrame):
2869         (WebKit::WebPageProxy::didFailLoadForFrame):
2870         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2871         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2872         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2873         (WebKit::WebPageProxy::didReachLayoutMilestone):
2874         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2875         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2876         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2877         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2878         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2879         (WebKit::WebPageProxy::decidePolicyForResponse):
2880         (WebKit::WebPageProxy::unableToImplementPolicy):
2881         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2882         (WebKit::WebPageProxy::didPerformClientRedirect):
2883         (WebKit::WebPageProxy::didPerformServerRedirect):
2884         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2885         (WebKit::WebPageProxy::closePage):
2886         (WebKit::WebPageProxy::setWindowFrame):
2887         (WebKit::WebPageProxy::getWindowFrame):
2888         (WebKit::WebPageProxy::getWindowFrameWithCallback):
2889         (WebKit::WebPageProxy::screenToRootView):
2890         (WebKit::WebPageProxy::rootViewToScreen):
2891         (WebKit::WebPageProxy::syncRootViewToScreen):
2892         (WebKit::WebPageProxy::accessibilityScreenToRootView):
2893         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
2894         (WebKit::WebPageProxy::didChangeViewportProperties):
2895         (WebKit::WebPageProxy::runOpenPanel):
2896         (WebKit::WebPageProxy::showShareSheet):
2897         (WebKit::WebPageProxy::handleDownloadRequest):
2898         (WebKit::WebPageProxy::didChangeContentSize):
2899         (WebKit::WebPageProxy::showColorPicker):
2900         (WebKit::WebPageProxy::showDataListSuggestions):
2901         (WebKit::WebPageProxy::compositionWasCanceled):
2902         (WebKit::WebPageProxy::registerInsertionUndoGrouping):
2903         (WebKit::WebPageProxy::canUndoRedo):
2904         (WebKit::WebPageProxy::executeUndoRedo):
2905         (WebKit::WebPageProxy::clearAllEditCommands):
2906         (WebKit::WebPageProxy::setTextIndicator):
2907         (WebKit::WebPageProxy::clearTextIndicator):
2908         (WebKit::WebPageProxy::setTextIndicatorAnimationProgress):
2909         (WebKit::WebPageProxy::showPopupMenu):
2910         (WebKit::WebPageProxy::showContextMenu):
2911         (WebKit::WebPageProxy::registerEditCommand):
2912         (WebKit::WebPageProxy::canUndo):
2913         (WebKit::WebPageProxy::canRedo):
2914         (WebKit::WebPageProxy::setToolTip):
2915         (WebKit::WebPageProxy::setCursor):
2916         (WebKit::WebPageProxy::setCursorHiddenUntilMouseMoves):
2917         (WebKit::WebPageProxy::didReceiveEvent):
2918         (WebKit::WebPageProxy::resetState):
2919         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2920         (WebKit::WebPageProxy::creationParameters):
2921         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2922         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
2923         (WebKit::WebPageProxy::updateAcceleratedCompositingMode):
2924         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2925         (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
2926         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
2927         (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
2928         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
2929         (WebKit::WebPageProxy::showCorrectionPanel):
2930         (WebKit::WebPageProxy::dismissCorrectionPanel):
2931         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
2932         (WebKit::WebPageProxy::recordAutocorrectionResponse):
2933         (WebKit::WebPageProxy::useDarkAppearance const):
2934         (WebKit::WebPageProxy::showDictationAlternativeUI):
2935         (WebKit::WebPageProxy::removeDictationAlternatives):
2936         (WebKit::WebPageProxy::dictationAlternatives):
2937         (WebKit::WebPageProxy::setEditableElementIsFocused):
2938         (WebKit::WebPageProxy::takeViewSnapshot):
2939         (WebKit::WebPageProxy::wrapCryptoKey):
2940         (WebKit::WebPageProxy::unwrapCryptoKey):
2941         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
2942         (WebKit::WebPageProxy::navigationGestureDidBegin):
2943         (WebKit::WebPageProxy::navigationGestureWillEnd):
2944         (WebKit::WebPageProxy::navigationGestureDidEnd):
2945         (WebKit::WebPageProxy::willRecordNavigationSnapshot):
2946         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
2947         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2948         (WebKit::WebPageProxy::videoControlsManagerDidChange):
2949         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
2950         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
2951         (WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult):
2952         (WebKit::WebPageProxy::didHandleAcceptedCandidate):
2953         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
2954         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
2955         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2956         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
2957         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled):
2958         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState):
2959         (WebKit::WebPageProxy::didChangeBackgroundColor):
2960         (WebKit::WebPageProxy::didRestoreScrollPosition):
2961         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
2962         (WebKit::WebPageProxy::didInsertAttachment):
2963         (WebKit::WebPageProxy::didRemoveAttachment):
2964         * UIProcess/WebPageProxy.h:
2965         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
2966         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
2967         * UIProcess/gtk/WebPageProxyGtk.cpp:
2968         (WebKit::WebPageProxy::viewWidget):
2969         (WebKit::WebPageProxy::editorStateChanged):
2970         * UIProcess/ios/WebPageProxyIOS.mm:
2971         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
2972         (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
2973         (WebKit::WebPageProxy::overflowScrollViewDidScroll):
2974         (WebKit::WebPageProxy::overflowScrollWillStartScroll):
2975         (WebKit::WebPageProxy::overflowScrollDidEndScroll):
2976         (WebKit::WebPageProxy::didCommitLayerTree):
2977         (WebKit::WebPageProxy::layerTreeCommitComplete):
2978         (WebKit::WebPageProxy::didReceivePositionInformation):
2979         (WebKit::WebPageProxy::saveImageToLibrary):
2980         (WebKit::WebPageProxy::interpretKeyEvent):
2981         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
2982         (WebKit::WebPageProxy::couldNotRestorePageState):
2983         (WebKit::WebPageProxy::restorePageState):
2984         (WebKit::WebPageProxy::restorePageCenterAndScale):
2985         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
2986         (WebKit::WebPageProxy::startAssistingNode):
2987         (WebKit::WebPageProxy::stopAssistingNode):
2988         (WebKit::WebPageProxy::showInspectorHighlight):
2989         (WebKit::WebPageProxy::hideInspectorHighlight):
2990         (WebKit::WebPageProxy::showInspectorIndication):
2991         (WebKit::WebPageProxy::hideInspectorIndication):
2992         (WebKit::WebPageProxy::enableInspectorNodeSearch):
2993         (WebKit::WebPageProxy::disableInspectorNodeSearch):
2994         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
2995         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2996         (WebKit::WebPageProxy::commitPotentialTapFailed):
2997         (WebKit::WebPageProxy::didNotHandleTapAsClick):
2998         (WebKit::WebPageProxy::didCompleteSyntheticClick):
2999         (WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary):
3000         (WebKit::WebPageProxy::editorStateChanged):
3001         (WebKit::WebPageProxy::showValidationMessage):
3002         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest):
3003         (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
3004         (WebKit::WebPageProxy::didConcludeEditDataInteraction):
3005         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
3006         * UIProcess/mac/WebPageProxyMac.mm:
3007         (WebKit::WebPageProxy::windowAndViewFramesChanged):
3008         (WebKit::WebPageProxy::insertDictatedTextAsync):
3009         (WebKit::WebPageProxy::setPromisedDataForImage):
3010         (WebKit::WebPageProxy::didPerformDictionaryLookup):
3011         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
3012         (WebKit::WebPageProxy::makeFirstResponder):
3013         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
3014         (WebKit::WebPageProxy::colorSpace):
3015         (WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged):
3016         (WebKit::WebPageProxy::setPluginComplexTextInputState):
3017         (WebKit::WebPageProxy::executeSavedCommandBySelector):
3018         (WebKit::WebPageProxy::intrinsicContentSizeDidChange):
3019         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
3020         (WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
3021         (WebKit::WebPageProxy::showPDFContextMenu):
3022         (WebKit::WebPageProxy::showTelephoneNumberMenu):
3023         (WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates const):
3024         (WebKit::WebPageProxy::editorStateChanged):
3025         (WebKit::WebPageProxy::startWindowDrag):
3026         (WebKit::WebPageProxy::platformWindow):
3027         (WebKit::WebPageProxy::rootViewToWindow):
3028         (WebKit::WebPageProxy::showValidationMessage):
3029         (WebKit::WebPageProxy::inspectorAttachmentView):
3030         (WebKit::WebPageProxy::remoteObjectRegistry):
3031         * UIProcess/win/WebPageProxyWin.cpp:
3032         (WebKit::WebPageProxy::viewWidget):
3033         * UIProcess/wpe/WebPageProxyWPE.cpp:
3034         (WebKit::WebPageProxy::viewBackend):
3035
3036 2018-09-11  Chris Dumez  <cdumez@apple.com>
3037
3038         Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process
3039         https://bugs.webkit.org/show_bug.cgi?id=189482
3040         <rdar://problem/44317222>
3041
3042         Reviewed by Geoffrey Garen.
3043
3044         The issue was that when we swap process on navigation, we:
3045         1. Call processDidTerminate() which calls resetState() and clears the displayed content
3046         2. Reattach the WebPageProxy to a new WebProcess
3047         3. Trigger the navigation
3048         4. Take the navigation snapshot
3049
3050         When the navigation snapshot occurs at step 4, the view is already blank in the case of
3051         process swap. To avoid the issue, we take the navigation snapshot earlier, before calling
3052         processDidTerminate() and we suppress the next navigation snapshot as it would be blank.
3053
3054         At some point, we will likely want to display the previous' WebProcess content longer,
3055         until the new WebProcess has something interesting to display. Once this is implemented,
3056         we'll likely be able to drop the early snapshotting logic.
3057
3058         * UIProcess/WebPageProxy.cpp:
3059         (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
3060         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3061         (WebKit::WebPageProxy::restoreFromSessionState):
3062         (WebKit::WebPageProxy::didCommitLoadForFrame):
3063         * UIProcess/WebPageProxy.h:
3064         (WebKit::WebPageProxy::suppressNextAutomaticNavigationSnapshot):
3065
3066 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
3067
3068         Add Web API Statistics Collection
3069         https://bugs.webkit.org/show_bug.cgi?id=187773
3070         <rdar://problem/44155162>
3071
3072         Reviewed by Brent Fulgham.
3073
3074         * Shared/WebCoreArgumentCoders.cpp:
3075         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3076         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3077         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
3078
3079 == Rolled over to ChangeLog-2018-09-11 ==