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

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

Issue 2060313002: Navigation throttle for the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pre-tab-activation
Patch Set: Navigation throttle for the Safe Browsing Subresource Filter. Created 4 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: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 90e06f1c7327fa2255f7b40039de183d1ba86b71..6e86fccaa24b1178e6dcab991591dd52d622602f 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -183,7 +183,7 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
- CHECK(state_ >= READY_TO_COMMIT)
+ CHECK(state_ >= READY_TO_COMMIT || state_ == WILL_PROCESS_RESPONSE)
<< "This accessor should only be called "
"after the navigation is ready to commit.";
return render_frame_host_;
@@ -291,6 +291,19 @@ NavigationHandleImpl::CallWillRedirectRequestForTesting(
return result;
}
+NavigationThrottle::ThrottleCheckResult
+NavigationHandleImpl::CallWillProcessResponseForTesting(
+ content::RenderFrameHost* render_frame_host) {
+ NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
+ WillProcessResponse(static_cast<RenderFrameHostImpl*>(render_frame_host),
+ scoped_refptr<net::HttpResponseHeaders>(),
+ base::Bind(&UpdateThrottleCheckResult, &result));
+
+ // Reset the callback to ensure it will not be called later.
+ complete_callback_.Reset();
+ return result;
+}
+
NavigationData* NavigationHandleImpl::GetNavigationData() {
return navigation_data_.get();
}

Powered by Google App Engine
This is Rietveld 408576698