| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_LOADING_PREDICTOR_H_ | 5 #ifndef CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ |
| 6 #define CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ | 6 #define CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Starts initialization, will complete asynchronously. | 52 // Starts initialization, will complete asynchronously. |
| 53 void StartInitialization(); | 53 void StartInitialization(); |
| 54 | 54 |
| 55 // Don't use, internal only. | 55 // Don't use, internal only. |
| 56 ResourcePrefetchPredictor* resource_prefetch_predictor(); | 56 ResourcePrefetchPredictor* resource_prefetch_predictor(); |
| 57 LoadingDataCollector* loading_data_collector(); | 57 LoadingDataCollector* loading_data_collector(); |
| 58 | 58 |
| 59 // KeyedService: | 59 // KeyedService: |
| 60 void Shutdown() override; | 60 void Shutdown() override; |
| 61 | 61 |
| 62 void OnMainFrameRequest( | 62 void OnMainFrameRequest(const URLRequestSummary& summary); |
| 63 const ResourcePrefetchPredictor::URLRequestSummary& summary); | 63 void OnMainFrameRedirect(const URLRequestSummary& summary); |
| 64 void OnMainFrameRedirect( | 64 void OnMainFrameResponse(const URLRequestSummary& summary); |
| 65 const ResourcePrefetchPredictor::URLRequestSummary& summary); | |
| 66 void OnMainFrameResponse( | |
| 67 const ResourcePrefetchPredictor::URLRequestSummary& summary); | |
| 68 | 65 |
| 69 private: | 66 private: |
| 70 // Cancels an active hint, from its iterator inside |active_hints_|. If the | 67 // Cancels an active hint, from its iterator inside |active_hints_|. If the |
| 71 // iterator is .end(), does nothing. Returns the iterator after deletion of | 68 // iterator is .end(), does nothing. Returns the iterator after deletion of |
| 72 // the entry. | 69 // the entry. |
| 73 std::map<GURL, base::TimeTicks>::iterator CancelActiveHint( | 70 std::map<GURL, base::TimeTicks>::iterator CancelActiveHint( |
| 74 std::map<GURL, base::TimeTicks>::iterator hint_it); | 71 std::map<GURL, base::TimeTicks>::iterator hint_it); |
| 75 void CleanupAbandonedHintsAndNavigations(const NavigationID& navigation_id); | 72 void CleanupAbandonedHintsAndNavigations(const NavigationID& navigation_id); |
| 76 | 73 |
| 77 // For testing. | 74 // For testing. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 100 TestMainFrameRequestDoesntCancelExternalHint); | 97 TestMainFrameRequestDoesntCancelExternalHint); |
| 101 FRIEND_TEST_ALL_PREFIXES(LoadingPredictorTest, | 98 FRIEND_TEST_ALL_PREFIXES(LoadingPredictorTest, |
| 102 TestDontTrackNonPrefetchableUrls); | 99 TestDontTrackNonPrefetchableUrls); |
| 103 | 100 |
| 104 DISALLOW_COPY_AND_ASSIGN(LoadingPredictor); | 101 DISALLOW_COPY_AND_ASSIGN(LoadingPredictor); |
| 105 }; | 102 }; |
| 106 | 103 |
| 107 } // namespace predictors | 104 } // namespace predictors |
| 108 | 105 |
| 109 #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ | 106 #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ |
| OLD | NEW |