| OLD | NEW |
| 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/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 GetRequestInfo()->GetContext()->CreateClientCertStore(), request_.get(), | 303 GetRequestInfo()->GetContext()->CreateClientCertStore(), request_.get(), |
| 304 cert_info, this)); | 304 cert_info, this)); |
| 305 ssl_client_auth_handler_->SelectCertificate(); | 305 ssl_client_auth_handler_->SelectCertificate(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void ResourceLoader::OnSSLCertificateError(net::URLRequest* request, | 308 void ResourceLoader::OnSSLCertificateError(net::URLRequest* request, |
| 309 const net::SSLInfo& ssl_info, | 309 const net::SSLInfo& ssl_info, |
| 310 bool fatal) { | 310 bool fatal) { |
| 311 ResourceRequestInfoImpl* info = GetRequestInfo(); | 311 ResourceRequestInfoImpl* info = GetRequestInfo(); |
| 312 | 312 |
| 313 int render_process_id; | |
| 314 int render_frame_id; | |
| 315 if (!info->GetAssociatedRenderFrame(&render_process_id, &render_frame_id)) | |
| 316 NOTREACHED(); | |
| 317 | |
| 318 SSLManager::OnSSLCertificateError( | 313 SSLManager::OnSSLCertificateError( |
| 319 weak_ptr_factory_.GetWeakPtr(), | 314 weak_ptr_factory_.GetWeakPtr(), info->GetResourceType(), request_->url(), |
| 320 info->GetResourceType(), | 315 info->GetWebContentsForRequest(), ssl_info, fatal); |
| 321 request_->url(), | |
| 322 render_process_id, | |
| 323 render_frame_id, | |
| 324 ssl_info, | |
| 325 fatal); | |
| 326 } | 316 } |
| 327 | 317 |
| 328 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused, | 318 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused, |
| 329 bool* defer) { | 319 bool* defer) { |
| 330 DCHECK_EQ(request_.get(), unused); | 320 DCHECK_EQ(request_.get(), unused); |
| 331 | 321 |
| 332 // Give the handler a chance to delay the URLRequest from using the network. | 322 // Give the handler a chance to delay the URLRequest from using the network. |
| 333 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) { | 323 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) { |
| 334 Cancel(); | 324 Cancel(); |
| 335 return; | 325 return; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 case net::URLRequestStatus::FAILED: | 697 case net::URLRequestStatus::FAILED: |
| 708 status = STATUS_UNDEFINED; | 698 status = STATUS_UNDEFINED; |
| 709 break; | 699 break; |
| 710 } | 700 } |
| 711 | 701 |
| 712 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 702 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
| 713 } | 703 } |
| 714 } | 704 } |
| 715 | 705 |
| 716 } // namespace content | 706 } // namespace content |
| OLD | NEW |