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

Unified Diff: content/browser/loader/navigation_resource_throttle.cc

Issue 1530393003: WIP: Move 'X-Frame-Options' checking to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years 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 44fd0c131ff413fd0d90d0d4c07adae7dedc338b..effba19edd974005b66ae415ccdde983094383ca 100644
--- a/content/browser/loader/navigation_resource_throttle.cc
+++ b/content/browser/loader/navigation_resource_throttle.cc
@@ -92,7 +92,8 @@ void CheckWillRedirectRequestOnUIThread(
base::Bind(&SendCheckResultToIOThread, callback));
}
-void WillProcessResponseOnUIThread(
+void CheckWillProcessResponseOnUIThread(
+ UIChecksPerformedCallback callback,
int render_process_id,
int render_frame_host_id,
scoped_refptr<net::HttpResponseHeaders> headers) {
@@ -107,7 +108,9 @@ void WillProcessResponseOnUIThread(
if (!navigation_handle)
return;
- navigation_handle->ReadyToCommitNavigation(render_frame_host, headers);
+ navigation_handle->WillProcessResponse(
+ render_frame_host, headers,
+ base::Bind(&SendCheckResultToIOThread, callback));
}
} // namespace
@@ -204,10 +207,14 @@ void NavigationResourceThrottle::WillProcessResponse(bool* defer) {
request_->response_headers()->raw_headers());
}
+ UIChecksPerformedCallback callback =
+ base::Bind(&NavigationResourceThrottle::OnUIChecksPerformed,
+ weak_ptr_factory_.GetWeakPtr());
+
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&WillProcessResponseOnUIThread, render_process_id,
- render_frame_id, response_headers));
+ base::Bind(&CheckWillProcessResponseOnUIThread, callback,
+ render_process_id, render_frame_id, response_headers));
clamy 2015/12/21 10:13:29 You need to set *defer=true somewhere here, otherw
}
const char* NavigationResourceThrottle::GetNameForLogging() const {

Powered by Google App Engine
This is Rietveld 408576698