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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 "423948 ResourceLoader::OnReadCompleted4")); | 472 "423948 ResourceLoader::OnReadCompleted4")); |
473 | 473 |
474 // URLRequest reported an EOF. Call ResponseCompleted. | 474 // URLRequest reported an EOF. Call ResponseCompleted. |
475 DCHECK_EQ(0, bytes_read); | 475 DCHECK_EQ(0, bytes_read); |
476 ResponseCompleted(); | 476 ResponseCompleted(); |
477 } | 477 } |
478 } | 478 } |
479 | 479 |
480 void ResourceLoader::CancelSSLRequest(int error, | 480 void ResourceLoader::CancelSSLRequest(int error, |
481 const net::SSLInfo* ssl_info) { | 481 const net::SSLInfo* ssl_info) { |
482 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 482 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
483 | 483 |
484 // The request can be NULL if it was cancelled by the renderer (as the | 484 // The request can be NULL if it was cancelled by the renderer (as the |
485 // request of the user navigating to a new page from the location bar). | 485 // request of the user navigating to a new page from the location bar). |
486 if (!request_->is_pending()) | 486 if (!request_->is_pending()) |
487 return; | 487 return; |
488 DVLOG(1) << "CancelSSLRequest() url: " << request_->url().spec(); | 488 DVLOG(1) << "CancelSSLRequest() url: " << request_->url().spec(); |
489 | 489 |
490 if (ssl_info) { | 490 if (ssl_info) { |
491 request_->CancelWithSSLError(error, *ssl_info); | 491 request_->CancelWithSSLError(error, *ssl_info); |
492 } else { | 492 } else { |
493 request_->CancelWithError(error); | 493 request_->CancelWithError(error); |
494 } | 494 } |
495 } | 495 } |
496 | 496 |
497 void ResourceLoader::ContinueSSLRequest() { | 497 void ResourceLoader::ContinueSSLRequest() { |
498 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 498 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
499 | 499 |
500 DVLOG(1) << "ContinueSSLRequest() url: " << request_->url().spec(); | 500 DVLOG(1) << "ContinueSSLRequest() url: " << request_->url().spec(); |
501 | 501 |
502 request_->ContinueDespiteLastError(); | 502 request_->ContinueDespiteLastError(); |
503 } | 503 } |
504 | 504 |
505 void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) { | 505 void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) { |
506 DCHECK(ssl_client_auth_handler_); | 506 DCHECK(ssl_client_auth_handler_); |
507 ssl_client_auth_handler_.reset(); | 507 ssl_client_auth_handler_.reset(); |
508 request_->ContinueWithCertificate(cert); | 508 request_->ContinueWithCertificate(cert); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 case net::URLRequestStatus::FAILED: | 856 case net::URLRequestStatus::FAILED: |
857 status = STATUS_UNDEFINED; | 857 status = STATUS_UNDEFINED; |
858 break; | 858 break; |
859 } | 859 } |
860 | 860 |
861 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 861 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
862 } | 862 } |
863 } | 863 } |
864 | 864 |
865 } // namespace content | 865 } // namespace content |
OLD | NEW |