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 #include "chrome/browser/predictors/resource_prefetch_common.h" | 5 #include "chrome/browser/predictors/resource_prefetch_common.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <tuple> | 8 #include <tuple> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 return true; | 149 return true; |
150 } | 150 } |
151 | 151 |
152 NavigationID::NavigationID() | 152 NavigationID::NavigationID() |
153 : render_process_id(-1), | 153 : render_process_id(-1), |
154 render_frame_id(-1) { | 154 render_frame_id(-1) { |
155 } | 155 } |
156 | 156 |
| 157 NavigationID::NavigationID(int render_process_id, |
| 158 int render_frame_id, |
| 159 const GURL& main_frame_url) |
| 160 : render_process_id(render_process_id), |
| 161 render_frame_id(render_frame_id), |
| 162 main_frame_url(main_frame_url) {} |
| 163 |
157 NavigationID::NavigationID(const NavigationID& other) | 164 NavigationID::NavigationID(const NavigationID& other) |
158 : render_process_id(other.render_process_id), | 165 : render_process_id(other.render_process_id), |
159 render_frame_id(other.render_frame_id), | 166 render_frame_id(other.render_frame_id), |
160 main_frame_url(other.main_frame_url), | 167 main_frame_url(other.main_frame_url), |
161 creation_time(other.creation_time) { | 168 creation_time(other.creation_time) { |
162 } | 169 } |
163 | 170 |
164 NavigationID::NavigationID(content::WebContents* web_contents) | 171 NavigationID::NavigationID(content::WebContents* web_contents) |
165 : render_process_id(web_contents->GetRenderProcessHost()->GetID()), | 172 : render_process_id(web_contents->GetRenderProcessHost()->GetID()), |
166 render_frame_id(web_contents->GetMainFrame()->GetRoutingID()), | 173 render_frame_id(web_contents->GetMainFrame()->GetRoutingID()), |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 269 |
263 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { | 270 bool ResourcePrefetchPredictorConfig::IsMoreResourcesEnabledForTest() const { |
264 return max_resources_per_entry == 100; | 271 return max_resources_per_entry == 100; |
265 } | 272 } |
266 | 273 |
267 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { | 274 bool ResourcePrefetchPredictorConfig::IsSmallDBEnabledForTest() const { |
268 return max_urls_to_track == 200 && max_hosts_to_track == 100; | 275 return max_urls_to_track == 200 && max_hosts_to_track == 100; |
269 } | 276 } |
270 | 277 |
271 } // namespace predictors | 278 } // namespace predictors |
OLD | NEW |