Index: chrome/browser/ssl/ssl_manager.cc |
=================================================================== |
--- chrome/browser/ssl/ssl_manager.cc (revision 70223) |
+++ chrome/browser/ssl/ssl_manager.cc (working copy) |
@@ -10,13 +10,17 @@ |
#include "chrome/browser/load_from_memory_cache_details.h" |
#include "chrome/browser/net/url_request_tracking.h" |
#include "chrome/browser/prefs/pref_service.h" |
+#include "chrome/browser/renderer_host/render_view_host.h" |
#include "chrome/browser/renderer_host/resource_request_details.h" |
+#include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
+#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" |
#include "chrome/browser/ssl/ssl_cert_error_handler.h" |
#include "chrome/browser/ssl/ssl_policy.h" |
#include "chrome/browser/ssl/ssl_request_info.h" |
#include "chrome/browser/tab_contents/navigation_controller.h" |
#include "chrome/browser/tab_contents/navigation_entry.h" |
#include "chrome/browser/tab_contents/provisional_load_details.h" |
+#include "chrome/browser/tab_contents/tab_contents.h" |
#include "chrome/common/notification_service.h" |
#include "chrome/common/pref_names.h" |
#include "grit/generated_resources.h" |
@@ -118,9 +122,9 @@ |
registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, |
Source<NavigationController>(controller_)); |
registrar_.Add(this, NotificationType::RESOURCE_RESPONSE_STARTED, |
- Source<NavigationController>(controller_)); |
+ NotificationService::AllSources()); |
registrar_.Add(this, NotificationType::RESOURCE_RECEIVED_REDIRECT, |
- Source<NavigationController>(controller_)); |
+ NotificationService::AllSources()); |
registrar_.Add(this, NotificationType::LOAD_FROM_MEMORY_CACHE, |
Source<NavigationController>(controller_)); |
registrar_.Add(this, NotificationType::SSL_INTERNAL_STATE_CHANGED, |
@@ -204,8 +208,6 @@ |
} |
void SSLManager::DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details) { |
- DCHECK(details); |
- |
// Simulate loading this resource through the usual path. |
// Note that we specify SUB_RESOURCE as the resource type as WebCore only |
// caches sub-resources. |
@@ -225,7 +227,10 @@ |
} |
void SSLManager::DidStartResourceResponse(ResourceRequestDetails* details) { |
- DCHECK(details); |
+ RenderViewHost* rvh = RenderViewHost::FromID( |
+ details->render_process_id(), details->render_view_id()); |
+ if (rvh != controller_->tab_contents()->render_view_host()) |
+ return; |
scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( |
details->url(), |
@@ -243,6 +248,11 @@ |
} |
void SSLManager::DidReceiveResourceRedirect(ResourceRedirectDetails* details) { |
+ RenderViewHost* rvh = RenderViewHost::FromID( |
+ details->render_process_id(), details->render_view_id()); |
+ if (rvh != controller_->tab_contents()->render_view_host()) |
+ return; |
+ |
// TODO(abarth): Make sure our redirect behavior is correct. If we ever see a |
// non-HTTPS resource in the redirect chain, we want to trigger |
// insecure content, even if the redirect chain goes back to |