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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Remove surplus semicolon. Created 3 years, 11 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: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 9f676eb677e923edb349021448e6600222f3df1e..ebb1f327511e7a20f494a2200d27bbf3302d1dce 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -580,6 +580,14 @@ void NavigationRequest::OnStartChecksComplete(
return;
}
+ if (result == NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE) {
+ frame_tree_node_->SetFrameOwnerCollapsedState(true);
clamy 2017/01/18 15:10:55 Suggestion: maybe we could move this to the Naviga
engedy 2017/01/18 23:37:14 Done.
+ OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT);
clamy 2017/01/18 15:10:55 Just checking: this means we will attempt to load
engedy 2017/01/18 23:37:14 Yep, it is intended that we navigate away from the
+ // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
+ // destroyed the NavigationRequest.
+ return;
+ }
+
// Use the SiteInstance of the navigating RenderFrameHost to get access to
// the StoragePartition. Using the url of the navigation will result in a
// wrong StoragePartition being picked when a WebView is navigating.
@@ -666,6 +674,14 @@ void NavigationRequest::OnRedirectChecksComplete(
return;
}
+ if (result == NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE) {
+ frame_tree_node_->SetFrameOwnerCollapsedState(true);
+ OnRequestFailed(false, net::ERR_BLOCKED_BY_CLIENT);
+ // DO NOT ADD CODE after this. The previous call to OnRequestFailed has
+ // destroyed the NavigationRequest.
+ return;
+ }
+
loader_->FollowRedirect();
}

Powered by Google App Engine
This is Rietveld 408576698