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(), |
320 info->GetResourceType(), | 315 info->GetResourceType(), |
321 request_->url(), | 316 request_->url(), |
322 render_process_id, | 317 info->GetWebContentsForRequest(), |
323 render_frame_id, | |
324 ssl_info, | 318 ssl_info, |
325 fatal); | 319 fatal); |
326 } | 320 } |
327 | 321 |
328 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused, | 322 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused, |
329 bool* defer) { | 323 bool* defer) { |
330 DCHECK_EQ(request_.get(), unused); | 324 DCHECK_EQ(request_.get(), unused); |
331 | 325 |
332 // Give the handler a chance to delay the URLRequest from using the network. | 326 // Give the handler a chance to delay the URLRequest from using the network. |
333 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) { | 327 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) { |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 case net::URLRequestStatus::FAILED: | 701 case net::URLRequestStatus::FAILED: |
708 status = STATUS_UNDEFINED; | 702 status = STATUS_UNDEFINED; |
709 break; | 703 break; |
710 } | 704 } |
711 | 705 |
712 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 706 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
713 } | 707 } |
714 } | 708 } |
715 | 709 |
716 } // namespace content | 710 } // namespace content |
OLD | NEW |