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