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

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: 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 RequestNavigationParams ConstructRequestNavigationParams( 169 RequestNavigationParams ConstructRequestNavigationParams(
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.
Charlie Reis 2016/05/04 23:03:01 Mention what |frame_entry| is, and that it can be
nasko 2016/05/05 17:51:33 Done.
180 void ResetForCommit(); 180 void ResetForCommit(FrameNavigationEntry* frame_entry);
181 181
182 // Exposes the tree of FrameNavigationEntries that make up this joint session 182 // Exposes the tree of FrameNavigationEntries that make up this joint session
183 // history item. 183 // history item.
184 // In default Chrome, this tree only has a root node with an unshared 184 // In default Chrome, this tree only has a root node with an unshared
185 // FrameNavigationEntry. Subframes are only added to the tree if the 185 // FrameNavigationEntry. Subframes are only added to the tree if the
186 // --site-per-process flag is passed. 186 // --site-per-process flag is passed.
187 TreeNode* root_node() const { 187 TreeNode* root_node() const {
188 return frame_tree_.get(); 188 return frame_tree_.get();
189 } 189 }
190 190
191 // Finds the TreeNode associated with |frame_tree_node_id| to add or update 191 // Finds the TreeNode associated with |frame_tree_node_id| to add or update
192 // its FrameNavigationEntry. A new FrameNavigationEntry is added if none 192 // its FrameNavigationEntry. A new FrameNavigationEntry is added if none
193 // exists, or else the existing one (which might be shared with other 193 // exists, or else the existing one (which might be shared with other
194 // NavigationEntries) is updated with the given parameters. 194 // NavigationEntries) is updated with the given parameters.
195 // Does nothing if there is no entry already and |url| is about:blank, since 195 // Does nothing if there is no entry already and |url| is about:blank, since
196 // that does not count as a real commit. 196 // that does not count as a real commit.
197 void AddOrUpdateFrameEntry(FrameTreeNode* frame_tree_node, 197 void AddOrUpdateFrameEntry(FrameTreeNode* frame_tree_node,
198 int64_t item_sequence_number, 198 int64_t item_sequence_number,
199 int64_t document_sequence_number, 199 int64_t document_sequence_number,
200 SiteInstanceImpl* source_site_instance,
Charlie Reis 2016/05/04 23:03:01 As in FNE, let's list site_instance before source_
nasko 2016/05/05 17:51:33 Done.
200 SiteInstanceImpl* site_instance, 201 SiteInstanceImpl* site_instance,
201 const GURL& url, 202 const GURL& url,
202 const Referrer& referrer, 203 const Referrer& referrer,
203 const PageState& page_state, 204 const PageState& page_state,
204 const std::string& method, 205 const std::string& method,
205 int64_t post_id); 206 int64_t post_id);
206 207
207 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if 208 // Returns the FrameNavigationEntry corresponding to |frame_tree_node|, if
208 // there is one in this NavigationEntry. 209 // there is one in this NavigationEntry.
209 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const; 210 FrameNavigationEntry* GetFrameEntry(FrameTreeNode* frame_tree_node) const;
210 211
211 void set_unique_id(int unique_id) { 212 void set_unique_id(int unique_id) {
212 unique_id_ = unique_id; 213 unique_id_ = unique_id;
213 } 214 }
214 215
215 // The SiteInstance represents which pages must share processes. This is a 216 // The SiteInstance represents which pages must share processes. This is a
216 // reference counted pointer to a shared SiteInstance. 217 // reference counted pointer to a shared SiteInstance.
217 // 218 //
218 // Note that the SiteInstance should usually not be changed after it is set, 219 // 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 220 // but this may happen if the NavigationEntry was cloned and needs to use a
220 // different SiteInstance. 221 // different SiteInstance.
221 void set_site_instance(scoped_refptr<SiteInstanceImpl> site_instance); 222 void set_site_instance(scoped_refptr<SiteInstanceImpl> site_instance);
222 SiteInstanceImpl* site_instance() const { 223 SiteInstanceImpl* site_instance() const {
223 return frame_tree_->frame_entry->site_instance(); 224 return frame_tree_->frame_entry->site_instance();
224 } 225 }
225 226
226 // The |source_site_instance| is used to identify the SiteInstance of the
227 // frame that initiated the navigation.
228 void set_source_site_instance(SiteInstanceImpl* source_site_instance);
229 SiteInstanceImpl* source_site_instance() const {
230 return source_site_instance_.get();
231 }
232
233 // Remember the set of bindings granted to this NavigationEntry at the time 227 // 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 228 // 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. 229 // navigate back to it in the future. This can only be changed once.
236 void SetBindings(int bindings); 230 void SetBindings(int bindings);
237 int bindings() const { 231 int bindings() const {
238 return bindings_; 232 return bindings_;
239 } 233 }
240 234
241 void set_page_type(PageType page_type) { 235 void set_page_type(PageType page_type) {
242 page_type_ = page_type; 236 page_type_ = page_type;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // page. This screenshot is displayed during an overscroll-navigation 405 // page. This screenshot is displayed during an overscroll-navigation
412 // gesture. |screenshot_| will be NULL when the screenshot is not available 406 // 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 407 // (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 408 // failed). The UI is responsible for dealing with missing screenshots
415 // appropriately (e.g. display a placeholder image instead). 409 // appropriately (e.g. display a placeholder image instead).
416 scoped_refptr<base::RefCountedBytes> screenshot_; 410 scoped_refptr<base::RefCountedBytes> screenshot_;
417 411
418 // This member is not persisted with session restore. 412 // This member is not persisted with session restore.
419 std::string extra_headers_; 413 std::string extra_headers_;
420 414
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 415 // Used for specifying base URL for pages loaded via data URLs. Only used and
425 // persisted by Android WebView. 416 // persisted by Android WebView.
426 GURL base_url_for_data_url_; 417 GURL base_url_for_data_url_;
427 418
428 #if defined(OS_ANDROID) 419 #if defined(OS_ANDROID)
429 // Used for passing really big data URLs from browser to renderers. Only used 420 // Used for passing really big data URLs from browser to renderers. Only used
430 // and persisted by Android WebView. 421 // and persisted by Android WebView.
431 scoped_refptr<const base::RefCountedString> data_url_as_string_; 422 scoped_refptr<const base::RefCountedString> data_url_as_string_;
432 #endif 423 #endif
433 424
(...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 490 // persisted, unless specific data is taken out/put back in at save/restore
500 // time (see TabNavigation for an example of this). 491 // time (see TabNavigation for an example of this).
501 std::map<std::string, base::string16> extra_data_; 492 std::map<std::string, base::string16> extra_data_;
502 493
503 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); 494 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl);
504 }; 495 };
505 496
506 } // namespace content 497 } // namespace content
507 498
508 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ 499 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698