| 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> | 10 #include <map> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "content/browser/frame_host/frame_navigation_entry.h" | 17 #include "content/browser/frame_host/frame_navigation_entry.h" |
| 18 #include "content/browser/frame_host/frame_tree_node.h" | 18 #include "content/browser/frame_host/frame_tree_node.h" |
| 19 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
| 20 #include "content/common/frame_message_enums.h" | 20 #include "content/common/frame_message_enums.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 const GURL& dest_url, | 183 const GURL& dest_url, |
| 184 const Referrer& dest_referrer, | 184 const Referrer& dest_referrer, |
| 185 FrameMsg_Navigate_Type::Value navigation_type, | 185 FrameMsg_Navigate_Type::Value navigation_type, |
| 186 LoFiState lofi_state, | 186 LoFiState lofi_state, |
| 187 const base::TimeTicks& navigation_start) const; | 187 const base::TimeTicks& navigation_start) const; |
| 188 StartNavigationParams ConstructStartNavigationParams() const; | 188 StartNavigationParams ConstructStartNavigationParams() const; |
| 189 RequestNavigationParams ConstructRequestNavigationParams( | 189 RequestNavigationParams ConstructRequestNavigationParams( |
| 190 const FrameNavigationEntry& frame_entry, | 190 const FrameNavigationEntry& frame_entry, |
| 191 bool is_same_document_history_load, | 191 bool is_same_document_history_load, |
| 192 bool is_history_navigation_in_new_child, | 192 bool is_history_navigation_in_new_child, |
| 193 const std::set<std::string>& subframe_unique_names, | 193 const std::map<std::string, bool>& subframe_unique_names, |
| 194 bool has_committed_real_load, | 194 bool has_committed_real_load, |
| 195 bool intended_as_new_entry, | 195 bool intended_as_new_entry, |
| 196 int pending_offset_to_send, | 196 int pending_offset_to_send, |
| 197 int current_offset_to_send, | 197 int current_offset_to_send, |
| 198 int current_length_to_send) const; | 198 int current_length_to_send) const; |
| 199 | 199 |
| 200 // Once a navigation entry is committed, we should no longer track several | 200 // Once a navigation entry is committed, we should no longer track several |
| 201 // pieces of non-persisted state, as documented on the members below. | 201 // pieces of non-persisted state, as documented on the members below. |
| 202 // |frame_entry| is the FrameNavigationEntry for the frame that committed | 202 // |frame_entry| is the FrameNavigationEntry for the frame that committed |
| 203 // the navigation. It can be null. | 203 // the navigation. It can be null. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 228 const Referrer& referrer, | 228 const Referrer& referrer, |
| 229 const std::vector<GURL>& redirect_chain, | 229 const std::vector<GURL>& redirect_chain, |
| 230 const PageState& page_state, | 230 const PageState& page_state, |
| 231 const std::string& method, | 231 const std::string& method, |
| 232 int64_t post_id); | 232 int64_t post_id); |
| 233 | 233 |
| 234 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if | 234 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if |
| 235 // there is one in this NavigationEntry. | 235 // there is one in this NavigationEntry. |
| 236 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; | 236 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; |
| 237 | 237 |
| 238 // Returns a set of frame unique names for immediate children of the TreeNode | 238 // Returns a map of frame unique names to |is_about_blank| for immediate |
| 239 // associated with |frame_tree_node|. The renderer process will use this list | 239 // children of the TreeNode associated with |frame_tree_node|. The renderer |
| 240 // of names to know whether to ask the browser process for a history item when | 240 // process will use this list of names to know whether to ask the browser |
| 241 // new subframes are created during a back/forward navigation. | 241 // process for a history item when new subframes are created during a |
| 242 // back/forward navigation. (|is_about_blank| can be used to skip the request |
| 243 // if the frame's default URL is about:blank and the history item would be a |
| 244 // no-op. See https://crbug.com/657896.) |
| 242 // TODO(creis): Send a data structure that also contains all corresponding | 245 // TODO(creis): Send a data structure that also contains all corresponding |
| 243 // same-process PageStates for the subtree, so that the renderer process only | 246 // same-process PageStates for the whole subtree, so that the renderer process |
| 244 // needs to ask the browser process to handle the cross-process cases. | 247 // only needs to ask the browser process to handle the cross-process cases. |
| 245 // See https://crbug.com/639842. | 248 // See https://crbug.com/639842. |
| 246 std::set<std::string> GetSubframeUniqueNames( | 249 std::map<std::string, bool> GetSubframeUniqueNames( |
| 247 FrameTreeNode* frame_tree_node) const; | 250 FrameTreeNode* frame_tree_node) const; |
| 248 | 251 |
| 249 // Removes any subframe FrameNavigationEntries that match the unique name of | 252 // 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, | 253 // |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 | 254 // since collisions are avoided but leave old FrameNavigationEntries in the |
| 252 // tree after their frame has been detached. | 255 // tree after their frame has been detached. |
| 253 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node); | 256 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node); |
| 254 | 257 |
| 255 void set_unique_id(int unique_id) { | 258 void set_unique_id(int unique_id) { |
| 256 unique_id_ = unique_id; | 259 unique_id_ = unique_id; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // persisted, unless specific data is taken out/put back in at save/restore | 546 // persisted, unless specific data is taken out/put back in at save/restore |
| 544 // time (see TabNavigation for an example of this). | 547 // time (see TabNavigation for an example of this). |
| 545 std::map<std::string, base::string16> extra_data_; | 548 std::map<std::string, base::string16> extra_data_; |
| 546 | 549 |
| 547 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); | 550 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
| 548 }; | 551 }; |
| 549 | 552 |
| 550 } // namespace content | 553 } // namespace content |
| 551 | 554 |
| 552 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 555 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
| OLD | NEW |