| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Contains logic for learning what can be prefetched and for kicking off | 44 // Contains logic for learning what can be prefetched and for kicking off |
| 45 // speculative prefetching. | 45 // speculative prefetching. |
| 46 // - The class is a profile keyed service owned by the profile. | 46 // - The class is a profile keyed service owned by the profile. |
| 47 // - All the non-static methods of this class need to be called on the UI | 47 // - All the non-static methods of this class need to be called on the UI |
| 48 // thread. | 48 // thread. |
| 49 // | 49 // |
| 50 // The overall flow of the resource prefetching algorithm is as follows: | 50 // The overall flow of the resource prefetching algorithm is as follows: |
| 51 // | 51 // |
| 52 // * ResourcePrefetchPredictorObserver - Listens for URL requests, responses and | 52 // * ResourcePrefetchPredictorObserver - Listens for URL requests, responses and |
| 53 // redirects on the IO thread (via ResourceDispatcherHostDelegate) and posts | 53 // redirects (client-side redirects are not supported) on the IO thread (via |
| 54 // tasks to the ResourcePrefetchPredictor on the UI thread. This is owned by | 54 // ResourceDispatcherHostDelegate) and posts tasks to the |
| 55 // the ProfileIOData for the profile. | 55 // ResourcePrefetchPredictor on the UI thread. This is owned by the |
| 56 // ProfileIOData for the profile. |
| 56 // * ResourcePrefetchPredictorTables - Persists ResourcePrefetchPredictor data | 57 // * ResourcePrefetchPredictorTables - Persists ResourcePrefetchPredictor data |
| 57 // to a sql database. Runs entirely on the DB thread. Owned by the | 58 // to a sql database. Runs entirely on the DB thread. Owned by the |
| 58 // PredictorDatabase. | 59 // PredictorDatabase. |
| 59 // * ResourcePrefetchPredictor - Learns about resource requirements per URL in | 60 // * ResourcePrefetchPredictor - Learns about resource requirements per URL in |
| 60 // the UI thread through the ResourcePrefetchPredictorObserver and persists | 61 // the UI thread through the ResourcePrefetchPredictorObserver and persists |
| 61 // it to disk in the DB thread through the ResourcePrefetchPredictorTables. It | 62 // it to disk in the DB thread through the ResourcePrefetchPredictorTables. It |
| 62 // initiates resource prefetching using the ResourcePrefetcherManager. Owned | 63 // initiates resource prefetching using the ResourcePrefetcherManager. Owned |
| 63 // by profile. | 64 // by profile. |
| 64 // * ResourcePrefetcherManager - Manages the ResourcePrefetchers that do the | 65 // * ResourcePrefetcherManager - Manages the ResourcePrefetchers that do the |
| 65 // prefetching on the IO thread. The manager is owned by the | 66 // prefetching on the IO thread. The manager is owned by the |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 383 |
| 383 private: | 384 private: |
| 384 ResourcePrefetchPredictor* predictor_; | 385 ResourcePrefetchPredictor* predictor_; |
| 385 | 386 |
| 386 DISALLOW_COPY_AND_ASSIGN(TestObserver); | 387 DISALLOW_COPY_AND_ASSIGN(TestObserver); |
| 387 }; | 388 }; |
| 388 | 389 |
| 389 } // namespace predictors | 390 } // namespace predictors |
| 390 | 391 |
| 391 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 392 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
| OLD | NEW |