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

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

Issue 2368183004: Move redirect_chain from NavigationEntry to FrameNavigationEntry. (Closed)
Patch Set: Created 4 years, 2 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 13 matching lines...) Expand all
24 // frame. 24 // frame.
25 // 25 //
26 // If SiteIsolationPolicy::UseSubframeNavigationEntries is true, there will be a 26 // If SiteIsolationPolicy::UseSubframeNavigationEntries is true, there will be a
27 // tree of FrameNavigationEntries in each NavigationEntry, one per frame. 27 // tree of FrameNavigationEntries in each NavigationEntry, one per frame.
28 // TODO(creis): Share these FrameNavigationEntries across NavigationEntries if 28 // TODO(creis): Share these FrameNavigationEntries across NavigationEntries if
29 // the frame hasn't changed. 29 // the frame hasn't changed.
30 class CONTENT_EXPORT FrameNavigationEntry 30 class CONTENT_EXPORT FrameNavigationEntry
31 : public base::RefCounted<FrameNavigationEntry> { 31 : public base::RefCounted<FrameNavigationEntry> {
32 public: 32 public:
33 FrameNavigationEntry(); 33 FrameNavigationEntry();
34 FrameNavigationEntry(const std::string& frame_unique_name, 34 FrameNavigationEntry(const std::string& frame_unique_name,
Charlie Reis 2016/09/28 04:13:17 I'm debating whether we should include it as a par
arthursonzogni 2016/09/28 16:36:14 I don't know. I think I didn't include it here bec
35 int64_t item_sequence_number, 35 int64_t item_sequence_number,
36 int64_t document_sequence_number, 36 int64_t document_sequence_number,
37 scoped_refptr<SiteInstanceImpl> site_instance, 37 scoped_refptr<SiteInstanceImpl> site_instance,
38 scoped_refptr<SiteInstanceImpl> source_site_instance, 38 scoped_refptr<SiteInstanceImpl> source_site_instance,
39 const GURL& url, 39 const GURL& url,
40 const Referrer& referrer, 40 const Referrer& referrer,
41 const std::string& method, 41 const std::string& method,
42 int64_t post_id); 42 int64_t post_id);
43 43
44 // Creates a copy of this FrameNavigationEntry that can be modified 44 // Creates a copy of this FrameNavigationEntry that can be modified
45 // independently from the original. 45 // independently from the original.
46 FrameNavigationEntry* Clone() const; 46 FrameNavigationEntry* Clone() const;
47 47
48 // Updates all the members of this entry. 48 // Updates all the members of this entry.
49 void UpdateEntry(const std::string& frame_unique_name, 49 void UpdateEntry(const std::string& frame_unique_name,
50 int64_t item_sequence_number, 50 int64_t item_sequence_number,
51 int64_t document_sequence_number, 51 int64_t document_sequence_number,
52 SiteInstanceImpl* site_instance, 52 SiteInstanceImpl* site_instance,
53 scoped_refptr<SiteInstanceImpl> source_site_instance, 53 scoped_refptr<SiteInstanceImpl> source_site_instance,
54 const std::vector<GURL>& redirect_chain,
Charlie Reis 2016/09/28 04:13:17 Throughout this file, we should list redirect_chai
arthursonzogni 2016/09/28 16:36:14 Done.
54 const GURL& url, 55 const GURL& url,
55 const Referrer& referrer, 56 const Referrer& referrer,
56 const PageState& page_state, 57 const PageState& page_state,
57 const std::string& method, 58 const std::string& method,
58 int64_t post_id); 59 int64_t post_id);
59 60
60 // The unique name of the frame this entry is for. This is a stable name for 61 // The unique name of the frame this entry is for. This is a stable name for
61 // the frame based on its position in the tree and relation to other named 62 // the frame based on its position in the tree and relation to other named
62 // frames, which does not change after cross-process navigations or restores. 63 // frames, which does not change after cross-process navigations or restores.
63 // Only the main frame can have an empty name. 64 // Only the main frame can have an empty name.
(...skipping 30 matching lines...) Expand all
94 // renderer-initiated navigations and is cleared once the navigation has 95 // renderer-initiated navigations and is cleared once the navigation has
95 // committed. 96 // committed.
96 void set_source_site_instance( 97 void set_source_site_instance(
97 scoped_refptr<SiteInstanceImpl> source_site_instance) { 98 scoped_refptr<SiteInstanceImpl> source_site_instance) {
98 source_site_instance_ = std::move(source_site_instance); 99 source_site_instance_ = std::move(source_site_instance);
99 } 100 }
100 SiteInstanceImpl* source_site_instance() const { 101 SiteInstanceImpl* source_site_instance() const {
101 return source_site_instance_.get(); 102 return source_site_instance_.get();
102 } 103 }
103 104
105 // The redirect chain traversed during this frame navigation, from the initial
106 // redirecting URL to the final non-redirecting current URL.
107 void set_redirect_chain(const std::vector<GURL>& redirect_chain) {
108 redirect_chain_ = redirect_chain;
109 }
110 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; }
111
104 // The actual URL loaded in the frame. This is in contrast to the virtual 112 // The actual URL loaded in the frame. This is in contrast to the virtual
105 // URL, which is shown to the user. 113 // URL, which is shown to the user.
106 void set_url(const GURL& url) { url_ = url; } 114 void set_url(const GURL& url) { url_ = url; }
107 const GURL& url() const { return url_; } 115 const GURL& url() const { return url_; }
108 116
109 // The referring URL. Can be empty. 117 // The referring URL. Can be empty.
110 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } 118 void set_referrer(const Referrer& referrer) { referrer_ = referrer; }
111 const Referrer& referrer() const { return referrer_; } 119 const Referrer& referrer() const { return referrer_; }
112 120
113 void SetPageState(const PageState& page_state); 121 void SetPageState(const PageState& page_state);
(...skipping 22 matching lines...) Expand all
136 // currently managed by NavigationEntry, but the logic will move here. 144 // currently managed by NavigationEntry, but the logic will move here.
137 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 145 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
138 146
139 // See the accessors above for descriptions. 147 // See the accessors above for descriptions.
140 std::string frame_unique_name_; 148 std::string frame_unique_name_;
141 int64_t item_sequence_number_; 149 int64_t item_sequence_number_;
142 int64_t document_sequence_number_; 150 int64_t document_sequence_number_;
143 scoped_refptr<SiteInstanceImpl> site_instance_; 151 scoped_refptr<SiteInstanceImpl> site_instance_;
144 // This member is cleared at commit time and is not persisted. 152 // This member is cleared at commit time and is not persisted.
145 scoped_refptr<SiteInstanceImpl> source_site_instance_; 153 scoped_refptr<SiteInstanceImpl> source_site_instance_;
154
155 // This is used when transferring a pending entry from one process to another.
156 // We also send this data through session sync for offline analysis.
157 // It is preserved after commit but should not be persisted.
158 std::vector<GURL> redirect_chain_;
arthursonzogni 2016/09/27 12:56:20 I am not sure of the comment message. Which senten
Charlie Reis 2016/09/28 04:13:17 The first sentence is still true (see NavigatorImp
arthursonzogni 2016/09/28 16:36:14 Thanks!
159
146 GURL url_; 160 GURL url_;
147 Referrer referrer_; 161 Referrer referrer_;
148 // TODO(creis): Change this to FrameState. 162 // TODO(creis): Change this to FrameState.
149 PageState page_state_; 163 PageState page_state_;
150 std::string method_; 164 std::string method_;
151 int64_t post_id_; 165 int64_t post_id_;
152 166
153 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); 167 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry);
154 }; 168 };
155 169
156 } // namespace content 170 } // namespace content
157 171
158 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ 172 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698