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