| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 89 virtual void SetRedirectChain(const std::vector<GURL>& redirects) OVERRIDE; |
| 90 virtual const std::vector<GURL>& GetRedirectChain() const OVERRIDE; | 90 virtual const std::vector<GURL>& GetRedirectChain() const OVERRIDE; |
| 91 virtual bool IsRestored() const OVERRIDE; | 91 virtual bool IsRestored() const OVERRIDE; |
| 92 virtual bool GetXssDetected() const OVERRIDE; | |
| 93 | 92 |
| 94 // 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 |
| 95 // pieces of non-persisted state, as documented on the members below. | 94 // pieces of non-persisted state, as documented on the members below. |
| 96 void ResetForCommit(); | 95 void ResetForCommit(); |
| 97 | 96 |
| 98 void set_unique_id(int unique_id) { | 97 void set_unique_id(int unique_id) { |
| 99 unique_id_ = unique_id; | 98 unique_id_ = unique_id; |
| 100 } | 99 } |
| 101 | 100 |
| 102 // The SiteInstance tells us how to share sub-processes. This is a reference | 101 // The SiteInstance tells us how to share sub-processes. This is a reference |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 211 |
| 213 // Indicates which FrameTreeNode to navigate. Currently only used if the | 212 // Indicates which FrameTreeNode to navigate. Currently only used if the |
| 214 // --site-per-process flag is passed. | 213 // --site-per-process flag is passed. |
| 215 int64 frame_tree_node_id() const { | 214 int64 frame_tree_node_id() const { |
| 216 return frame_tree_node_id_; | 215 return frame_tree_node_id_; |
| 217 } | 216 } |
| 218 void set_frame_tree_node_id(int64 frame_tree_node_id) { | 217 void set_frame_tree_node_id(int64 frame_tree_node_id) { |
| 219 frame_tree_node_id_ = frame_tree_node_id; | 218 frame_tree_node_id_ = frame_tree_node_id; |
| 220 } | 219 } |
| 221 | 220 |
| 222 // Called when an XSS detected by Blink's XSSAuditor caused the page to | |
| 223 // be blocked. | |
| 224 void set_xss_detected(bool xss_detected) { | |
| 225 xss_detected_ = xss_detected; | |
| 226 } | |
| 227 | |
| 228 private: | 221 private: |
| 229 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 222 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 230 // Session/Tab restore save portions of this class so that it can be recreated | 223 // Session/Tab restore save portions of this class so that it can be recreated |
| 231 // later. If you add a new field that needs to be persisted you'll have to | 224 // later. If you add a new field that needs to be persisted you'll have to |
| 232 // update SessionService/TabRestoreService and Android WebView | 225 // update SessionService/TabRestoreService and Android WebView |
| 233 // state_serializer.cc appropriately. | 226 // state_serializer.cc appropriately. |
| 234 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 227 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 235 | 228 |
| 236 // See the accessors above for descriptions. | 229 // See the accessors above for descriptions. |
| 237 int unique_id_; | 230 int unique_id_; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 329 // value is not needed after the entry commits and is not persisted. | 322 // value is not needed after the entry commits and is not persisted. |
| 330 bool can_load_local_resources_; | 323 bool can_load_local_resources_; |
| 331 | 324 |
| 332 // Set when this entry was blocked by Blink's XSSAuditor. | |
| 333 // TODO(tsepez): persist xss_detected_ (see WARNING section above). | |
| 334 bool xss_detected_; | |
| 335 | |
| 336 // If not empty, the name of the frame to navigate. This field is not | 325 // If not empty, the name of the frame to navigate. This field is not |
| 337 // persisted, because it is currently only used in tests. | 326 // persisted, because it is currently only used in tests. |
| 338 std::string frame_to_navigate_; | 327 std::string frame_to_navigate_; |
| 339 | 328 |
| 340 // If not -1, this indicates which FrameTreeNode to navigate. This field is | 329 // If not -1, this indicates which FrameTreeNode to navigate. This field is |
| 341 // not persisted because it is experimental and only used when the | 330 // not persisted because it is experimental and only used when the |
| 342 // --site-per-process flag is passed. It is cleared in |ResetForCommit| | 331 // --site-per-process flag is passed. It is cleared in |ResetForCommit| |
| 343 // because we only use it while the navigation is pending. | 332 // because we only use it while the navigation is pending. |
| 344 // TODO(creis): Move this to FrameNavigationEntry. | 333 // TODO(creis): Move this to FrameNavigationEntry. |
| 345 int64 frame_tree_node_id_; | 334 int64 frame_tree_node_id_; |
| 346 | 335 |
| 347 // Used to store extra data to support browser features. This member is not | 336 // Used to store extra data to support browser features. This member is not |
| 348 // 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 |
| 349 // time (see TabNavigation for an example of this). | 338 // time (see TabNavigation for an example of this). |
| 350 std::map<std::string, base::string16> extra_data_; | 339 std::map<std::string, base::string16> extra_data_; |
| 351 | 340 |
| 352 // Copy and assignment is explicitly allowed for this class. | 341 // Copy and assignment is explicitly allowed for this class. |
| 353 }; | 342 }; |
| 354 | 343 |
| 355 } // namespace content | 344 } // namespace content |
| 356 | 345 |
| 357 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 346 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
| OLD | NEW |