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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <set> |
| 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
13 #include "base/time/time.h" | 15 #include "base/time/time.h" |
14 #include "build/build_config.h" | 16 #include "build/build_config.h" |
15 #include "content/browser/frame_host/frame_navigation_entry.h" | 17 #include "content/browser/frame_host/frame_navigation_entry.h" |
16 #include "content/browser/frame_host/frame_tree_node.h" | 18 #include "content/browser/frame_host/frame_tree_node.h" |
17 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
18 #include "content/common/frame_message_enums.h" | 20 #include "content/common/frame_message_enums.h" |
19 #include "content/common/resource_request_body_impl.h" | 21 #include "content/common/resource_request_body_impl.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 const GURL& dest_url, | 180 const GURL& dest_url, |
179 const Referrer& dest_referrer, | 181 const Referrer& dest_referrer, |
180 FrameMsg_Navigate_Type::Value navigation_type, | 182 FrameMsg_Navigate_Type::Value navigation_type, |
181 LoFiState lofi_state, | 183 LoFiState lofi_state, |
182 const base::TimeTicks& navigation_start) const; | 184 const base::TimeTicks& navigation_start) const; |
183 StartNavigationParams ConstructStartNavigationParams() const; | 185 StartNavigationParams ConstructStartNavigationParams() const; |
184 RequestNavigationParams ConstructRequestNavigationParams( | 186 RequestNavigationParams ConstructRequestNavigationParams( |
185 const FrameNavigationEntry& frame_entry, | 187 const FrameNavigationEntry& frame_entry, |
186 bool is_same_document_history_load, | 188 bool is_same_document_history_load, |
187 bool is_history_navigation_in_new_child, | 189 bool is_history_navigation_in_new_child, |
188 bool has_subtree_history_items, | 190 const std::set<std::string>& subframe_unique_names, |
189 bool has_committed_real_load, | 191 bool has_committed_real_load, |
190 bool intended_as_new_entry, | 192 bool intended_as_new_entry, |
191 int pending_offset_to_send, | 193 int pending_offset_to_send, |
192 int current_offset_to_send, | 194 int current_offset_to_send, |
193 int current_length_to_send) const; | 195 int current_length_to_send) const; |
194 | 196 |
195 // Once a navigation entry is committed, we should no longer track several | 197 // Once a navigation entry is committed, we should no longer track several |
196 // pieces of non-persisted state, as documented on the members below. | 198 // pieces of non-persisted state, as documented on the members below. |
197 // |frame_entry| is the FrameNavigationEntry for the frame that committed | 199 // |frame_entry| is the FrameNavigationEntry for the frame that committed |
198 // the navigation. It can be null. | 200 // the navigation. It can be null. |
(...skipping 23 matching lines...) Expand all Loading... |
222 const GURL& url, | 224 const GURL& url, |
223 const Referrer& referrer, | 225 const Referrer& referrer, |
224 const PageState& page_state, | 226 const PageState& page_state, |
225 const std::string& method, | 227 const std::string& method, |
226 int64_t post_id); | 228 int64_t post_id); |
227 | 229 |
228 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if | 230 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if |
229 // there is one in this NavigationEntry. | 231 // there is one in this NavigationEntry. |
230 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; | 232 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; |
231 | 233 |
232 // Returns whether the TreeNode associated with |frame_tree_node| has any | 234 // Returns a set of frame unique names for immediate children of the TreeNode |
233 // children. If not, the renderer process does not need to ask the browser | 235 // associated with |frame_tree_node|. The renderer process will use this list |
234 // when new subframes are created during a back/forward navigation. | 236 // of names to know whether to ask the browser process for a history item when |
235 // TODO(creis): Send a data structure with all unique names in the subtree, | 237 // new subframes are created during a back/forward navigation. |
236 // along with any corresponding same-process PageStates. The renderer only | 238 // TODO(creis): Send a data structure that also contains all corresponding |
| 239 // same-process PageStates for the subtree, so that the renderer process only |
237 // needs to ask the browser process to handle the cross-process cases. | 240 // needs to ask the browser process to handle the cross-process cases. |
238 // See https://crbug.com/639842. | 241 // See https://crbug.com/639842. |
239 bool HasSubtreeHistoryItems(FrameTreeNode* frame_tree_node) const; | 242 std::set<std::string> GetSubframeUniqueNames( |
| 243 FrameTreeNode* frame_tree_node) const; |
240 | 244 |
241 // Removes any subframe FrameNavigationEntries that match the unique name of | 245 // Removes any subframe FrameNavigationEntries that match the unique name of |
242 // |frame_tree_node|, and all of their children. There should be at most one, | 246 // |frame_tree_node|, and all of their children. There should be at most one, |
243 // since collisions are avoided but leave old FrameNavigationEntries in the | 247 // since collisions are avoided but leave old FrameNavigationEntries in the |
244 // tree after their frame has been detached. | 248 // tree after their frame has been detached. |
245 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node); | 249 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node); |
246 | 250 |
247 void set_unique_id(int unique_id) { | 251 void set_unique_id(int unique_id) { |
248 unique_id_ = unique_id; | 252 unique_id_ = unique_id; |
249 } | 253 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 // persisted, unless specific data is taken out/put back in at save/restore | 523 // persisted, unless specific data is taken out/put back in at save/restore |
520 // time (see TabNavigation for an example of this). | 524 // time (see TabNavigation for an example of this). |
521 std::map<std::string, base::string16> extra_data_; | 525 std::map<std::string, base::string16> extra_data_; |
522 | 526 |
523 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); | 527 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
524 }; | 528 }; |
525 | 529 |
526 } // namespace content | 530 } // namespace content |
527 | 531 |
528 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 532 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
OLD | NEW |