| 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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/predictors/resource_prefetcher.h" | 8 #include "chrome/browser/predictors/resource_prefetcher.h" |
| 9 #include "chrome/browser/predictors/resource_prefetcher_manager.h" | 9 #include "chrome/browser/predictors/resource_prefetcher_manager.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 it != prefetcher_->inflight_requests_.end(); ++it) { | 104 it != prefetcher_->inflight_requests_.end(); ++it) { |
| 105 if (it->first->original_url() == url) | 105 if (it->first->original_url() == url) |
| 106 return it->first; | 106 return it->first; |
| 107 } | 107 } |
| 108 EXPECT_TRUE(false) << "Infligh request not found: " << url_str; | 108 EXPECT_TRUE(false) << "Infligh request not found: " << url_str; |
| 109 return NULL; | 109 return NULL; |
| 110 } | 110 } |
| 111 | 111 |
| 112 | 112 |
| 113 void OnReceivedRedirect(const std::string& url) { | 113 void OnReceivedRedirect(const std::string& url) { |
| 114 prefetcher_->OnReceivedRedirect(GetInFlightRequest(url), GURL(""), NULL); | 114 prefetcher_->OnReceivedRedirect( |
| 115 GetInFlightRequest(url), GURL(std::string()), NULL); |
| 115 } | 116 } |
| 116 void OnAuthRequired(const std::string& url) { | 117 void OnAuthRequired(const std::string& url) { |
| 117 prefetcher_->OnAuthRequired(GetInFlightRequest(url), NULL); | 118 prefetcher_->OnAuthRequired(GetInFlightRequest(url), NULL); |
| 118 } | 119 } |
| 119 void OnCertificateRequested(const std::string& url) { | 120 void OnCertificateRequested(const std::string& url) { |
| 120 prefetcher_->OnCertificateRequested(GetInFlightRequest(url), NULL); | 121 prefetcher_->OnCertificateRequested(GetInFlightRequest(url), NULL); |
| 121 } | 122 } |
| 122 void OnSSLCertificateError(const std::string& url) { | 123 void OnSSLCertificateError(const std::string& url) { |
| 123 prefetcher_->OnSSLCertificateError(GetInFlightRequest(url), | 124 prefetcher_->OnSSLCertificateError(GetInFlightRequest(url), |
| 124 net::SSLInfo(), false); | 125 net::SSLInfo(), false); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 ResourcePrefetcherFinished(Eq(prefetcher_.get()), | 337 ResourcePrefetcherFinished(Eq(prefetcher_.get()), |
| 337 Eq(requests_ptr))); | 338 Eq(requests_ptr))); |
| 338 | 339 |
| 339 OnResponse("http://m.google.com/resource1.jpg"); | 340 OnResponse("http://m.google.com/resource1.jpg"); |
| 340 CheckPrefetcherState(0, 1, 0); | 341 CheckPrefetcherState(0, 1, 0); |
| 341 | 342 |
| 342 delete requests_ptr; | 343 delete requests_ptr; |
| 343 } | 344 } |
| 344 | 345 |
| 345 } // namespace predictors | 346 } // namespace predictors |
| OLD | NEW |