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

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

Issue 994803004: Add Clone and disallow copy construction for NavigationEntryImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 9 months 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/navigation_entry_impl.h
diff --git a/content/browser/frame_host/navigation_entry_impl.h b/content/browser/frame_host/navigation_entry_impl.h
index c69c978e0f416b60dab1fb6b7e9d9d307f56f8e9..f6d2a17f0ac222b141fe3270f6b10b6216021878 100644
--- a/content/browser/frame_host/navigation_entry_impl.h
+++ b/content/browser/frame_host/navigation_entry_impl.h
@@ -90,6 +90,15 @@ class CONTENT_EXPORT NavigationEntryImpl
const std::vector<GURL>& GetRedirectChain() const override;
bool IsRestored() const override;
+ // Creates a copy of this NavigationEntryImpl that can be modified
+ // independently from the original. Does not copy any value that would be
+ // cleared in ResetForCommit.
+ // TODO(creis): Once we start sharing FrameNavigationEntries between
+ // NavigationEntryImpls, we will need to support two versions of Clone: one
+ // that shares the existing FrameNavigationEntries (for use within the same
+ // tab) and one that draws them from a different pool (for use in a new tab).
Avi (use Gerrit) 2015/03/12 16:59:19 Does this version of Clone have one of those behav
Charlie Reis 2015/03/12 17:07:43 Yeah, I hadn't thought closely about whether to ha
+ NavigationEntryImpl* Clone() const;
+
// Once a navigation entry is committed, we should no longer track several
// pieces of non-persisted state, as documented on the members below.
void ResetForCommit();
@@ -245,6 +254,7 @@ class CONTENT_EXPORT NavigationEntryImpl
// later. If you add a new field that needs to be persisted you'll have to
// update SessionService/TabRestoreService and Android WebView
// state_serializer.cc appropriately.
+ // For all new fields, update |Clone| and possibly |ResetForCommit|.
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
// The FrameNavigationEntry for the main frame.
@@ -369,7 +379,7 @@ class CONTENT_EXPORT NavigationEntryImpl
// time (see TabNavigation for an example of this).
std::map<std::string, base::string16> extra_data_;
- // Copy and assignment is explicitly allowed for this class.
+ DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl);
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698