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