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

Side by Side Diff: content/browser/ssl/ssl_manager.cc

Issue 10582007: Moving LoadFromMemoryCacheDetails to content/public/browser and making it a struct. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/ssl/ssl_manager.h" 5 #include "content/browser/ssl/ssl_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "content/browser/load_from_memory_cache_details.h"
10 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" 9 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
10 #include "content/public/browser/load_from_memory_cache_details.h"
jam 2012/06/18 23:29:01 nit: order (also below which isn't your fault:) )
Shishir 2012/06/18 23:53:46 Done.
11 #include "content/public/browser/resource_request_details.h" 11 #include "content/public/browser/resource_request_details.h"
12 #include "content/browser/renderer_host/resource_request_info_impl.h" 12 #include "content/browser/renderer_host/resource_request_info_impl.h"
13 #include "content/browser/ssl/ssl_cert_error_handler.h" 13 #include "content/browser/ssl/ssl_cert_error_handler.h"
14 #include "content/browser/ssl/ssl_policy.h" 14 #include "content/browser/ssl/ssl_policy.h"
15 #include "content/browser/ssl/ssl_request_info.h" 15 #include "content/browser/ssl/ssl_request_info.h"
16 #include "content/browser/web_contents/navigation_entry_impl.h" 16 #include "content/browser/web_contents/navigation_entry_impl.h"
17 #include "content/browser/web_contents/web_contents_impl.h" 17 #include "content/browser/web_contents/web_contents_impl.h"
18 #include "content/common/ssl_status_serialization.h" 18 #include "content/common/ssl_status_serialization.h"
19 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
20 #include "content/public/browser/navigation_details.h" 20 #include "content/public/browser/navigation_details.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 case content::NOTIFICATION_RESOURCE_RESPONSE_STARTED: 151 case content::NOTIFICATION_RESOURCE_RESPONSE_STARTED:
152 DidStartResourceResponse( 152 DidStartResourceResponse(
153 content::Details<ResourceRequestDetails>(details).ptr()); 153 content::Details<ResourceRequestDetails>(details).ptr());
154 break; 154 break;
155 case content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT: 155 case content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT:
156 DidReceiveResourceRedirect( 156 DidReceiveResourceRedirect(
157 content::Details<ResourceRedirectDetails>(details).ptr()); 157 content::Details<ResourceRedirectDetails>(details).ptr());
158 break; 158 break;
159 case content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE: 159 case content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE:
160 DidLoadFromMemoryCache( 160 DidLoadFromMemoryCache(
161 content::Details<LoadFromMemoryCacheDetails>(details).ptr()); 161 content::Details<content::LoadFromMemoryCacheDetails>(details).ptr());
162 break; 162 break;
163 case content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED: 163 case content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED:
164 DidChangeSSLInternalState(); 164 DidChangeSSLInternalState();
165 break; 165 break;
166 default: 166 default:
167 NOTREACHED() << "The SSLManager received an unexpected notification."; 167 NOTREACHED() << "The SSLManager received an unexpected notification.";
168 } 168 }
169 } 169 }
170 170
171 void SSLManager::DidLoadFromMemoryCache(LoadFromMemoryCacheDetails* details) { 171 void SSLManager::DidLoadFromMemoryCache(
172 content::LoadFromMemoryCacheDetails* details) {
172 // Simulate loading this resource through the usual path. 173 // Simulate loading this resource through the usual path.
173 // Note that we specify SUB_RESOURCE as the resource type as WebCore only 174 // Note that we specify SUB_RESOURCE as the resource type as WebCore only
174 // caches sub-resources. 175 // caches sub-resources.
175 // This resource must have been loaded with no filtering because filtered 176 // This resource must have been loaded with no filtering because filtered
176 // resouces aren't cachable. 177 // resouces aren't cachable.
177 scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( 178 scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo(
178 details->url(), 179 details->url,
179 ResourceType::SUB_RESOURCE, 180 ResourceType::SUB_RESOURCE,
180 details->pid(), 181 details->pid,
181 details->ssl_cert_id(), 182 details->cert_id,
182 details->ssl_cert_status())); 183 details->cert_status));
183 184
184 // Simulate loading this resource through the usual path. 185 // Simulate loading this resource through the usual path.
185 policy()->OnRequestStarted(info.get()); 186 policy()->OnRequestStarted(info.get());
186 } 187 }
187 188
188 void SSLManager::DidStartResourceResponse(ResourceRequestDetails* details) { 189 void SSLManager::DidStartResourceResponse(ResourceRequestDetails* details) {
189 scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo( 190 scoped_refptr<SSLRequestInfo> info(new SSLRequestInfo(
190 details->url, 191 details->url,
191 details->resource_type, 192 details->resource_type,
192 details->origin_child_id, 193 details->origin_child_id,
(...skipping 29 matching lines...) Expand all
222 223
223 policy()->UpdateEntry(entry, controller_->web_contents()); 224 policy()->UpdateEntry(entry, controller_->web_contents());
224 225
225 if (!entry->GetSSL().Equals(original_ssl_status)) { 226 if (!entry->GetSSL().Equals(original_ssl_status)) {
226 content::NotificationService::current()->Notify( 227 content::NotificationService::current()->Notify(
227 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, 228 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
228 content::Source<NavigationController>(controller_), 229 content::Source<NavigationController>(controller_),
229 content::NotificationService::NoDetails()); 230 content::NotificationService::NoDetails());
230 } 231 }
231 } 232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698