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

Side by Side Diff: content/browser/loader/resource_loader.cc

Issue 1467563002: Use ResourceRequestInfo::GetWebContents in DownloadRequestLimiter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-contents-callback
Patch Set: Addressed Asanka's comments Created 5 years 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/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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SSLManager::OnSSLCertificateError( 315 SSLManager::OnSSLCertificateError(
316 weak_ptr_factory_.GetWeakPtr(), info->GetResourceType(), request_->url(), 316 weak_ptr_factory_.GetWeakPtr(), info->GetResourceType(), request_->url(),
317 info->GetWebContentsForRequest(), ssl_info, fatal); 317 info->GetWebContentsGetterForRequest(), ssl_info, fatal);
318 } 318 }
319 319
320 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused, 320 void ResourceLoader::OnBeforeNetworkStart(net::URLRequest* unused,
321 bool* defer) { 321 bool* defer) {
322 DCHECK_EQ(request_.get(), unused); 322 DCHECK_EQ(request_.get(), unused);
323 323
324 // 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.
325 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) { 325 if (!handler_->OnBeforeNetworkStart(request_->url(), defer)) {
326 Cancel(); 326 Cancel();
327 return; 327 return;
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 case net::URLRequestStatus::FAILED: 705 case net::URLRequestStatus::FAILED:
706 status = STATUS_UNDEFINED; 706 status = STATUS_UNDEFINED;
707 break; 707 break;
708 } 708 }
709 709
710 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); 710 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX);
711 } 711 }
712 } 712 }
713 713
714 } // namespace content 714 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698