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

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

Issue 12313067: Prevent bindings escalation on an existing NavigationEntry (attempt 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/web_contents/navigation_entry_impl.h
diff --git a/content/browser/web_contents/navigation_entry_impl.h b/content/browser/web_contents/navigation_entry_impl.h
index c23e2f0403496ee08977879c12d60683f4aff0c7..62234bfb182b46c99e098c638bfa8331c339b87d 100644
--- a/content/browser/web_contents/navigation_entry_impl.h
+++ b/content/browser/web_contents/navigation_entry_impl.h
@@ -20,6 +20,9 @@ class CONTENT_EXPORT NavigationEntryImpl
public:
static NavigationEntryImpl* FromNavigationEntry(NavigationEntry* entry);
+ // The value of bindings() before it is set during commit.
+ static int kInvalidBindings;
+
NavigationEntryImpl();
NavigationEntryImpl(SiteInstanceImpl* instance,
int page_id,
@@ -96,6 +99,14 @@ class CONTENT_EXPORT NavigationEntryImpl
return site_instance_.get();
}
+ // Remember the set of bindings granted to this NavigationEntry at the time
+ // of commit, to ensure that we do not grant it additional bindings if we
+ // navigate back to it in the future. This can only be changed once.
+ void SetBindings(int bindings);
+ int bindings() const {
+ return bindings_;
+ }
+
void set_page_type(PageType page_type) {
page_type_ = page_type;
}
@@ -190,6 +201,8 @@ class CONTENT_EXPORT NavigationEntryImpl
// See the accessors above for descriptions.
int unique_id_;
scoped_refptr<SiteInstanceImpl> site_instance_;
+ // TODO(creis): Persist bindings_. http://crbug.com/173672.
+ int bindings_;
PageType page_type_;
GURL url_;
Referrer referrer_;

Powered by Google App Engine
This is Rietveld 408576698