| 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 <map> | 10 #include <map> |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 const GURL& dest_url, | 180 const GURL& dest_url, |
| 181 const Referrer& dest_referrer, | 181 const Referrer& dest_referrer, |
| 182 FrameMsg_Navigate_Type::Value navigation_type, | 182 FrameMsg_Navigate_Type::Value navigation_type, |
| 183 LoFiState lofi_state, | 183 LoFiState lofi_state, |
| 184 const base::TimeTicks& navigation_start) const; | 184 const base::TimeTicks& navigation_start) const; |
| 185 StartNavigationParams ConstructStartNavigationParams() const; | 185 StartNavigationParams ConstructStartNavigationParams() const; |
| 186 RequestNavigationParams ConstructRequestNavigationParams( | 186 RequestNavigationParams ConstructRequestNavigationParams( |
| 187 const FrameNavigationEntry& frame_entry, | 187 const FrameNavigationEntry& frame_entry, |
| 188 bool is_same_document_history_load, | 188 bool is_same_document_history_load, |
| 189 bool is_history_navigation_in_new_child, | 189 bool is_history_navigation_in_new_child, |
| 190 const std::map<std::string, bool>& subframe_unique_names, | 190 const std::map<std::string, PageState>& subtree_page_states, |
| 191 bool has_committed_real_load, | 191 bool has_committed_real_load, |
| 192 bool intended_as_new_entry, | 192 bool intended_as_new_entry, |
| 193 int pending_offset_to_send, | 193 int pending_offset_to_send, |
| 194 int current_offset_to_send, | 194 int current_offset_to_send, |
| 195 int current_length_to_send) const; | 195 int current_length_to_send) const; |
| 196 | 196 |
| 197 // 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 |
| 198 // pieces of non-persisted state, as documented on the members below. | 198 // pieces of non-persisted state, as documented on the members below. |
| 199 // |frame_entry| is the FrameNavigationEntry for the frame that committed | 199 // |frame_entry| is the FrameNavigationEntry for the frame that committed |
| 200 // the navigation. It can be null. | 200 // the navigation. It can be null. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 225 const Referrer& referrer, | 225 const Referrer& referrer, |
| 226 const std::vector<GURL>& redirect_chain, | 226 const std::vector<GURL>& redirect_chain, |
| 227 const PageState& page_state, | 227 const PageState& page_state, |
| 228 const std::string& method, | 228 const std::string& method, |
| 229 int64_t post_id); | 229 int64_t post_id); |
| 230 | 230 |
| 231 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if | 231 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if |
| 232 // there is one in this NavigationEntry. | 232 // there is one in this NavigationEntry. |
| 233 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; | 233 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; |
| 234 | 234 |
| 235 // Returns a map of frame unique names to |is_about_blank| for immediate | 235 // Returns a map of frame unique names to PageStates for the subtree of |
| 236 // children of the TreeNode associated with |frame_tree_node|. The renderer | 236 // FrameNavigationEntries underneath |frame_tree_node|. This map contains |
| 237 // process will use this list of names to know whether to ask the browser | 237 // names for every frame in the subtree, and valid PageStates for those frames |
| 238 // process for a history item when new subframes are created during a | 238 // that should load in the same SiteInstance. Cross-SiteInstance frames are |
| 239 // back/forward navigation. (|is_about_blank| can be used to skip the request | 239 // given empty PageStates here. |
| 240 // if the frame's default URL is about:blank and the history item would be a | 240 // |
| 241 // no-op. See https://crbug.com/657896.) | 241 // The renderer process uses this list of names to know whether there is a |
| 242 // TODO(creis): Send a data structure that also contains all corresponding | 242 // history item to use when new subframes are created during a back/forward |
| 243 // same-process PageStates for the whole subtree, so that the renderer process | 243 // navigation. If the corresponding PageState is valid, the renderer can |
| 244 // only needs to ask the browser process to handle the cross-process cases. | 244 // directly load it without asking the browser. If the PageState is empty, |
| 245 // See https://crbug.com/639842. | 245 // it corresponds to an out-of-process iframe and the renderer asks the |
| 246 std::map<std::string, bool> GetSubframeUniqueNames( | 246 // browser process to navigate that frame instead. |
| 247 // |
| 248 // TODO(creis): When the SiteInstance is missing, such as after restore, this |
| 249 // causes the browser to send PageStates to the renderer even when they should |
| 250 // be destined for an OOPIF. Persist SiteInstance relationships to prevent |
| 251 // this. See https://crbug.com/14987. |
| 252 std::map<std::string, PageState> GetSubtreePageStates( |
| 247 FrameTreeNode* frame_tree_node) const; | 253 FrameTreeNode* frame_tree_node) const; |
| 248 | 254 |
| 249 // Removes any subframe FrameNavigationEntries that match the unique name of | 255 // Removes any subframe FrameNavigationEntries that match the unique name of |
| 250 // |frame_tree_node|, and all of their children. There should be at most one, | 256 // |frame_tree_node|, and all of their children. There should be at most one, |
| 251 // since collisions are avoided but leave old FrameNavigationEntries in the | 257 // since collisions are avoided but leave old FrameNavigationEntries in the |
| 252 // tree after their frame has been detached. | 258 // tree after their frame has been detached. |
| 253 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node); | 259 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node); |
| 254 | 260 |
| 255 void set_unique_id(int unique_id) { | 261 void set_unique_id(int unique_id) { |
| 256 unique_id_ = unique_id; | 262 unique_id_ = unique_id; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 // persisted, unless specific data is taken out/put back in at save/restore | 548 // persisted, unless specific data is taken out/put back in at save/restore |
| 543 // time (see TabNavigation for an example of this). | 549 // time (see TabNavigation for an example of this). |
| 544 std::map<std::string, base::string16> extra_data_; | 550 std::map<std::string, base::string16> extra_data_; |
| 545 | 551 |
| 546 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); | 552 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
| 547 }; | 553 }; |
| 548 | 554 |
| 549 } // namespace content | 555 } // namespace content |
| 550 | 556 |
| 551 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 557 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
| OLD | NEW |