OLD | NEW |
---|---|
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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/browser/site_instance_impl.h" | 10 #include "content/browser/site_instance_impl.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 virtual bool GetCanLoadLocalResources() const OVERRIDE; | 79 virtual bool GetCanLoadLocalResources() const OVERRIDE; |
80 virtual void SetFrameToNavigate(const std::string& frame_name) OVERRIDE; | 80 virtual void SetFrameToNavigate(const std::string& frame_name) OVERRIDE; |
81 virtual const std::string& GetFrameToNavigate() const OVERRIDE; | 81 virtual const std::string& GetFrameToNavigate() const OVERRIDE; |
82 virtual void SetExtraData(const std::string& key, | 82 virtual void SetExtraData(const std::string& key, |
83 const base::string16& data) OVERRIDE; | 83 const base::string16& data) OVERRIDE; |
84 virtual bool GetExtraData(const std::string& key, | 84 virtual bool GetExtraData(const std::string& key, |
85 base::string16* data) const OVERRIDE; | 85 base::string16* data) const OVERRIDE; |
86 virtual void ClearExtraData(const std::string& key) OVERRIDE; | 86 virtual void ClearExtraData(const std::string& key) OVERRIDE; |
87 virtual void SetHttpStatusCode(int http_status_code) OVERRIDE; | 87 virtual void SetHttpStatusCode(int http_status_code) OVERRIDE; |
88 virtual int GetHttpStatusCode() const OVERRIDE; | 88 virtual int GetHttpStatusCode() const OVERRIDE; |
89 virtual void SetRedirectChain(const std::vector<GURL>& redirects) OVERRIDE; | |
90 virtual const std::vector<GURL>& GetRedirectChain() const OVERRIDE; | |
89 virtual bool IsRestored() const OVERRIDE; | 91 virtual bool IsRestored() const OVERRIDE; |
90 | 92 |
91 // Once a navigation entry is committed, we should no longer track several | 93 // Once a navigation entry is committed, we should no longer track several |
92 // pieces of non-persisted state, as documented on the members below. | 94 // pieces of non-persisted state, as documented on the members below. |
93 void ResetForCommit(); | 95 void ResetForCommit(); |
94 | 96 |
95 void set_unique_id(int unique_id) { | 97 void set_unique_id(int unique_id) { |
96 unique_id_ = unique_id; | 98 unique_id_ = unique_id; |
97 } | 99 } |
98 | 100 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 // Whether this (pending) navigation needs to replace current entry. | 188 // Whether this (pending) navigation needs to replace current entry. |
187 // Resets to false after commit. | 189 // Resets to false after commit. |
188 bool should_replace_entry() const { | 190 bool should_replace_entry() const { |
189 return should_replace_entry_; | 191 return should_replace_entry_; |
190 } | 192 } |
191 | 193 |
192 void set_should_replace_entry(bool should_replace_entry) { | 194 void set_should_replace_entry(bool should_replace_entry) { |
193 should_replace_entry_ = should_replace_entry; | 195 should_replace_entry_ = should_replace_entry; |
194 } | 196 } |
195 | 197 |
196 // Any redirects present in a pending entry when it is transferred from one | |
197 // process to another. Not valid after commit. | |
198 const std::vector<GURL>& redirect_chain() const { | |
199 return redirect_chain_; | |
200 } | |
201 | |
202 void set_redirect_chain(const std::vector<GURL>& redirect_chain) { | |
203 redirect_chain_ = redirect_chain; | |
204 } | |
205 | |
206 void SetScreenshotPNGData(scoped_refptr<base::RefCountedBytes> png_data); | 198 void SetScreenshotPNGData(scoped_refptr<base::RefCountedBytes> png_data); |
207 const scoped_refptr<base::RefCountedBytes> screenshot() const { | 199 const scoped_refptr<base::RefCountedBytes> screenshot() const { |
208 return screenshot_; | 200 return screenshot_; |
209 } | 201 } |
210 | 202 |
211 // Whether this (pending) navigation should clear the session history. Resets | 203 // Whether this (pending) navigation should clear the session history. Resets |
212 // to false after commit. | 204 // to false after commit. |
213 bool should_clear_history_list() const { | 205 bool should_clear_history_list() const { |
214 return should_clear_history_list_; | 206 return should_clear_history_list_; |
215 } | 207 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 // In such case, we must treat it as an existing navigation in the new site | 300 // In such case, we must treat it as an existing navigation in the new site |
309 // instance, instead of a new navigation. This value should not be persisted | 301 // instance, instead of a new navigation. This value should not be persisted |
310 // and is cleared in |ResetForCommit|. | 302 // and is cleared in |ResetForCommit|. |
311 // | 303 // |
312 // We also use this flag for cross-process redirect navigations, so that the | 304 // We also use this flag for cross-process redirect navigations, so that the |
313 // browser will replace the current navigation entry (which is the page | 305 // browser will replace the current navigation entry (which is the page |
314 // doing the redirect). | 306 // doing the redirect). |
315 bool should_replace_entry_; | 307 bool should_replace_entry_; |
316 | 308 |
317 // This is used when transferring a pending entry from one process to another. | 309 // This is used when transferring a pending entry from one process to another. |
318 // It is cleared in |ResetForCommit| and should not be persisted. | 310 // We also send this data through session sync for offline analysis. |
311 // It is preserved in |ResetForCommit| but should not be persisted. | |
Charlie Reis
2014/03/31 22:06:08
nit: "is preserved after commit but should not be
donnd
2014/04/01 04:36:26
Done.
| |
319 std::vector<GURL> redirect_chain_; | 312 std::vector<GURL> redirect_chain_; |
320 | 313 |
321 // This is set to true when this entry's navigation should clear the session | 314 // This is set to true when this entry's navigation should clear the session |
322 // history both on the renderer and browser side. The browser side history | 315 // history both on the renderer and browser side. The browser side history |
323 // won't be cleared until the renderer has committed this navigation. This | 316 // won't be cleared until the renderer has committed this navigation. This |
324 // entry is not persisted by the session restore system, as it is always | 317 // entry is not persisted by the session restore system, as it is always |
325 // cleared in |ResetForCommit|. | 318 // cleared in |ResetForCommit|. |
326 bool should_clear_history_list_; | 319 bool should_clear_history_list_; |
327 | 320 |
328 // Set when this entry should be able to access local file:// resources. This | 321 // Set when this entry should be able to access local file:// resources. This |
(...skipping 15 matching lines...) Expand all Loading... | |
344 // persisted, unless specific data is taken out/put back in at save/restore | 337 // persisted, unless specific data is taken out/put back in at save/restore |
345 // time (see TabNavigation for an example of this). | 338 // time (see TabNavigation for an example of this). |
346 std::map<std::string, base::string16> extra_data_; | 339 std::map<std::string, base::string16> extra_data_; |
347 | 340 |
348 // Copy and assignment is explicitly allowed for this class. | 341 // Copy and assignment is explicitly allowed for this class. |
349 }; | 342 }; |
350 | 343 |
351 } // namespace content | 344 } // namespace content |
352 | 345 |
353 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 346 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
OLD | NEW |