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 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // Only for responses. | 100 // Only for responses. |
101 std::string mime_type; | 101 std::string mime_type; |
102 bool was_cached; | 102 bool was_cached; |
103 }; | 103 }; |
104 | 104 |
105 ResourcePrefetchPredictor(const Config& config, Profile* profile); | 105 ResourcePrefetchPredictor(const Config& config, Profile* profile); |
106 virtual ~ResourcePrefetchPredictor(); | 106 virtual ~ResourcePrefetchPredictor(); |
107 | 107 |
108 // Thread safe. | 108 // Thread safe. |
109 static bool IsEnabled(); | 109 static bool IsEnabled(Profile* profile); |
110 static bool ShouldRecordRequest(net::URLRequest* request, | 110 static bool ShouldRecordRequest(net::URLRequest* request, |
111 ResourceType::Type resource_type); | 111 ResourceType::Type resource_type); |
112 static bool ShouldRecordResponse(net::URLRequest* response); | 112 static bool ShouldRecordResponse(net::URLRequest* response); |
113 static bool ShouldRecordRedirect(net::URLRequest* response); | 113 static bool ShouldRecordRedirect(net::URLRequest* response); |
114 | 114 |
115 static ResourceType::Type GetResourceTypeFromMimeType( | 115 static ResourceType::Type GetResourceTypeFromMimeType( |
116 const std::string& mime_type, | 116 const std::string& mime_type, |
117 ResourceType::Type fallback); | 117 ResourceType::Type fallback); |
118 | 118 |
119 void RecordURLRequest(const URLRequestSummary& request); | 119 void RecordURLRequest(const URLRequestSummary& request); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 NavigationMap inflight_navigations_; | 209 NavigationMap inflight_navigations_; |
210 UrlTableCacheMap url_table_cache_; | 210 UrlTableCacheMap url_table_cache_; |
211 | 211 |
212 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); | 212 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); |
213 }; | 213 }; |
214 | 214 |
215 } // namespace predictors | 215 } // namespace predictors |
216 | 216 |
217 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 217 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
OLD | NEW |