OLD | NEW |
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GURL& url, | 54 const GURL& url, |
55 const Referrer& referrer, | 55 const Referrer& referrer, |
| 56 const std::vector<GURL>& redirect_chain, |
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. |
64 // | 65 // |
65 // This is unique relative to other frames in the same page, but not among | 66 // This is unique relative to other frames in the same page, but not among |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 104 |
104 // The actual URL loaded in the frame. This is in contrast to the virtual | 105 // The actual URL loaded in the frame. This is in contrast to the virtual |
105 // URL, which is shown to the user. | 106 // URL, which is shown to the user. |
106 void set_url(const GURL& url) { url_ = url; } | 107 void set_url(const GURL& url) { url_ = url; } |
107 const GURL& url() const { return url_; } | 108 const GURL& url() const { return url_; } |
108 | 109 |
109 // The referring URL. Can be empty. | 110 // The referring URL. Can be empty. |
110 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } | 111 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } |
111 const Referrer& referrer() const { return referrer_; } | 112 const Referrer& referrer() const { return referrer_; } |
112 | 113 |
| 114 // The redirect chain traversed during this frame navigation, from the initial |
| 115 // redirecting URL to the final non-redirecting current URL. |
| 116 void set_redirect_chain(const std::vector<GURL>& redirect_chain) { |
| 117 redirect_chain_ = redirect_chain; |
| 118 } |
| 119 const std::vector<GURL>& redirect_chain() const { return redirect_chain_; } |
| 120 |
113 void SetPageState(const PageState& page_state); | 121 void SetPageState(const PageState& page_state); |
114 const PageState& page_state() const { return page_state_; } | 122 const PageState& page_state() const { return page_state_; } |
115 | 123 |
116 // The HTTP method used to navigate. | 124 // The HTTP method used to navigate. |
117 const std::string& method() const { return method_; } | 125 const std::string& method() const { return method_; } |
118 void set_method(const std::string& method) { method_ = method; } | 126 void set_method(const std::string& method) { method_ = method; } |
119 | 127 |
120 // The id of the post corresponding to this navigation or -1 if the | 128 // The id of the post corresponding to this navigation or -1 if the |
121 // navigation was not a POST. | 129 // navigation was not a POST. |
122 int64_t post_id() const { return post_id_; } | 130 int64_t post_id() const { return post_id_; } |
(...skipping 15 matching lines...) Expand all Loading... |
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_; |
146 GURL url_; | 154 GURL url_; |
147 Referrer referrer_; | 155 Referrer referrer_; |
| 156 // This is used when transferring a pending entry from one process to another. |
| 157 // We also send the main frame's redirect chain through session sync for |
| 158 // offline analysis. |
| 159 // It is preserved after commit but should not be persisted. |
| 160 std::vector<GURL> redirect_chain_; |
148 // TODO(creis): Change this to FrameState. | 161 // TODO(creis): Change this to FrameState. |
149 PageState page_state_; | 162 PageState page_state_; |
150 std::string method_; | 163 std::string method_; |
151 int64_t post_id_; | 164 int64_t post_id_; |
152 | 165 |
153 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); | 166 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); |
154 }; | 167 }; |
155 | 168 |
156 } // namespace content | 169 } // namespace content |
157 | 170 |
158 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ | 171 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ |
OLD | NEW |