OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
| 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/time.h" |
| 10 #include "googleurl/src/gurl.h" |
| 11 |
| 12 namespace content { |
| 13 class WebContents; |
| 14 } |
| 15 |
| 16 namespace predictors { |
| 17 |
| 18 // Represents a single navigation for a render view. |
| 19 struct NavigationID { |
| 20 // TODO(shishir): Maybe take process_id, view_id and url as input in |
| 21 // constructor. |
| 22 NavigationID(); |
| 23 NavigationID(const NavigationID& other); |
| 24 explicit NavigationID(const content::WebContents& web_contents); |
| 25 bool operator<(const NavigationID& rhs) const; |
| 26 bool operator==(const NavigationID& rhs) const; |
| 27 |
| 28 bool IsSameRenderer(const NavigationID& other) const; |
| 29 |
| 30 // Returns true iff the render_process_id_, render_view_id_ and |
| 31 // main_frame_url_ has been set correctly. |
| 32 bool is_valid() const; |
| 33 |
| 34 int render_process_id; |
| 35 int render_view_id; |
| 36 GURL main_frame_url; |
| 37 |
| 38 // NOTE: Even though we store the creation time here, it is not used during |
| 39 // comparison of two NavigationIDs because it cannot always be determined |
| 40 // correctly. |
| 41 base::TimeTicks creation_time; |
| 42 }; |
| 43 |
| 44 } // namespace predictors |
| 45 |
| 46 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ |
OLD | NEW |