OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMMON_H_ | 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
7 | 7 |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 int render_process_id; | 33 int render_process_id; |
34 int render_view_id; | 34 int render_view_id; |
35 GURL main_frame_url; | 35 GURL main_frame_url; |
36 | 36 |
37 // NOTE: Even though we store the creation time here, it is not used during | 37 // NOTE: Even though we store the creation time here, it is not used during |
38 // comparison of two NavigationIDs because it cannot always be determined | 38 // comparison of two NavigationIDs because it cannot always be determined |
39 // correctly. | 39 // correctly. |
40 base::TimeTicks creation_time; | 40 base::TimeTicks creation_time; |
41 }; | 41 }; |
42 | 42 |
| 43 // Represents the config for the resource prefetch prediction algorithm. It is |
| 44 // useful for running experiments. |
| 45 struct ResourcePrefetchPredictorConfig { |
| 46 // Initializes the config with default values. |
| 47 ResourcePrefetchPredictorConfig(); |
| 48 |
| 49 // If a navigation hasn't seen a load complete event in this much time, it |
| 50 // is considered abandoned. |
| 51 int max_navigation_lifetime_seconds; |
| 52 // Size of LRU caches for the URL data. |
| 53 int max_urls_to_track; |
| 54 // The number of times, we should have seen a visit to this URL in history |
| 55 // to start tracking it. This is to ensure we dont bother with oneoff |
| 56 // entries. |
| 57 int min_url_visit_count; |
| 58 // The maximum number of resources to store per entry. |
| 59 int max_resources_per_entry; |
| 60 // The number of consecutive misses after we stop tracking a resource URL. |
| 61 int max_consecutive_misses; |
| 62 |
| 63 // The minimum confidence (accuracy of hits) required for a resource to be |
| 64 // prefetched. |
| 65 float min_resource_confidence_to_trigger_prefetch; |
| 66 // The minimum number of times we must have a URL on record to prefetch it. |
| 67 int min_resource_hits_to_trigger_prefetch; |
| 68 |
| 69 // Maximum number of prefetches that can be inflight for a single navigation. |
| 70 int max_prefetches_inflight_per_navigation; |
| 71 // Maximum number of prefetches that can be inflight for a host for a single |
| 72 // navigation. |
| 73 int max_prefetches_inflight_per_host_per_navigation; |
| 74 }; |
| 75 |
43 } // namespace predictors | 76 } // namespace predictors |
44 | 77 |
45 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 78 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
OLD | NEW |