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

Side by Side Diff: content/browser/web_contents/navigation_entry_impl.h

Issue 12086109: Prevent bindings escalation on an existing NavigationEntry. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/browser/site_instance_impl.h" 10 #include "content/browser/site_instance_impl.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // counted pointer to a shared site instance. 84 // counted pointer to a shared site instance.
85 // 85 //
86 // Note that the SiteInstance should usually not be changed after it is set, 86 // Note that the SiteInstance should usually not be changed after it is set,
87 // but this may happen if the NavigationEntry was cloned and needs to use a 87 // but this may happen if the NavigationEntry was cloned and needs to use a
88 // different SiteInstance. 88 // different SiteInstance.
89 void set_site_instance(SiteInstanceImpl* site_instance); 89 void set_site_instance(SiteInstanceImpl* site_instance);
90 SiteInstanceImpl* site_instance() const { 90 SiteInstanceImpl* site_instance() const {
91 return site_instance_.get(); 91 return site_instance_.get();
92 } 92 }
93 93
94 // Remember the set of bindings granted to this NavigationEntry at the time
95 // of commit, to ensure that we do not grant it additional bindings if we
96 // navigate back to it in the future.
97 void set_bindings(int bindings) {
98 bindings_ = bindings;
Chris Evans 2013/02/01 22:47:47 Should this ever be called more than one? Assert?
Charlie Reis 2013/02/04 06:03:40 It's set every time you commit, but we can ensure
99 }
Chris Evans 2013/02/01 22:47:47 Nit: add newline?
Charlie Reis 2013/02/04 06:03:40 This is consistent with the rest of the file.
100 int bindings() const {
101 return bindings_;
102 }
103
94 void set_page_type(PageType page_type) { 104 void set_page_type(PageType page_type) {
95 page_type_ = page_type; 105 page_type_ = page_type;
96 } 106 }
97 107
98 bool has_virtual_url() const { 108 bool has_virtual_url() const {
99 return !virtual_url_.is_empty(); 109 return !virtual_url_.is_empty();
100 } 110 }
101 111
102 bool update_virtual_url_with_url() const { 112 bool update_virtual_url_with_url() const {
103 return update_virtual_url_with_url_; 113 return update_virtual_url_with_url_;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 188 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
179 // Session/Tab restore save portions of this class so that it can be recreated 189 // Session/Tab restore save portions of this class so that it can be recreated
180 // later. If you add a new field that needs to be persisted you'll have to 190 // later. If you add a new field that needs to be persisted you'll have to
181 // update SessionService/TabRestoreService and Android WebView 191 // update SessionService/TabRestoreService and Android WebView
182 // state_serializer.cc appropriately. 192 // state_serializer.cc appropriately.
183 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 193 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
184 194
185 // See the accessors above for descriptions. 195 // See the accessors above for descriptions.
186 int unique_id_; 196 int unique_id_;
187 scoped_refptr<SiteInstanceImpl> site_instance_; 197 scoped_refptr<SiteInstanceImpl> site_instance_;
198 // TODO(creis): Persist bindings_. http://crbug.com/173672.
199 int bindings_;
188 PageType page_type_; 200 PageType page_type_;
189 GURL url_; 201 GURL url_;
190 Referrer referrer_; 202 Referrer referrer_;
191 GURL virtual_url_; 203 GURL virtual_url_;
192 bool update_virtual_url_with_url_; 204 bool update_virtual_url_with_url_;
193 string16 title_; 205 string16 title_;
194 FaviconStatus favicon_; 206 FaviconStatus favicon_;
195 std::string content_state_; 207 std::string content_state_;
196 int32 page_id_; 208 int32 page_id_;
197 SSLStatus ssl_; 209 SSLStatus ssl_;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // If not empty, the name of the frame to navigate. This field is not 276 // If not empty, the name of the frame to navigate. This field is not
265 // persisted, because it is currently only used in tests. 277 // persisted, because it is currently only used in tests.
266 std::string frame_to_navigate_; 278 std::string frame_to_navigate_;
267 279
268 // Copy and assignment is explicitly allowed for this class. 280 // Copy and assignment is explicitly allowed for this class.
269 }; 281 };
270 282
271 } // namespace content 283 } // namespace content
272 284
273 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ 285 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698