| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Starts initialization, will complete asynchronously. | 51 // Starts initialization, will complete asynchronously. |
| 52 void StartInitialization(); | 52 void StartInitialization(); |
| 53 | 53 |
| 54 // Don't use, internal only. | 54 // Don't use, internal only. |
| 55 ResourcePrefetchPredictor* resource_prefetch_predictor(); | 55 ResourcePrefetchPredictor* resource_prefetch_predictor(); |
| 56 LoadingDataCollector* loading_data_collector(); | 56 LoadingDataCollector* loading_data_collector(); |
| 57 | 57 |
| 58 // KeyedService: | 58 // KeyedService: |
| 59 void Shutdown() override; | 59 void Shutdown() override; |
| 60 | 60 |
| 61 void OnMainFrameRequest( | 61 void OnMainFrameRequest(const URLRequestSummary& summary); |
| 62 const ResourcePrefetchPredictor::URLRequestSummary& summary); | 62 void OnMainFrameRedirect(const URLRequestSummary& summary); |
| 63 void OnMainFrameRedirect( | 63 void OnMainFrameResponse(const URLRequestSummary& summary); |
| 64 const ResourcePrefetchPredictor::URLRequestSummary& summary); | |
| 65 void OnMainFrameResponse( | |
| 66 const ResourcePrefetchPredictor::URLRequestSummary& summary); | |
| 67 | 64 |
| 68 base::WeakPtr<LoadingPredictor> GetWeakPtr() { | 65 base::WeakPtr<LoadingPredictor> GetWeakPtr() { |
| 69 return weak_factory_.GetWeakPtr(); | 66 return weak_factory_.GetWeakPtr(); |
| 70 } | 67 } |
| 71 | 68 |
| 72 private: | 69 private: |
| 73 // Cancels an active hint, from its iterator inside |active_hints_|. If the | 70 // Cancels an active hint, from its iterator inside |active_hints_|. If the |
| 74 // iterator is .end(), does nothing. Returns the iterator after deletion of | 71 // iterator is .end(), does nothing. Returns the iterator after deletion of |
| 75 // the entry. | 72 // the entry. |
| 76 std::map<GURL, base::TimeTicks>::iterator CancelActiveHint( | 73 std::map<GURL, base::TimeTicks>::iterator CancelActiveHint( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 105 TestDontTrackNonPrefetchableUrls); | 102 TestDontTrackNonPrefetchableUrls); |
| 106 | 103 |
| 107 base::WeakPtrFactory<LoadingPredictor> weak_factory_; | 104 base::WeakPtrFactory<LoadingPredictor> weak_factory_; |
| 108 | 105 |
| 109 DISALLOW_COPY_AND_ASSIGN(LoadingPredictor); | 106 DISALLOW_COPY_AND_ASSIGN(LoadingPredictor); |
| 110 }; | 107 }; |
| 111 | 108 |
| 112 } // namespace predictors | 109 } // namespace predictors |
| 113 | 110 |
| 114 #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ | 111 #endif // CHROME_BROWSER_PREDICTORS_LOADING_PREDICTOR_H_ |
| OLD | NEW |