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

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: Update comments 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
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..6990cd727fbfcc9fbd10e35b870dd75804a21499 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 target,
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 target,
+ int64 item_sequence_number,
int64 document_sequence_number,
SiteInstanceImpl* site_instance,
const GURL& url,
@@ -51,9 +51,17 @@ 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 |target|,
+ // 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 20:58:26 If this is a "unique name", why is this called "ta
Charlie Reis 2015/11/09 21:28:48 The risk with putting a "unique name" on FrameNavi
Avi (use Gerrit) 2015/11/09 21:30:58 That sounds like it doesn't avoid what you were wo
Charlie Reis 2015/11/09 21:38:41 I think it does. I was worried that it would be o
Avi (use Gerrit) 2015/11/09 21:44:39 If you're OK with "unique frame name" then I'm OK
Charlie Reis 2015/11/09 21:49:24 Nate, what would you think about changing blink::H
Nate Chapin 2015/11/09 21:52:23 I'd prefer frameUniqueName() to uniqueFrameName(),
Charlie Reis 2015/11/09 22:19:41 Thanks. I went with that, and we can update the o
+ std::string target() const { return target_; }
+ void set_target(std::string target) { target_ = target; }
+
// 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 +99,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 target_;
int64 item_sequence_number_;
int64 document_sequence_number_;
scoped_refptr<SiteInstanceImpl> site_instance_;

Powered by Google App Engine
This is Rietveld 408576698