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

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

Issue 1006693002: Add NavigationEntryImpl::TreeNode for tracking FrameNavigationEntries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patch 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.cc
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index 5f156cd26236978174005c0c28de459ab6487a99..c7a84de7ff38c08f8db23c1c33af7a462c4c7cd5 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -25,6 +25,22 @@ namespace content {
int NavigationEntryImpl::kInvalidBindings = -1;
+NavigationEntryImpl::TreeNode::TreeNode(FrameNavigationEntry* frame_entry)
+ : frame_entry(frame_entry) {
+}
+
+NavigationEntryImpl::TreeNode::~TreeNode() {
+}
+
+NavigationEntryImpl::TreeNode* NavigationEntryImpl::TreeNode::Clone() const {
+ // Clone the tree using a copy of the FrameNavigationEntry, without sharing.
+ NavigationEntryImpl::TreeNode* copy =
+ new NavigationEntryImpl::TreeNode(frame_entry->Clone());
+
+ // TODO(creis): Clone children once we add them.
+ return copy;
+}
+
NavigationEntry* NavigationEntry::Create() {
return new NavigationEntryImpl();
}
@@ -46,7 +62,8 @@ NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance,
const base::string16& title,
ui::PageTransition transition_type,
bool is_renderer_initiated)
- : frame_entry_(instance, url, referrer),
+ : frame_tree_(
+ new TreeNode(new FrameNavigationEntry(instance, url, referrer))),
unique_id_(GetUniqueIDInConstructor()),
bindings_(kInvalidBindings),
page_type_(PAGE_TYPE_NORMAL),
@@ -78,12 +95,12 @@ PageType NavigationEntryImpl::GetPageType() const {
}
void NavigationEntryImpl::SetURL(const GURL& url) {
- frame_entry_.set_url(url);
+ frame_tree_->frame_entry->set_url(url);
cached_display_title_.clear();
}
const GURL& NavigationEntryImpl::GetURL() const {
- return frame_entry_.url();
+ return frame_tree_->frame_entry->url();
}
void NavigationEntryImpl::SetBaseURLForDataURL(const GURL& url) {
@@ -95,11 +112,11 @@ const GURL& NavigationEntryImpl::GetBaseURLForDataURL() const {
}
void NavigationEntryImpl::SetReferrer(const Referrer& referrer) {
- frame_entry_.set_referrer(referrer);
+ frame_tree_->frame_entry->set_referrer(referrer);
}
const Referrer& NavigationEntryImpl::GetReferrer() const {
- return frame_entry_.referrer();
+ return frame_tree_->frame_entry->referrer();
}
void NavigationEntryImpl::SetVirtualURL(const GURL& url) {
@@ -137,7 +154,8 @@ int32 NavigationEntryImpl::GetPageID() const {
}
void NavigationEntryImpl::set_site_instance(SiteInstanceImpl* site_instance) {
- frame_entry_.set_site_instance(site_instance);
+ // TODO(creis): Update all callers and remove this method.
+ frame_tree_->frame_entry->set_site_instance(site_instance);
}
void NavigationEntryImpl::set_source_site_instance(
@@ -326,10 +344,9 @@ void NavigationEntryImpl::ClearExtraData(const std::string& key) {
NavigationEntryImpl* NavigationEntryImpl::Clone() const {
NavigationEntryImpl* copy = new NavigationEntryImpl();
- // TODO(creis): Once we have a tree of FrameNavigationEntries, make a deep
- // copy. Only share the same FrameNavigationEntries if cloning within the
- // same tab.
- copy->frame_entry_ = frame_entry_;
+ // TODO(creis): Only share the same FrameNavigationEntries if cloning within
+ // the same tab.
+ copy->frame_tree_.reset(frame_tree_->Clone());
// Copy all state over, unless cleared in ResetForCommit.
copy->unique_id_ = unique_id_;

Powered by Google App Engine
This is Rietveld 408576698