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

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

Issue 1944013003: Move ownership of source SiteInstance to the FrameNavigationEntry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another round of review comments addressed. Created 4 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const FrameNavigationEntry& frame_entry, 170 const FrameNavigationEntry& frame_entry,
171 bool is_same_document_history_load, 171 bool is_same_document_history_load,
172 bool has_committed_real_load, 172 bool has_committed_real_load,
173 bool intended_as_new_entry, 173 bool intended_as_new_entry,
174 int pending_offset_to_send, 174 int pending_offset_to_send,
175 int current_offset_to_send, 175 int current_offset_to_send,
176 int current_length_to_send) const; 176 int current_length_to_send) const;
177 177
178 // Once a navigation entry is committed, we should no longer track several 178 // Once a navigation entry is committed, we should no longer track several
179 // pieces of non-persisted state, as documented on the members below. 179 // pieces of non-persisted state, as documented on the members below.
180 void ResetForCommit(); 180 // |frame_entry| is the FrameNavigationEntry for the frame that committed
181 // the navigation. It can be null.
182 void ResetForCommit(FrameNavigationEntry* frame_entry);
181 183
182 // Exposes the tree of FrameNavigationEntries that make up this joint session 184 // Exposes the tree of FrameNavigationEntries that make up this joint session
183 // history item. 185 // history item.
184 // In default Chrome, this tree only has a root node with an unshared 186 // In default Chrome, this tree only has a root node with an unshared
185 // FrameNavigationEntry. Subframes are only added to the tree if the 187 // FrameNavigationEntry. Subframes are only added to the tree if the
186 // --site-per-process flag is passed. 188 // --site-per-process flag is passed.
187 TreeNode* root_node() const { 189 TreeNode* root_node() const {
188 return frame_tree_.get(); 190 return frame_tree_.get();
189 } 191 }
190 192
191 // Finds the TreeNode associated with |frame_tree_node_id| to add or update 193 // Finds the TreeNode associated with |frame_tree_node_id| to add or update
192 // its FrameNavigationEntry. A new FrameNavigationEntry is added if none 194 // its FrameNavigationEntry. A new FrameNavigationEntry is added if none
193 // exists, or else the existing one (which might be shared with other 195 // exists, or else the existing one (which might be shared with other
194 // NavigationEntries) is updated with the given parameters. 196 // NavigationEntries) is updated with the given parameters.
195 // Does nothing if there is no entry already and |url| is about:blank, since 197 // Does nothing if there is no entry already and |url| is about:blank, since
196 // that does not count as a real commit. 198 // that does not count as a real commit.
197 void AddOrUpdateFrameEntry(FrameTreeNode* frame_tree_node, 199 void AddOrUpdateFrameEntry(
198 int64_t item_sequence_number, 200 FrameTreeNode* frame_tree_node,
199 int64_t document_sequence_number, 201 int64_t item_sequence_number,
200 SiteInstanceImpl* site_instance, 202 int64_t document_sequence_number,
201 const GURL& url, 203 SiteInstanceImpl* site_instance,
202 const Referrer& referrer, 204 scoped_refptr<SiteInstanceImpl> source_site_instance,
203 const PageState& page_state, 205 const GURL& url,
204 const std::string& method, 206 const Referrer& referrer,
205 int64_t post_id); 207 const PageState& page_state,
208 const std::string& method,
209 int64_t post_id);
206 210
207 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if 211 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if
208 // there is one in this NavigationEntry. 212 // there is one in this NavigationEntry.
209 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; 213 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const;
210 214
211 void set_unique_id(int unique_id) { 215 void set_unique_id(int unique_id) {
212 unique_id_ = unique_id; 216 unique_id_ = unique_id;
213 } 217 }
214 218
215 // The SiteInstance represents which pages must share processes. This is a 219 // The SiteInstance represents which pages must share processes. This is a
216 // reference counted pointer to a shared SiteInstance. 220 // reference counted pointer to a shared SiteInstance.
217 // 221 //
218 // Note that the SiteInstance should usually not be changed after it is set, 222 // Note that the SiteInstance should usually not be changed after it is set,
219 // but this may happen if the NavigationEntry was cloned and needs to use a 223 // but this may happen if the NavigationEntry was cloned and needs to use a
220 // different SiteInstance. 224 // different SiteInstance.
221 void set_site_instance(scoped_refptr<SiteInstanceImpl> site_instance); 225 void set_site_instance(scoped_refptr<SiteInstanceImpl> site_instance);
222 SiteInstanceImpl* site_instance() const { 226 SiteInstanceImpl* site_instance() const {
223 return frame_tree_->frame_entry->site_instance(); 227 return frame_tree_->frame_entry->site_instance();
224 } 228 }
225 229
226 // The |source_site_instance| is used to identify the SiteInstance of the 230 // The |source_site_instance| is used to identify the SiteInstance of the
227 // frame that initiated the navigation. 231 // frame that initiated the navigation. It is set on the
228 void set_source_site_instance(SiteInstanceImpl* source_site_instance); 232 // FrameNavigationEntry for the main frame.
229 SiteInstanceImpl* source_site_instance() const { 233 void set_source_site_instance(
230 return source_site_instance_.get(); 234 scoped_refptr<SiteInstanceImpl> source_site_instance) {
235 root_node()->frame_entry->set_source_site_instance(
236 source_site_instance.get());
231 } 237 }
232 238
233 // Remember the set of bindings granted to this NavigationEntry at the time 239 // Remember the set of bindings granted to this NavigationEntry at the time
234 // of commit, to ensure that we do not grant it additional bindings if we 240 // of commit, to ensure that we do not grant it additional bindings if we
235 // navigate back to it in the future. This can only be changed once. 241 // navigate back to it in the future. This can only be changed once.
236 void SetBindings(int bindings); 242 void SetBindings(int bindings);
237 int bindings() const { 243 int bindings() const {
238 return bindings_; 244 return bindings_;
239 } 245 }
240 246
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // page. This screenshot is displayed during an overscroll-navigation 417 // page. This screenshot is displayed during an overscroll-navigation
412 // gesture. |screenshot_| will be NULL when the screenshot is not available 418 // gesture. |screenshot_| will be NULL when the screenshot is not available
413 // (e.g. after a session restore, or if taking the screenshot of a page 419 // (e.g. after a session restore, or if taking the screenshot of a page
414 // failed). The UI is responsible for dealing with missing screenshots 420 // failed). The UI is responsible for dealing with missing screenshots
415 // appropriately (e.g. display a placeholder image instead). 421 // appropriately (e.g. display a placeholder image instead).
416 scoped_refptr<base::RefCountedBytes> screenshot_; 422 scoped_refptr<base::RefCountedBytes> screenshot_;
417 423
418 // This member is not persisted with session restore. 424 // This member is not persisted with session restore.
419 std::string extra_headers_; 425 std::string extra_headers_;
420 426
421 // This member is cleared in |ResetForCommit| and not persisted.
422 scoped_refptr<SiteInstanceImpl> source_site_instance_;
423
424 // Used for specifying base URL for pages loaded via data URLs. Only used and 427 // Used for specifying base URL for pages loaded via data URLs. Only used and
425 // persisted by Android WebView. 428 // persisted by Android WebView.
426 GURL base_url_for_data_url_; 429 GURL base_url_for_data_url_;
427 430
428 #if defined(OS_ANDROID) 431 #if defined(OS_ANDROID)
429 // Used for passing really big data URLs from browser to renderers. Only used 432 // Used for passing really big data URLs from browser to renderers. Only used
430 // and persisted by Android WebView. 433 // and persisted by Android WebView.
431 scoped_refptr<const base::RefCountedString> data_url_as_string_; 434 scoped_refptr<const base::RefCountedString> data_url_as_string_;
432 #endif 435 #endif
433 436
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 // persisted, unless specific data is taken out/put back in at save/restore 502 // persisted, unless specific data is taken out/put back in at save/restore
500 // time (see TabNavigation for an example of this). 503 // time (see TabNavigation for an example of this).
501 std::map<std::string, base::string16> extra_data_; 504 std::map<std::string, base::string16> extra_data_;
502 505
503 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); 506 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl);
504 }; 507 };
505 508
506 } // namespace content 509 } // namespace content
507 510
508 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ 511 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl.cc ('k') | content/browser/frame_host/navigation_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698