OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "content/browser/frame_host/frame_navigation_entry.h" | 11 #include "content/browser/frame_host/frame_navigation_entry.h" |
12 #include "content/browser/site_instance_impl.h" | 12 #include "content/browser/site_instance_impl.h" |
13 #include "content/common/frame_message_enums.h" | 13 #include "content/common/frame_message_enums.h" |
14 #include "content/public/browser/favicon_status.h" | 14 #include "content/public/browser/favicon_status.h" |
15 #include "content/public/browser/global_request_id.h" | 15 #include "content/public/browser/global_request_id.h" |
16 #include "content/public/browser/navigation_entry.h" | 16 #include "content/public/browser/navigation_entry.h" |
17 #include "content/public/common/page_state.h" | 17 #include "content/public/common/page_state.h" |
18 #include "content/public/common/ssl_status.h" | 18 #include "content/public/common/ssl_status.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 class NavigationControllerImpl; | |
22 struct CommitNavigationParams; | 21 struct CommitNavigationParams; |
23 struct CommonNavigationParams; | 22 struct CommonNavigationParams; |
24 struct HistoryNavigationParams; | |
25 struct StartNavigationParams; | 23 struct StartNavigationParams; |
26 | 24 |
27 class CONTENT_EXPORT NavigationEntryImpl | 25 class CONTENT_EXPORT NavigationEntryImpl |
28 : public NON_EXPORTED_BASE(NavigationEntry) { | 26 : public NON_EXPORTED_BASE(NavigationEntry) { |
29 public: | 27 public: |
30 // Represents a tree of FrameNavigationEntries that make up this joint session | 28 // Represents a tree of FrameNavigationEntries that make up this joint session |
31 // history item. The tree currently only tracks the main frame. | 29 // history item. The tree currently only tracks the main frame. |
32 // TODO(creis): Populate the tree with subframe entries in --site-per-process. | 30 // TODO(creis): Populate the tree with subframe entries in --site-per-process. |
33 struct TreeNode { | 31 struct TreeNode { |
34 TreeNode(FrameNavigationEntry* frame_entry); | 32 TreeNode(FrameNavigationEntry* frame_entry); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 115 |
118 // Creates a copy of this NavigationEntryImpl that can be modified | 116 // Creates a copy of this NavigationEntryImpl that can be modified |
119 // independently from the original. Does not copy any value that would be | 117 // independently from the original. Does not copy any value that would be |
120 // cleared in ResetForCommit. | 118 // cleared in ResetForCommit. |
121 // TODO(creis): Once we start sharing FrameNavigationEntries between | 119 // TODO(creis): Once we start sharing FrameNavigationEntries between |
122 // NavigationEntryImpls, we will need to support two versions of Clone: one | 120 // NavigationEntryImpls, we will need to support two versions of Clone: one |
123 // that shares the existing FrameNavigationEntries (for use within the same | 121 // that shares the existing FrameNavigationEntries (for use within the same |
124 // tab) and one that draws them from a different pool (for use in a new tab). | 122 // tab) and one that draws them from a different pool (for use in a new tab). |
125 NavigationEntryImpl* Clone() const; | 123 NavigationEntryImpl* Clone() const; |
126 | 124 |
| 125 // Helper functions to construct NavigationParameters for a navigation to this |
| 126 // NavigationEntry. |
| 127 CommonNavigationParams ConstructCommonNavigationParams( |
| 128 FrameMsg_Navigate_Type::Value navigation_type) const; |
| 129 StartNavigationParams ConstructStartNavigationParams() const; |
| 130 CommitNavigationParams ConstructCommitNavigationParams( |
| 131 base::TimeTicks navigation_start, |
| 132 int pending_offset_to_send, |
| 133 int current_offset_to_send, |
| 134 int current_length_to_send) const; |
| 135 |
127 // Once a navigation entry is committed, we should no longer track several | 136 // Once a navigation entry is committed, we should no longer track several |
128 // pieces of non-persisted state, as documented on the members below. | 137 // pieces of non-persisted state, as documented on the members below. |
129 void ResetForCommit(); | 138 void ResetForCommit(); |
130 | 139 |
131 void set_unique_id(int unique_id) { | 140 void set_unique_id(int unique_id) { |
132 unique_id_ = unique_id; | 141 unique_id_ = unique_id; |
133 } | 142 } |
134 | 143 |
135 // The SiteInstance represents which pages must share processes. This is a | 144 // The SiteInstance represents which pages must share processes. This is a |
136 // reference counted pointer to a shared SiteInstance. | 145 // reference counted pointer to a shared SiteInstance. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 int64 frame_tree_node_id() const { | 264 int64 frame_tree_node_id() const { |
256 return frame_tree_node_id_; | 265 return frame_tree_node_id_; |
257 } | 266 } |
258 void set_frame_tree_node_id(int64 frame_tree_node_id) { | 267 void set_frame_tree_node_id(int64 frame_tree_node_id) { |
259 frame_tree_node_id_ = frame_tree_node_id; | 268 frame_tree_node_id_ = frame_tree_node_id; |
260 } | 269 } |
261 | 270 |
262 // Returns the history URL for a data URL to use in Blink. | 271 // Returns the history URL for a data URL to use in Blink. |
263 GURL GetHistoryURLForDataURL() const; | 272 GURL GetHistoryURLForDataURL() const; |
264 | 273 |
265 CommonNavigationParams ConstructCommonNavigationParams( | |
266 FrameMsg_Navigate_Type::Value navigation_type) const; | |
267 CommitNavigationParams ConstructCommitNavigationParams( | |
268 base::TimeTicks navigation_start) const; | |
269 HistoryNavigationParams ConstructHistoryNavigationParams( | |
270 NavigationControllerImpl* controller) const; | |
271 StartNavigationParams ConstructStartNavigationParams() const; | |
272 | |
273 #if defined(OS_ANDROID) | 274 #if defined(OS_ANDROID) |
274 base::TimeTicks intent_received_timestamp() const { | 275 base::TimeTicks intent_received_timestamp() const { |
275 return intent_received_timestamp_; | 276 return intent_received_timestamp_; |
276 } | 277 } |
277 | 278 |
278 void set_intent_received_timestamp( | 279 void set_intent_received_timestamp( |
279 const base::TimeTicks intent_received_timestamp) { | 280 const base::TimeTicks intent_received_timestamp) { |
280 intent_received_timestamp_ = intent_received_timestamp; | 281 intent_received_timestamp_ = intent_received_timestamp; |
281 } | 282 } |
282 #endif | 283 #endif |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // persisted, unless specific data is taken out/put back in at save/restore | 414 // persisted, unless specific data is taken out/put back in at save/restore |
414 // time (see TabNavigation for an example of this). | 415 // time (see TabNavigation for an example of this). |
415 std::map<std::string, base::string16> extra_data_; | 416 std::map<std::string, base::string16> extra_data_; |
416 | 417 |
417 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); | 418 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
418 }; | 419 }; |
419 | 420 |
420 } // namespace content | 421 } // namespace content |
421 | 422 |
422 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 423 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
OLD | NEW |