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

Unified Diff: content/browser/frame_host/frame_navigation_entry.h

Issue 1407853005: OOPIF: Add frame_unique_name to FrameNavigationEntry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename target to frame_unique_name Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/frame_navigation_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_navigation_entry.h
diff --git a/content/browser/frame_host/frame_navigation_entry.h b/content/browser/frame_host/frame_navigation_entry.h
index d92a924fc855bd1fe64f1567b1cc661420a6dd81..bbd3519431cf30c0ccbf1f961356c8bcb7b5e345 100644
--- a/content/browser/frame_host/frame_navigation_entry.h
+++ b/content/browser/frame_host/frame_navigation_entry.h
@@ -19,17 +19,16 @@ namespace content {
// For now, it is owned by a single NavigationEntry and only tracks the main
// frame.
//
-// TODO(creis): In --site-per-process, fill in a tree of FrameNavigationEntries
-// in each NavigationEntry, one per frame. FrameNavigationEntries may be shared
-// across NavigationEntries if the frame hasn't changed.
+// If SiteIsolationPolicy::UseSubframeNavigationEntries is true, there will be a
+// tree of FrameNavigationEntries in each NavigationEntry, one per frame.
+// TODO(creis): Share these FrameNavigationEntries across NavigationEntries if
+// the frame hasn't changed.
class CONTENT_EXPORT FrameNavigationEntry
: public base::RefCounted<FrameNavigationEntry> {
public:
- // TODO(creis): We should not use FTN IDs here, since they will change if you
- // leave a page and come back later. We should evaluate whether Blink's
- // unique names would work instead, similar to HistoryNode.
explicit FrameNavigationEntry(int frame_tree_node_id);
FrameNavigationEntry(int frame_tree_node_id,
+ std::string frame_unique_name,
int64 item_sequence_number,
int64 document_sequence_number,
SiteInstanceImpl* site_instance,
@@ -41,7 +40,8 @@ class CONTENT_EXPORT FrameNavigationEntry
FrameNavigationEntry* Clone() const;
// Updates all the members of this entry.
- void UpdateEntry(int64 item_sequence_number,
+ void UpdateEntry(std::string frame_unique_name,
+ int64 item_sequence_number,
int64 document_sequence_number,
SiteInstanceImpl* site_instance,
const GURL& url,
@@ -51,9 +51,20 @@ class CONTENT_EXPORT FrameNavigationEntry
// The ID of the FrameTreeNode this entry is for. -1 for the main frame,
// since we don't always know the FrameTreeNode ID when creating the overall
// NavigationEntry.
- // TODO(creis): Replace with frame sequence number or unique name.
+ // TODO(creis): Consider removing |frame_tree_node_id| in favor of
+ // |frame_unique_name|, if we can move unique name computation to the browser
+ // process.
int frame_tree_node_id() const { return frame_tree_node_id_; }
+ // The unique name of the frame this entry is for. This is a stable name for
+ // the frame based on its position in the tree and relation to other named
+ // frames, which does not change after cross-process navigations or restores.
+ // Only the main frame can have an empty name.
Avi (use Gerrit) 2015/11/09 22:23:17 NB: This is unique relative to other frames in the
Charlie Reis 2015/11/09 22:29:21 Done.
+ std::string frame_unique_name() const { return frame_unique_name_; }
+ void set_frame_unique_name(std::string frame_unique_name) {
+ frame_unique_name_ = frame_unique_name;
+ }
+
// Keeps track of where this entry belongs in the frame's session history.
// The item sequence number identifies each stop in the back/forward history
// and is globally unique. The document sequence number increments for each
@@ -91,13 +102,14 @@ class CONTENT_EXPORT FrameNavigationEntry
virtual ~FrameNavigationEntry();
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
- // For all new fields, update |Clone|.
+ // Add all new fields to |UpdateEntry|.
// TODO(creis): These fields have implications for session restore. This is
// currently managed by NavigationEntry, but the logic will move here.
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
// See the accessors above for descriptions.
int frame_tree_node_id_;
+ std::string frame_unique_name_;
int64 item_sequence_number_;
int64 document_sequence_number_;
scoped_refptr<SiteInstanceImpl> site_instance_;
« no previous file with comments | « no previous file | content/browser/frame_host/frame_navigation_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698