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

Unified Diff: content/browser/loader/navigation_resource_throttle.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/loader/navigation_resource_throttle.cc
diff --git a/content/browser/loader/navigation_resource_throttle.cc b/content/browser/loader/navigation_resource_throttle.cc
index 6a7f6b6688ed16a84c9d65a217ecfba6a8e24d05..d637bc8c755d633a5bc9c6463d1ff9da19b42583 100644
--- a/content/browser/loader/navigation_resource_throttle.cc
+++ b/content/browser/loader/navigation_resource_throttle.cc
@@ -350,6 +350,15 @@ void NavigationResourceThrottle::OnUIChecksPerformed(
Cancel();
} else if (result == NavigationThrottle::BLOCK_REQUEST) {
CancelWithError(net::ERR_BLOCKED_BY_CLIENT);
+ } else if (result == NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE) {
+ int render_process_id, render_frame_id;
+ if (ResourceRequestInfo::ForRequest(request_)->GetAssociatedRenderFrame(
+ &render_process_id, &render_frame_id)) {
+ RenderFrameHostImpl* render_frame_host =
+ RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
+ render_frame_host->frame_tree_node()->SetFrameOwnerCollapsedState(true);
+ }
+ CancelWithError(net::ERR_BLOCKED_BY_CLIENT);
} else if (result == NavigationThrottle::BLOCK_RESPONSE) {
// TODO(mkwst): If we cancel the main frame request with anything other than
// 'net::ERR_ABORTED', we'll trigger some special behavior that might not be

Powered by Google App Engine
This is Rietveld 408576698