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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_predictor_unittest.cc

Issue 2783343002: Remove URLRequestJobFactory::IsHandledURL. (Closed)
Patch Set: More fixes..... Created 3 years, 8 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/predictors/resource_prefetch_predictor.h" 5 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 net::URLRequestJob* MaybeInterceptResponse( 102 net::URLRequestJob* MaybeInterceptResponse(
103 net::URLRequest* request, 103 net::URLRequest* request,
104 net::NetworkDelegate* network_delegate) const override { 104 net::NetworkDelegate* network_delegate) const override {
105 return nullptr; 105 return nullptr;
106 } 106 }
107 107
108 bool IsHandledProtocol(const std::string& scheme) const override { 108 bool IsHandledProtocol(const std::string& scheme) const override {
109 return true; 109 return true;
110 } 110 }
111 111
112 bool IsHandledURL(const GURL& url) const override { return true; }
113
114 bool IsSafeRedirectTarget(const GURL& location) const override { 112 bool IsSafeRedirectTarget(const GURL& location) const override {
115 return true; 113 return true;
116 } 114 }
117 115
118 void set_response_info(const net::HttpResponseInfo& response_info) { 116 void set_response_info(const net::HttpResponseInfo& response_info) {
119 response_info_ = response_info; 117 response_info_ = response_info;
120 } 118 }
121 119
122 void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; } 120 void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; }
123 121
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 predictor_->host_table_cache_->insert( 1832 predictor_->host_table_cache_->insert(
1835 std::make_pair(google.primary_key(), google)); 1833 std::make_pair(google.primary_key(), google));
1836 1834
1837 predictor_->StartPrefetching(GURL(main_frame_url), PrefetchOrigin::EXTERNAL); 1835 predictor_->StartPrefetching(GURL(main_frame_url), PrefetchOrigin::EXTERNAL);
1838 predictor_->StopPrefetching(GURL(main_frame_url)); 1836 predictor_->StopPrefetching(GURL(main_frame_url));
1839 histogram_tester_->ExpectTotalCount( 1837 histogram_tester_->ExpectTotalCount(
1840 internal::kResourcePrefetchPredictorPrefetchingDurationHistogram, 1); 1838 internal::kResourcePrefetchPredictorPrefetchingDurationHistogram, 1);
1841 } 1839 }
1842 1840
1843 } // namespace predictors 1841 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698