| 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 | 91 |
| 90 // Once a navigation entry is committed, we should no longer track several | 92 // Once a navigation entry is committed, we should no longer track several |
| 91 // pieces of non-persisted state, as documented on the members below. | 93 // pieces of non-persisted state, as documented on the members below. |
| 92 void ResetForCommit(); | 94 void ResetForCommit(); |
| 93 | 95 |
| 94 void set_unique_id(int unique_id) { | 96 void set_unique_id(int unique_id) { |
| 95 unique_id_ = unique_id; | 97 unique_id_ = unique_id; |
| 96 } | 98 } |
| 97 | 99 |
| 98 // The SiteInstance tells us how to share sub-processes. This is a reference | 100 // The SiteInstance tells us how to share sub-processes. This is a reference |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // Whether this (pending) navigation needs to replace current entry. | 187 // Whether this (pending) navigation needs to replace current entry. |
| 186 // Resets to false after commit. | 188 // Resets to false after commit. |
| 187 bool should_replace_entry() const { | 189 bool should_replace_entry() const { |
| 188 return should_replace_entry_; | 190 return should_replace_entry_; |
| 189 } | 191 } |
| 190 | 192 |
| 191 void set_should_replace_entry(bool should_replace_entry) { | 193 void set_should_replace_entry(bool should_replace_entry) { |
| 192 should_replace_entry_ = should_replace_entry; | 194 should_replace_entry_ = should_replace_entry; |
| 193 } | 195 } |
| 194 | 196 |
| 195 // Any redirects present in a pending entry when it is transferred from one | |
| 196 // process to another. Not valid after commit. | |
| 197 const std::vector<GURL>& redirect_chain() const { | |
| 198 return redirect_chain_; | |
| 199 } | |
| 200 | |
| 201 void set_redirect_chain(const std::vector<GURL>& redirect_chain) { | |
| 202 redirect_chain_ = redirect_chain; | |
| 203 } | |
| 204 | |
| 205 void SetScreenshotPNGData(scoped_refptr<base::RefCountedBytes> png_data); | 197 void SetScreenshotPNGData(scoped_refptr<base::RefCountedBytes> png_data); |
| 206 const scoped_refptr<base::RefCountedBytes> screenshot() const { | 198 const scoped_refptr<base::RefCountedBytes> screenshot() const { |
| 207 return screenshot_; | 199 return screenshot_; |
| 208 } | 200 } |
| 209 | 201 |
| 210 // Whether this (pending) navigation should clear the session history. Resets | 202 // Whether this (pending) navigation should clear the session history. Resets |
| 211 // to false after commit. | 203 // to false after commit. |
| 212 bool should_clear_history_list() const { | 204 bool should_clear_history_list() const { |
| 213 return should_clear_history_list_; | 205 return should_clear_history_list_; |
| 214 } | 206 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 SSLStatus ssl_; | 242 SSLStatus ssl_; |
| 251 PageTransition transition_type_; | 243 PageTransition transition_type_; |
| 252 GURL user_typed_url_; | 244 GURL user_typed_url_; |
| 253 bool has_post_data_; | 245 bool has_post_data_; |
| 254 int64 post_id_; | 246 int64 post_id_; |
| 255 RestoreType restore_type_; | 247 RestoreType restore_type_; |
| 256 GURL original_request_url_; | 248 GURL original_request_url_; |
| 257 bool is_overriding_user_agent_; | 249 bool is_overriding_user_agent_; |
| 258 base::Time timestamp_; | 250 base::Time timestamp_; |
| 259 int http_status_code_; | 251 int http_status_code_; |
| 252 std::vector<GURL> redirect_chain_; |
| 260 | 253 |
| 261 // This member is not persisted with session restore because it is transient. | 254 // This member is not persisted with session restore because it is transient. |
| 262 // If the post request succeeds, this field is cleared since the same | 255 // If the post request succeeds, this field is cleared since the same |
| 263 // information is stored in |content_state_| above. It is also only shallow | 256 // information is stored in |content_state_| above. It is also only shallow |
| 264 // copied with compiler provided copy constructor. | 257 // copied with compiler provided copy constructor. |
| 265 // Cleared in |ResetForCommit|. | 258 // Cleared in |ResetForCommit|. |
| 266 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_; | 259 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_; |
| 267 | 260 |
| 268 // This is also a transient member (i.e. is not persisted with session | 261 // This is also a transient member (i.e. is not persisted with session |
| 269 // restore). The screenshot of a page is taken when navigating away from the | 262 // restore). The screenshot of a page is taken when navigating away from the |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // the state of the URL, it has to be reloaded in a different site instance. | 299 // the state of the URL, it has to be reloaded in a different site instance. |
| 307 // 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 |
| 308 // 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 |
| 309 // and is cleared in |ResetForCommit|. | 302 // and is cleared in |ResetForCommit|. |
| 310 // | 303 // |
| 311 // 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 |
| 312 // browser will replace the current navigation entry (which is the page | 305 // browser will replace the current navigation entry (which is the page |
| 313 // doing the redirect). | 306 // doing the redirect). |
| 314 bool should_replace_entry_; | 307 bool should_replace_entry_; |
| 315 | 308 |
| 316 // This is used when transferring a pending entry from one process to another. | |
| 317 // It is cleared in |ResetForCommit| and should not be persisted. | |
| 318 std::vector<GURL> redirect_chain_; | |
| 319 | |
| 320 // This is set to true when this entry's navigation should clear the session | 309 // This is set to true when this entry's navigation should clear the session |
| 321 // history both on the renderer and browser side. The browser side history | 310 // history both on the renderer and browser side. The browser side history |
| 322 // won't be cleared until the renderer has committed this navigation. This | 311 // won't be cleared until the renderer has committed this navigation. This |
| 323 // entry is not persisted by the session restore system, as it is always | 312 // entry is not persisted by the session restore system, as it is always |
| 324 // cleared in |ResetForCommit|. | 313 // cleared in |ResetForCommit|. |
| 325 bool should_clear_history_list_; | 314 bool should_clear_history_list_; |
| 326 | 315 |
| 327 // Set when this entry should be able to access local file:// resources. This | 316 // Set when this entry should be able to access local file:// resources. This |
| 328 // value is not needed after the entry commits and is not persisted. | 317 // value is not needed after the entry commits and is not persisted. |
| 329 bool can_load_local_resources_; | 318 bool can_load_local_resources_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 343 // persisted, unless specific data is taken out/put back in at save/restore | 332 // persisted, unless specific data is taken out/put back in at save/restore |
| 344 // time (see TabNavigation for an example of this). | 333 // time (see TabNavigation for an example of this). |
| 345 std::map<std::string, base::string16> extra_data_; | 334 std::map<std::string, base::string16> extra_data_; |
| 346 | 335 |
| 347 // Copy and assignment is explicitly allowed for this class. | 336 // Copy and assignment is explicitly allowed for this class. |
| 348 }; | 337 }; |
| 349 | 338 |
| 350 } // namespace content | 339 } // namespace content |
| 351 | 340 |
| 352 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 341 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
| OLD | NEW |