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_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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "chrome/browser/sessions/session_tab_helper.h" | |
12 #include "components/sessions/core/session_id.h" | |
11 #include "url/gurl.h" | 13 #include "url/gurl.h" |
12 | 14 |
13 class Profile; | 15 class Profile; |
14 | 16 |
15 namespace content { | 17 namespace content { |
16 class WebContents; | 18 class WebContents; |
17 } | 19 } |
18 | 20 |
19 namespace predictors { | 21 namespace predictors { |
20 | 22 |
(...skipping 15 matching lines...) Expand all Loading... | |
36 enum class PrefetchOrigin { NAVIGATION, EXTERNAL }; | 38 enum class PrefetchOrigin { NAVIGATION, EXTERNAL }; |
37 | 39 |
38 // Represents a single navigation for a render frame. | 40 // Represents a single navigation for a render frame. |
39 struct NavigationID { | 41 struct NavigationID { |
40 NavigationID(); | 42 NavigationID(); |
41 explicit NavigationID(content::WebContents* web_contents); | 43 explicit NavigationID(content::WebContents* web_contents); |
42 NavigationID(content::WebContents* web_contents, | 44 NavigationID(content::WebContents* web_contents, |
43 const GURL& main_frame_url, | 45 const GURL& main_frame_url, |
44 const base::TimeTicks& creation_time); | 46 const base::TimeTicks& creation_time); |
45 NavigationID(const NavigationID& other); | 47 NavigationID(const NavigationID& other); |
48 | |
46 bool operator<(const NavigationID& rhs) const; | 49 bool operator<(const NavigationID& rhs) const; |
47 bool operator==(const NavigationID& rhs) const; | 50 bool operator==(const NavigationID& rhs) const; |
48 | 51 bool IsSameLocation(const NavigationID& other) const; |
ahemery
2016/12/19 14:53:41
Simple renaming to be more accurate with the new i
| |
49 bool IsSameRenderer(const NavigationID& other) const; | |
50 | 52 |
51 // Returns true iff the render_process_id_, render_frame_id_ and | 53 // Returns true iff the render_process_id_, render_frame_id_ and |
52 // frame_url_ has been set correctly. | 54 // frame_url_ has been set correctly. |
53 bool is_valid() const; | 55 bool is_valid() const; |
54 | 56 |
55 int render_process_id; | 57 SessionID session_id; |
56 int render_frame_id; | 58 int frame_tree_node_id; |
57 GURL main_frame_url; | 59 GURL main_frame_url; |
58 | 60 |
59 // NOTE: Even though we store the creation time here, it is not used during | 61 // NOTE: Even though we store the creation time here, it is not used during |
60 // comparison of two NavigationIDs because it cannot always be determined | 62 // comparison of two NavigationIDs because it cannot always be determined |
61 // correctly. | 63 // correctly. |
62 base::TimeTicks creation_time; | 64 base::TimeTicks creation_time; |
63 }; | 65 }; |
64 | 66 |
65 // Represents the config for the resource prefetch prediction algorithm. | 67 // Represents the config for the resource prefetch prediction algorithm. |
66 struct ResourcePrefetchPredictorConfig { | 68 struct ResourcePrefetchPredictorConfig { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 // Maximum number of prefetches that can be inflight for a single navigation. | 117 // Maximum number of prefetches that can be inflight for a single navigation. |
116 size_t max_prefetches_inflight_per_navigation; | 118 size_t max_prefetches_inflight_per_navigation; |
117 // Maximum number of prefetches that can be inflight for a host for a single | 119 // Maximum number of prefetches that can be inflight for a host for a single |
118 // navigation. | 120 // navigation. |
119 size_t max_prefetches_inflight_per_host_per_navigation; | 121 size_t max_prefetches_inflight_per_host_per_navigation; |
120 }; | 122 }; |
121 | 123 |
122 } // namespace predictors | 124 } // namespace predictors |
123 | 125 |
124 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ | 126 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
OLD | NEW |