| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 // Returns true if the request (should have a response in it) is "no-store". | 284 // Returns true if the request (should have a response in it) is "no-store". |
| 285 static bool IsNoStore(const net::URLRequest* request); | 285 static bool IsNoStore(const net::URLRequest* request); |
| 286 | 286 |
| 287 // Returns true iff |redirect_data_map| contains confident redirect endpoint | 287 // Returns true iff |redirect_data_map| contains confident redirect endpoint |
| 288 // for |entry_point| and assigns it to the |redirect_endpoint|. | 288 // for |entry_point| and assigns it to the |redirect_endpoint|. |
| 289 static bool GetRedirectEndpoint(const std::string& entry_point, | 289 static bool GetRedirectEndpoint(const std::string& entry_point, |
| 290 const RedirectDataMap& redirect_data_map, | 290 const RedirectDataMap& redirect_data_map, |
| 291 std::string* redirect_endpoint); | 291 std::string* redirect_endpoint); |
| 292 | 292 |
| 293 static void SetAllowPortInUrlsForTesting(bool state); |
| 294 |
| 293 // KeyedService methods override. | 295 // KeyedService methods override. |
| 294 void Shutdown() override; | 296 void Shutdown() override; |
| 295 | 297 |
| 296 // Functions called on different network events pertaining to the loading of | 298 // Functions called on different network events pertaining to the loading of |
| 297 // main frame resource or sub resources. | 299 // main frame resource or sub resources. |
| 298 void OnMainFrameRequest(const URLRequestSummary& request); | 300 void OnMainFrameRequest(const URLRequestSummary& request); |
| 299 void OnMainFrameResponse(const URLRequestSummary& response); | 301 void OnMainFrameResponse(const URLRequestSummary& response); |
| 300 void OnMainFrameRedirect(const URLRequestSummary& response); | 302 void OnMainFrameRedirect(const URLRequestSummary& response); |
| 301 void OnSubresourceResponse(const URLRequestSummary& response); | 303 void OnSubresourceResponse(const URLRequestSummary& response); |
| 302 | 304 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 453 |
| 452 private: | 454 private: |
| 453 ResourcePrefetchPredictor* predictor_; | 455 ResourcePrefetchPredictor* predictor_; |
| 454 | 456 |
| 455 DISALLOW_COPY_AND_ASSIGN(TestObserver); | 457 DISALLOW_COPY_AND_ASSIGN(TestObserver); |
| 456 }; | 458 }; |
| 457 | 459 |
| 458 } // namespace predictors | 460 } // namespace predictors |
| 459 | 461 |
| 460 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 462 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
| OLD | NEW |