| OLD | NEW |
| 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 #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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 // Returns true if the main page request is supported for prediction. | 177 // Returns true if the main page request is supported for prediction. |
| 178 static bool IsHandledMainPage(net::URLRequest* request); | 178 static bool IsHandledMainPage(net::URLRequest* request); |
| 179 | 179 |
| 180 // Returns true if the subresource request is supported for prediction. | 180 // Returns true if the subresource request is supported for prediction. |
| 181 static bool IsHandledSubresource(net::URLRequest* request); | 181 static bool IsHandledSubresource(net::URLRequest* request); |
| 182 | 182 |
| 183 // Returns true if the request (should have a response in it) is cacheable. | 183 // Returns true if the request (should have a response in it) is cacheable. |
| 184 static bool IsCacheable(const net::URLRequest* request); | 184 static bool IsCacheable(const net::URLRequest* request); |
| 185 | 185 |
| 186 // content::NotificationObserver methods OVERRIDE. | 186 // content::NotificationObserver methods override. |
| 187 virtual void Observe(int type, | 187 virtual void Observe(int type, |
| 188 const content::NotificationSource& source, | 188 const content::NotificationSource& source, |
| 189 const content::NotificationDetails& details) OVERRIDE; | 189 const content::NotificationDetails& details) override; |
| 190 | 190 |
| 191 // KeyedService methods OVERRIDE. | 191 // KeyedService methods override. |
| 192 virtual void Shutdown() OVERRIDE; | 192 virtual void Shutdown() override; |
| 193 | 193 |
| 194 // Functions called on different network events pertaining to the loading of | 194 // Functions called on different network events pertaining to the loading of |
| 195 // main frame resource or sub resources. | 195 // main frame resource or sub resources. |
| 196 void OnMainFrameRequest(const URLRequestSummary& request); | 196 void OnMainFrameRequest(const URLRequestSummary& request); |
| 197 void OnMainFrameResponse(const URLRequestSummary& response); | 197 void OnMainFrameResponse(const URLRequestSummary& response); |
| 198 void OnMainFrameRedirect(const URLRequestSummary& response); | 198 void OnMainFrameRedirect(const URLRequestSummary& response); |
| 199 void OnSubresourceResponse(const URLRequestSummary& response); | 199 void OnSubresourceResponse(const URLRequestSummary& response); |
| 200 | 200 |
| 201 // Called when onload completes for a navigation. We treat this point as the | 201 // Called when onload completes for a navigation. We treat this point as the |
| 202 // "completion" of the navigation. The resources requested by the page upto | 202 // "completion" of the navigation. The resources requested by the page upto |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 ResultsMap results_map_; | 306 ResultsMap results_map_; |
| 307 STLValueDeleter<ResultsMap> results_map_deleter_; | 307 STLValueDeleter<ResultsMap> results_map_deleter_; |
| 308 | 308 |
| 309 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); | 309 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); |
| 310 }; | 310 }; |
| 311 | 311 |
| 312 } // namespace predictors | 312 } // namespace predictors |
| 313 | 313 |
| 314 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 314 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
| OLD | NEW |