FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2019 03:13:45 +0000 (03:13 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Sep 2019 03:13:45 +0000 (03:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201431

Reviewed by Antti Koivisto.

Source/WebCore:

FrameLoader::FrameProgressTracker::progressCompleted() does not need to request a pageID
from the client. It can merely pass the Page object and the upper layers can very easily
get the identifier of that page.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
* loader/LoaderStrategy.h:

Source/WebKit:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::pageLoadCompleted):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::pageLoadCompleted):
* WebCoreSupport/WebResourceLoadScheduler.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249452 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/LoaderStrategy.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.cpp
Source/WebKitLegacy/WebCoreSupport/WebResourceLoadScheduler.h

index 6ca0e4b..2923a68 100644 (file)
@@ -1,3 +1,18 @@
+2019-09-03  Chris Dumez  <cdumez@apple.com>
+
+        FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
+        https://bugs.webkit.org/show_bug.cgi?id=201431
+
+        Reviewed by Antti Koivisto.
+
+        FrameLoader::FrameProgressTracker::progressCompleted() does not need to request a pageID
+        from the client. It can merely pass the Page object and the upper layers can very easily
+        get the identifier of that page.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
+        * loader/LoaderStrategy.h:
+
 2019-09-03  Devin Rousso  <drousso@apple.com>
 
         REGRESSION (r249078): Flaky crash in com.apple.JavaScriptCore: Inspector::InjectedScriptModule::ensureInjected
index f50b115..00081cc 100644 (file)
@@ -257,9 +257,7 @@ public:
         ASSERT(m_frame.page());
         m_inProgress = false;
         m_frame.page()->progress().progressCompleted(m_frame);
-
-        if (auto pageID = m_frame.loader().client().pageID())
-            platformStrategies()->loaderStrategy()->pageLoadCompleted(pageID.value());
+        platformStrategies()->loaderStrategy()->pageLoadCompleted(*m_frame.page());
     }
 
 private:
index 45feb63..93b56ad 100644 (file)
@@ -44,6 +44,7 @@ class NetscapePlugInStreamLoader;
 class NetscapePlugInStreamLoaderClient;
 struct NetworkTransactionInformation;
 class NetworkLoadMetrics;
+class Page;
 class ResourceError;
 class ResourceLoader;
 class ResourceRequest;
@@ -58,7 +59,7 @@ class WEBCORE_EXPORT LoaderStrategy {
 public:
     virtual void loadResource(Frame&, CachedResource&, ResourceRequest&&, const ResourceLoaderOptions&, CompletionHandler<void(RefPtr<SubresourceLoader>&&)>&&) = 0;
     virtual void loadResourceSynchronously(FrameLoader&, unsigned long identifier, const ResourceRequest&, ClientCredentialPolicy, const FetchOptions&, const HTTPHeaderMap&, ResourceError&, ResourceResponse&, Vector<char>& data) = 0;
-    virtual void pageLoadCompleted(PageIdentifier) = 0;
+    virtual void pageLoadCompleted(Page&) = 0;
 
     virtual void remove(ResourceLoader*) = 0;
     virtual void setDefersLoading(ResourceLoader&, bool) = 0;
index 2b6e502..e301cfb 100644 (file)
@@ -1,3 +1,14 @@
+2019-09-03  Chris Dumez  <cdumez@apple.com>
+
+        FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
+        https://bugs.webkit.org/show_bug.cgi?id=201431
+
+        Reviewed by Antti Koivisto.
+
+        * WebProcess/Network/WebLoaderStrategy.cpp:
+        (WebKit::WebLoaderStrategy::pageLoadCompleted):
+        * WebProcess/Network/WebLoaderStrategy.h:
+
 2019-09-03  Tim Horton  <timothy_horton@apple.com>
 
         Null deref under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]'s handler block
index ec8f19d..3f60cd7 100644 (file)
@@ -583,9 +583,9 @@ void WebLoaderStrategy::loadResourceSynchronously(FrameLoader& frameLoader, unsi
         WebProcess::singleton().parentProcessConnection()->send(Messages::WebProcessPool::ClearWebProcessHasUploads { Process::identifier() }, 0);
 }
 
-void WebLoaderStrategy::pageLoadCompleted(PageIdentifier webPageID)
+void WebLoaderStrategy::pageLoadCompleted(Page& page)
 {
-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PageLoadCompleted(webPageID), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PageLoadCompleted(WebPage::fromCorePage(page).identifier()), 0);
 }
 
 static uint64_t generateLoadIdentifier()
index dc54f2d..c9a118f 100644 (file)
@@ -51,7 +51,7 @@ public:
     
     void loadResource(WebCore::Frame&, WebCore::CachedResource&, WebCore::ResourceRequest&&, const WebCore::ResourceLoaderOptions&, CompletionHandler<void(RefPtr<WebCore::SubresourceLoader>&&)>&&) final;
     void loadResourceSynchronously(WebCore::FrameLoader&, unsigned long resourceLoadIdentifier, const WebCore::ResourceRequest&, WebCore::ClientCredentialPolicy, const WebCore::FetchOptions&, const WebCore::HTTPHeaderMap&, WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>& data) final;
-    void pageLoadCompleted(WebCore::PageIdentifier) final;
+    void pageLoadCompleted(WebCore::Page&) final;
 
     void remove(WebCore::ResourceLoader*) final;
     void setDefersLoading(WebCore::ResourceLoader&, bool) final;
index ac7fda3..2d5f476 100644 (file)
@@ -1,3 +1,14 @@
+2019-09-03  Chris Dumez  <cdumez@apple.com>
+
+        FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
+        https://bugs.webkit.org/show_bug.cgi?id=201431
+
+        Reviewed by Antti Koivisto.
+
+        * WebCoreSupport/WebResourceLoadScheduler.cpp:
+        (WebResourceLoadScheduler::pageLoadCompleted):
+        * WebCoreSupport/WebResourceLoadScheduler.h:
+
 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
 
         [FTW] Use DirectX SharedResource as basis for SharedBitmap
index 796024c..bd0ca36 100644 (file)
@@ -111,7 +111,7 @@ void WebResourceLoadScheduler::loadResourceSynchronously(FrameLoader& frameLoade
     ResourceHandle::loadResourceSynchronously(frameLoader.networkingContext(), request, options.credentials == FetchOptions::Credentials::Omit ? StoredCredentialsPolicy::DoNotUse : StoredCredentialsPolicy::Use, error, response, data);
 }
 
-void WebResourceLoadScheduler::pageLoadCompleted(PageIdentifier)
+void WebResourceLoadScheduler::pageLoadCompleted(Page&)
 {
 }
 
index 5f62f77..8ec8a49 100644 (file)
@@ -46,7 +46,7 @@ public:
 
     void loadResource(WebCore::Frame&, WebCore::CachedResource&, WebCore::ResourceRequest&&, const WebCore::ResourceLoaderOptions&, CompletionHandler<void(RefPtr<WebCore::SubresourceLoader>&&)>&&) final;
     void loadResourceSynchronously(WebCore::FrameLoader&, unsigned long, const WebCore::ResourceRequest&, WebCore::ClientCredentialPolicy, const WebCore::FetchOptions&, const WebCore::HTTPHeaderMap&, WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>&) final;
-    void pageLoadCompleted(WebCore::PageIdentifier) final;
+    void pageLoadCompleted(WebCore::Page&) final;
 
     void remove(WebCore::ResourceLoader*) final;
     void setDefersLoading(WebCore::ResourceLoader&, bool) final;