diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-12-11 21:33:03 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2013-12-13 12:34:07 +0100 |
commit | f2a33ff9cbc6d19943f1c7fbddd1f23d23975577 (patch) | |
tree | 0586a32aa390ade8557dfd6b4897f43a07449578 /chromium/content/browser/ssl/ssl_manager.cc | |
parent | 5362912cdb5eea702b68ebe23702468d17c3017a (diff) | |
download | qtwebengine-chromium-f2a33ff9cbc6d19943f1c7fbddd1f23d23975577.tar.gz |
Update Chromium to branch 1650 (31.0.1650.63)
Change-Id: I57d8c832eaec1eb2364e0a8e7352a6dd354db99f
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/content/browser/ssl/ssl_manager.cc')
-rw-r--r-- | chromium/content/browser/ssl/ssl_manager.cc | 72 |
1 files changed, 18 insertions, 54 deletions
diff --git a/chromium/content/browser/ssl/ssl_manager.cc b/chromium/content/browser/ssl/ssl_manager.cc index c86dccdcda6..42ee02fbb1c 100644 --- a/chromium/content/browser/ssl/ssl_manager.cc +++ b/chromium/content/browser/ssl/ssl_manager.cc @@ -21,8 +21,6 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/load_from_memory_cache_details.h" #include "content/public/browser/navigation_details.h" -#include "content/public/browser/notification_service.h" -#include "content/public/browser/notification_source.h" #include "content/public/browser/resource_request_details.h" #include "content/public/common/ssl_status.h" #include "net/url_request/url_request.h" @@ -99,17 +97,6 @@ SSLManager::SSLManager(NavigationControllerImpl* controller) controller_(controller) { DCHECK(controller_); - // Subscribe to various notifications. - registrar_.Add( - this, NOTIFICATION_RESOURCE_RESPONSE_STARTED, - Source<WebContents>(controller_->web_contents())); - registrar_.Add( - this, NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, - Source<WebContents>(controller_->web_contents())); - registrar_.Add( - this, NOTIFICATION_LOAD_FROM_MEMORY_CACHE, - Source<NavigationController>(controller_)); - SSLManagerSet* managers = static_cast<SSLManagerSet*>( controller_->GetBrowserContext()->GetUserData(kSSLManagerKeyName)); if (!managers) { @@ -125,22 +112,18 @@ SSLManager::~SSLManager() { managers->get().erase(this); } -void SSLManager::DidCommitProvisionalLoad( - const NotificationDetails& in_details) { - LoadCommittedDetails* details = - Details<LoadCommittedDetails>(in_details).ptr(); - +void SSLManager::DidCommitProvisionalLoad(const LoadCommittedDetails& details) { NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(controller_->GetActiveEntry()); - if (details->is_main_frame) { + if (details.is_main_frame) { if (entry) { // Decode the security details. int ssl_cert_id; net::CertStatus ssl_cert_status; int ssl_security_bits; int ssl_connection_status; - DeserializeSecurityInfo(details->serialized_security_info, + DeserializeSecurityInfo(details.serialized_security_info, &ssl_cert_id, &ssl_cert_status, &ssl_security_bits, @@ -171,52 +154,32 @@ void SSLManager::DidRunInsecureContent(const std::string& security_origin) { UpdateEntry(navigation_entry); } -void SSLManager::Observe(int type, - const NotificationSource& source, - const NotificationDetails& details) { - // Dispatch by type. - switch (type) { - case NOTIFICATION_RESOURCE_RESPONSE_STARTED: - DidStartResourceResponse( - Details<ResourceRequestDetails>(details).ptr()); - break; - case NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: - DidReceiveResourceRedirect( - Details<ResourceRedirectDetails>(details).ptr()); - break; - case NOTIFICATION_LOAD_FROM_MEMORY_CACHE: - DidLoadFromMemoryCache( - Details<LoadFromMemoryCacheDetails>(details).ptr()); - break; - default: - NOTREACHED() << "The SSLManager received an unexpected notification."; - } -} - -void SSLManager::DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details) { +void SSLManager::DidLoadFromMemoryCache( + const LoadFromMemoryCacheDetails& 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. // This resource must have been loaded with no filtering because filtered // resouces aren't cachable. scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( - details->url, + details.url, ResourceType::SUB_RESOURCE, - details->pid, - details->cert_id, - details->cert_status)); + details.pid, + details.cert_id, + details.cert_status)); // Simulate loading this resource through the usual path. policy()->OnRequestStarted(info.get()); } -void SSLManager::DidStartResourceResponse(ResourceRequestDetails* details) { +void SSLManager::DidStartResourceResponse( + const ResourceRequestDetails& details) { scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( - details->url, - details->resource_type, - details->origin_child_id, - details->ssl_cert_id, - details->ssl_cert_status)); + details.url, + details.resource_type, + details.origin_child_id, + details.ssl_cert_id, + details.ssl_cert_status)); // Notify our policy that we started a resource request. Ideally, the // policy should have the ability to cancel the request, but we can't do @@ -224,7 +187,8 @@ void SSLManager::DidStartResourceResponse(ResourceRequestDetails* details) { policy()->OnRequestStarted(info.get()); } -void SSLManager::DidReceiveResourceRedirect(ResourceRedirectDetails* details) { +void SSLManager::DidReceiveResourceRedirect( + const ResourceRedirectDetails& details) { // 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 |