Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: content/browser/frame_host/navigation_entry_impl.h

Issue 2454233002: Fix history nav to a script-injected about:blank frame. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 const GURL& dest_url, 179 const GURL& dest_url,
180 const Referrer& dest_referrer, 180 const Referrer& dest_referrer,
181 FrameMsg_Navigate_Type::Value navigation_type, 181 FrameMsg_Navigate_Type::Value navigation_type,
182 LoFiState lofi_state, 182 LoFiState lofi_state,
183 const base::TimeTicks& navigation_start) const; 183 const base::TimeTicks& navigation_start) const;
184 StartNavigationParams ConstructStartNavigationParams() const; 184 StartNavigationParams ConstructStartNavigationParams() const;
185 RequestNavigationParams ConstructRequestNavigationParams( 185 RequestNavigationParams ConstructRequestNavigationParams(
186 const FrameNavigationEntry& frame_entry, 186 const FrameNavigationEntry& frame_entry,
187 bool is_same_document_history_load, 187 bool is_same_document_history_load,
188 bool is_history_navigation_in_new_child, 188 bool is_history_navigation_in_new_child,
189 const std::set<std::string>& subframe_unique_names, 189 const std::map<std::string, bool>& subframe_unique_names,
190 bool has_committed_real_load, 190 bool has_committed_real_load,
191 bool intended_as_new_entry, 191 bool intended_as_new_entry,
192 int pending_offset_to_send, 192 int pending_offset_to_send,
193 int current_offset_to_send, 193 int current_offset_to_send,
194 int current_length_to_send) const; 194 int current_length_to_send) const;
195 195
196 // Once a navigation entry is committed, we should no longer track several 196 // Once a navigation entry is committed, we should no longer track several
197 // pieces of non-persisted state, as documented on the members below. 197 // pieces of non-persisted state, as documented on the members below.
198 // |frame_entry| is the FrameNavigationEntry for the frame that committed 198 // |frame_entry| is the FrameNavigationEntry for the frame that committed
199 // the navigation. It can be null. 199 // the navigation. It can be null.
(...skipping 23 matching lines...) Expand all
223 const GURL& url, 223 const GURL& url,
224 const Referrer& referrer, 224 const Referrer& referrer,
225 const PageState& page_state, 225 const PageState& page_state,
226 const std::string& method, 226 const std::string& method,
227 int64_t post_id); 227 int64_t post_id);
228 228
229 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if 229 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if
230 // there is one in this NavigationEntry. 230 // there is one in this NavigationEntry.
231 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; 231 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const;
232 232
233 // Returns a set of frame unique names for immediate children of the TreeNode 233 // Returns a map of frame unique names to |is_about_blank| for immediate
234 // associated with |frame_tree_node|. The renderer process will use this list 234 // children of the TreeNode associated with |frame_tree_node|. The renderer
235 // of names to know whether to ask the browser process for a history item when 235 // process will use this list of names to know whether to ask the browser
236 // new subframes are created during a back/forward navigation. 236 // process for a history item when new subframes are created during a
237 // back/forward navigation. (|is_about_blank| can be used to skip the request
238 // if the frame's default URL is about:blank and the history item would be a
239 // no-op. See https://crbug.com/657896.)
237 // TODO(creis): Send a data structure that also contains all corresponding 240 // TODO(creis): Send a data structure that also contains all corresponding
238 // same-process PageStates for the subtree, so that the renderer process only 241 // same-process PageStates for the whole subtree, so that the renderer process
239 // needs to ask the browser process to handle the cross-process cases. 242 // only needs to ask the browser process to handle the cross-process cases.
240 // See https://crbug.com/639842. 243 // See https://crbug.com/639842.
241 std::set<std::string> GetSubframeUniqueNames( 244 std::map<std::string, bool> GetSubframeUniqueNames(
242 FrameTreeNode* frame_tree_node) const; 245 FrameTreeNode* frame_tree_node) const;
243 246
244 // Removes any subframe FrameNavigationEntries that match the unique name of 247 // Removes any subframe FrameNavigationEntries that match the unique name of
245 // |frame_tree_node|, and all of their children. There should be at most one, 248 // |frame_tree_node|, and all of their children. There should be at most one,
246 // since collisions are avoided but leave old FrameNavigationEntries in the 249 // since collisions are avoided but leave old FrameNavigationEntries in the
247 // tree after their frame has been detached. 250 // tree after their frame has been detached.
248 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node); 251 void ClearStaleFrameEntriesForNewFrame(FrameTreeNode* frame_tree_node);
249 252
250 void set_unique_id(int unique_id) { 253 void set_unique_id(int unique_id) {
251 unique_id_ = unique_id; 254 unique_id_ = unique_id;
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 // persisted, unless specific data is taken out/put back in at save/restore 550 // persisted, unless specific data is taken out/put back in at save/restore
548 // time (see TabNavigation for an example of this). 551 // time (see TabNavigation for an example of this).
549 std::map<std::string, base::string16> extra_data_; 552 std::map<std::string, base::string16> extra_data_;
550 553
551 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); 554 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl);
552 }; 555 };
553 556
554 } // namespace content 557 } // namespace content
555 558
556 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ 559 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698