diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 09:18:06 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-17 09:18:06 +0000 |
commit | c46b0e667387bb42a18be86e8b1f85e968902953 (patch) | |
tree | 801ddb204b400e25ecd3fe1211584e5b5519e93e /chrome/browser/renderer_host/resource_dispatcher_host.cc | |
parent | ffc45869f044885b81265e6a67cb0220758113b5 (diff) | |
download | chromium_src-c46b0e667387bb42a18be86e8b1f85e968902953.zip chromium_src-c46b0e667387bb42a18be86e8b1f85e968902953.tar.gz chromium_src-c46b0e667387bb42a18be86e8b1f85e968902953.tar.bz2 |
SSLPolicy Fix: Step 3.
Plumbing the security origin of the frame making the request to SSL land.
R=wtc
BUG=8706
Review URL: http://codereview.chromium.org/48038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/resource_dispatcher_host.cc')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 22d7bcb..9d608ec 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -373,13 +373,14 @@ void ResourceDispatcherHost::BeginRequest( process_id, route_id, request_id, - request_data.mixed_content, + request_data.frame_origin, + request_data.main_frame_origin, request_data.resource_type, upload_size); extra_info->allow_download = ResourceType::IsFrame(request_data.resource_type); request->set_user_data(extra_info); // takes pointer ownership - BeginRequestInternal(request, request_data.mixed_content); + BeginRequestInternal(request); } void ResourceDispatcherHost::OnDataReceivedACK(int request_id) { @@ -507,14 +508,15 @@ void ResourceDispatcherHost::BeginDownload(const GURL& url, process_id, route_id, request_id_, - false, // Downloads are not considered mixed-content + "null", // frame_origin + "null", // main_frame_origin ResourceType::SUB_RESOURCE, 0 /* upload_size */ ); extra_info->allow_download = true; extra_info->is_download = true; request->set_user_data(extra_info); // Takes pointer ownership. - BeginRequestInternal(request, false); + BeginRequestInternal(request); } // This function is only used for saving feature. @@ -560,7 +562,8 @@ void ResourceDispatcherHost::BeginSaveFile(const GURL& url, process_id, route_id, request_id_, - false, + "null", // frame_origin + "null", // main_frame_origin ResourceType::SUB_RESOURCE, 0 /* upload_size */); // Just saving some resources we need, disallow downloading. @@ -568,7 +571,7 @@ void ResourceDispatcherHost::BeginSaveFile(const GURL& url, extra_info->is_download = false; request->set_user_data(extra_info); // Takes pointer ownership. - BeginRequestInternal(request, false); + BeginRequestInternal(request); } void ResourceDispatcherHost::CancelRequest(int process_id, @@ -980,8 +983,7 @@ int ResourceDispatcherHost::CalculateApproximateMemoryCost( return kAvgBytesPerOutstandingRequest + strings_cost + upload_cost; } -void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request, - bool mixed_content) { +void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request) { DCHECK(!request->is_pending()); ExtraRequestInfo* info = ExtraInfoForRequest(request); @@ -1010,17 +1012,16 @@ void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request, BlockedRequestMap::const_iterator iter = blocked_requests_map_.find(pair_id); if (iter != blocked_requests_map_.end()) { // The request should be blocked. - iter->second->push_back(BlockedRequest(request, mixed_content)); + iter->second->push_back(BlockedRequest(request)); return; } GlobalRequestID global_id(info->process_id, info->request_id); pending_requests_[global_id] = request; - if (mixed_content) { - // We don't start the request in that case. The SSLManager will potentially - // change the request (potentially to indicate its content should be - // filtered) and start it itself. - SSLManager::OnMixedContentRequest(this, request, ui_loop_); + if (!SSLManager::ShouldStartRequest(this, request, ui_loop_)) { + // The SSLManager has told us that we shouldn't start the request yet. The + // SSLManager will potentially change the request (potentially to indicate + // its content should be filtered) and start it itself. return; } request->Start(); @@ -1508,7 +1509,7 @@ void ResourceDispatcherHost::ProcessBlockedRequestsForRoute( if (cancel_requests) delete req_iter->url_request; else - BeginRequestInternal(req_iter->url_request, req_iter->mixed_content); + BeginRequestInternal(req_iter->url_request); } delete requests; |