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

Side by Side Diff: content/browser/frame_host/frame_navigation_entry.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_FRAME_NAVIGATION_ENTRY_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 29 matching lines...) Expand all
40 int64_t post_id); 40 int64_t post_id);
41 41
42 // Creates a copy of this FrameNavigationEntry that can be modified 42 // Creates a copy of this FrameNavigationEntry that can be modified
43 // independently from the original. 43 // independently from the original.
44 FrameNavigationEntry* Clone() const; 44 FrameNavigationEntry* Clone() const;
45 45
46 // Updates all the members of this entry. 46 // Updates all the members of this entry.
47 void UpdateEntry(const std::string& frame_unique_name, 47 void UpdateEntry(const std::string& frame_unique_name,
48 int64_t item_sequence_number, 48 int64_t item_sequence_number,
49 int64_t document_sequence_number, 49 int64_t document_sequence_number,
50 SiteInstanceImpl* source_site_instance,
dcheng 2016/05/04 17:01:45 Random aside: it would be kind of nice if ownershi
nasko 2016/05/05 17:51:32 In this case we won't need to downcast, would we?
50 SiteInstanceImpl* site_instance, 51 SiteInstanceImpl* site_instance,
Charlie Reis 2016/05/04 23:03:01 nit: Please list source_site_instance after site_i
nasko 2016/05/05 17:51:32 Done.
51 const GURL& url, 52 const GURL& url,
52 const Referrer& referrer, 53 const Referrer& referrer,
53 const PageState& page_state, 54 const PageState& page_state,
54 const std::string& method, 55 const std::string& method,
55 int64_t post_id); 56 int64_t post_id);
56 57
57 // The unique name of the frame this entry is for. This is a stable name for 58 // The unique name of the frame this entry is for. This is a stable name for
58 // the frame based on its position in the tree and relation to other named 59 // the frame based on its position in the tree and relation to other named
59 // frames, which does not change after cross-process navigations or restores. 60 // frames, which does not change after cross-process navigations or restores.
60 // Only the main frame can have an empty name. 61 // Only the main frame can have an empty name.
(...skipping 18 matching lines...) Expand all
79 80
80 // The SiteInstance responsible for rendering this frame. All frames sharing 81 // The SiteInstance responsible for rendering this frame. All frames sharing
81 // a SiteInstance must live in the same process. This is a refcounted pointer 82 // a SiteInstance must live in the same process. This is a refcounted pointer
82 // that keeps the SiteInstance (not necessarily the process) alive as long as 83 // that keeps the SiteInstance (not necessarily the process) alive as long as
83 // this object remains in the session history. 84 // this object remains in the session history.
84 void set_site_instance(scoped_refptr<SiteInstanceImpl> site_instance) { 85 void set_site_instance(scoped_refptr<SiteInstanceImpl> site_instance) {
85 site_instance_ = std::move(site_instance); 86 site_instance_ = std::move(site_instance);
86 } 87 }
87 SiteInstanceImpl* site_instance() const { return site_instance_.get(); } 88 SiteInstanceImpl* site_instance() const { return site_instance_.get(); }
88 89
90 // The |source_site_instance| is used to identify the SiteInstance of the
91 // frame that initiated the navigation.
Charlie Reis 2016/05/04 23:03:01 nit: Let's mention that it is cleared after commit
nasko 2016/05/05 17:51:32 Done.
92 void set_source_site_instance(SiteInstanceImpl* source_site_instance) {
93 source_site_instance_ = source_site_instance;
94 }
95 SiteInstanceImpl* source_site_instance() const {
96 return source_site_instance_.get();
97 }
98
89 // The actual URL loaded in the frame. This is in contrast to the virtual 99 // The actual URL loaded in the frame. This is in contrast to the virtual
90 // URL, which is shown to the user. 100 // URL, which is shown to the user.
91 void set_url(const GURL& url) { url_ = url; } 101 void set_url(const GURL& url) { url_ = url; }
92 const GURL& url() const { return url_; } 102 const GURL& url() const { return url_; }
93 103
94 // The referring URL. Can be empty. 104 // The referring URL. Can be empty.
95 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } 105 void set_referrer(const Referrer& referrer) { referrer_ = referrer; }
96 const Referrer& referrer() const { return referrer_; } 106 const Referrer& referrer() const { return referrer_; }
97 107
98 void set_page_state(const PageState& page_state) { page_state_ = page_state; } 108 void set_page_state(const PageState& page_state) { page_state_ = page_state; }
(...skipping 23 matching lines...) Expand all
122 int64_t item_sequence_number_; 132 int64_t item_sequence_number_;
123 int64_t document_sequence_number_; 133 int64_t document_sequence_number_;
124 scoped_refptr<SiteInstanceImpl> site_instance_; 134 scoped_refptr<SiteInstanceImpl> site_instance_;
125 GURL url_; 135 GURL url_;
126 Referrer referrer_; 136 Referrer referrer_;
127 // TODO(creis): Change this to FrameState. 137 // TODO(creis): Change this to FrameState.
128 PageState page_state_; 138 PageState page_state_;
129 std::string method_; 139 std::string method_;
130 int64_t post_id_; 140 int64_t post_id_;
131 141
142 // This member is cleared at commit time and not persisted.
Charlie Reis 2016/05/04 23:03:01 nit: and is not
nasko 2016/05/05 17:51:32 Done.
143 scoped_refptr<SiteInstanceImpl> source_site_instance_;
144
132 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); 145 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry);
133 }; 146 };
134 147
135 } // namespace content 148 } // namespace content
136 149
137 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ 150 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698