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

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

Issue 2239273002: Don't use SSLStatus from FrameHostMsg_DidCommitProvisionalLoad and instead cache it on the browser … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 4 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 67976058ed9200cacfe6b013d69cfb2cc977eaf8..1c2283d01a72ccef5381f3c8f9baf08ad8abcf6e 100644
--- a/content/browser/loader/navigation_resource_throttle.cc
+++ b/content/browser/loader/navigation_resource_throttle.cc
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/browser/loader/resource_loader.h"
#include "content/browser/loader/resource_request_info_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_data.h"
@@ -21,6 +22,7 @@
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/common/referrer.h"
+#include "content/public/common/ssl_status.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
@@ -111,6 +113,7 @@ void WillProcessResponseOnUIThread(
int render_process_id,
int render_frame_host_id,
scoped_refptr<net::HttpResponseHeaders> headers,
+ const SSLStatus& ssl_status,
std::unique_ptr<NavigationData> navigation_data) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderFrameHostImpl* render_frame_host =
@@ -131,7 +134,7 @@ void WillProcessResponseOnUIThread(
navigation_handle->set_navigation_data(std::move(navigation_data));
navigation_handle->WillProcessResponse(
- render_frame_host, headers,
+ render_frame_host, headers, ssl_status,
base::Bind(&SendCheckResultToIOThread, callback));
}
@@ -140,9 +143,11 @@ void WillProcessResponseOnUIThread(
NavigationResourceThrottle::NavigationResourceThrottle(
net::URLRequest* request,
ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate,
+ CertStore* cert_store,
RequestContextType request_context_type)
: request_(request),
resource_dispatcher_host_delegate_(resource_dispatcher_host_delegate),
+ cert_store_(cert_store),
request_context_type_(request_context_type),
weak_ptr_factory_(this) {}
@@ -253,10 +258,17 @@ void NavigationResourceThrottle::WillProcessResponse(bool* defer) {
base::Bind(&NavigationResourceThrottle::OnUIChecksPerformed,
weak_ptr_factory_.GetWeakPtr());
+ SSLStatus ssl_status;
+ if (request_->ssl_info().cert.get()) {
+ ResourceLoader::GetSSLStatusForRequest(
+ request_->url(), request_->ssl_info(), info->GetChildID(),
+ cert_store_, &ssl_status);
+ }
+
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&WillProcessResponseOnUIThread, callback, render_process_id,
- render_frame_id, response_headers,
+ render_frame_id, response_headers, ssl_status,
base::Passed(&cloned_data)));
*defer = true;
}

Powered by Google App Engine
This is Rietveld 408576698