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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 GetRequestInfo()->GetContext()->CreateClientCertStore(), request_.get(), | 305 GetRequestInfo()->GetContext()->CreateClientCertStore(), request_.get(), |
306 cert_info, this)); | 306 cert_info, this)); |
307 ssl_client_auth_handler_->SelectCertificate(); | 307 ssl_client_auth_handler_->SelectCertificate(); |
308 } | 308 } |
309 | 309 |
310 void ResourceLoader::OnSSLCertificateError(net::URLRequest* request, | 310 void ResourceLoader::OnSSLCertificateError(net::URLRequest* request, |
311 const net::SSLInfo& ssl_info, | 311 const net::SSLInfo& ssl_info, |
312 bool fatal) { | 312 bool fatal) { |
313 ResourceRequestInfoImpl* info = GetRequestInfo(); | 313 ResourceRequestInfoImpl* info = GetRequestInfo(); |
314 | 314 |
315 int render_process_id; | |
316 int render_frame_id; | |
317 if (!info->GetAssociatedRenderFrame(&render_process_id, &render_frame_id)) | |
318 NOTREACHED(); | |
319 | |
320 SSLManager::OnSSLCertificateError( | 315 SSLManager::OnSSLCertificateError( |
321 weak_ptr_factory_.GetWeakPtr(), | 316 weak_ptr_factory_.GetWeakPtr(), info->GetResourceType(), request_->url(), |
322 info->GetResourceType(), | 317 info->GetWebContentsForRequest(), ssl_info, fatal); |
323 request_->url(), | |
324 render_process_id, | |
325 render_frame_id, | |
326 ssl_info, | |
327 fatal); | |
328 } | 318 } |
329 | 319 |
330 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused, | 320 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused, |
331 bool* defer) { | 321 bool* defer) { |
332 DCHECK_EQ(request_.get(), unused); | 322 DCHECK_EQ(request_.get(), unused); |
333 | 323 |
334 // Give the handler a chance to delay the URLRequest from using the network. | 324 // Give the handler a chance to delay the URLRequest from using the network. |
335 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) { | 325 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) { |
336 Cancel(); | 326 Cancel(); |
337 return; | 327 return; |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 case net::URLRequestStatus::FAILED: | 705 case net::URLRequestStatus::FAILED: |
716 status = STATUS_UNDEFINED; | 706 status = STATUS_UNDEFINED; |
717 break; | 707 break; |
718 } | 708 } |
719 | 709 |
720 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 710 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
721 } | 711 } |
722 } | 712 } |
723 | 713 |
724 } // namespace content | 714 } // namespace content |
OLD | NEW |