Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2574)

Unified Diff: chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc

Issue 2913253002: GRC: Hook up the frame-level CoordinationUnit (Closed)
Patch Set: Review fixes and rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc
diff --git a/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc b/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc
index cfa88b7309c048992a75f07789e094e8cff35c8b..074c881f6dbe56b3aedbf74a3019e82a7b010202 100644
--- a/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc
+++ b/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.h"
+#include "content/public/browser/navigation_handle.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/common/service_manager_connection.h"
#include "services/resource_coordinator/public/cpp/resource_coordinator_features.h"
@@ -35,3 +37,15 @@ void ResourceCoordinatorWebContentsObserver::WasHidden() {
tab_resource_coordinator_->SendEvent(
resource_coordinator::EventType::kOnWebContentsHidden);
}
+
+void ResourceCoordinatorWebContentsObserver::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->HasCommitted() || navigation_handle->IsErrorPage() ||
+ navigation_handle->IsSameDocument()) {
+ return;
+ }
+
+ auto* frame_resource_coordinator =
+ navigation_handle->GetRenderFrameHost()->GetFrameResourceCoordinator();
+ tab_resource_coordinator_->AddChild(*frame_resource_coordinator);
+}

Powered by Google App Engine
This is Rietveld 408576698