| 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 "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" |
| 11 #include "content/common/page_state_serialization.h" |
| 11 #include "content/public/common/page_state.h" | 12 #include "content/public/common/page_state.h" |
| 12 #include "content/public/common/referrer.h" | 13 #include "content/public/common/referrer.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 // Represents a session history item for a particular frame. | 17 // Represents a session history item for a particular frame. |
| 17 // | 18 // |
| 18 // This class is refcounted and can be shared across multiple NavigationEntries. | 19 // This class is refcounted and can be shared across multiple NavigationEntries. |
| 19 // For now, it is owned by a single NavigationEntry and only tracks the main | 20 // For now, it is owned by a single NavigationEntry and only tracks the main |
| 20 // frame. | 21 // frame. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 // independently from the original. | 40 // independently from the original. |
| 40 FrameNavigationEntry* Clone() const; | 41 FrameNavigationEntry* Clone() const; |
| 41 | 42 |
| 42 // Updates all the members of this entry. | 43 // Updates all the members of this entry. |
| 43 void UpdateEntry(const std::string& frame_unique_name, | 44 void UpdateEntry(const std::string& frame_unique_name, |
| 44 int64 item_sequence_number, | 45 int64 item_sequence_number, |
| 45 int64 document_sequence_number, | 46 int64 document_sequence_number, |
| 46 SiteInstanceImpl* site_instance, | 47 SiteInstanceImpl* site_instance, |
| 47 const GURL& url, | 48 const GURL& url, |
| 48 const Referrer& referrer, | 49 const Referrer& referrer, |
| 49 const PageState& page_state); | 50 const ExplodedFrameState& page_state); |
| 50 | 51 |
| 51 // The ID of the FrameTreeNode this entry is for. -1 for the main frame, | 52 // The ID of the FrameTreeNode this entry is for. -1 for the main frame, |
| 52 // since we don't always know the FrameTreeNode ID when creating the overall | 53 // since we don't always know the FrameTreeNode ID when creating the overall |
| 53 // NavigationEntry. | 54 // NavigationEntry. |
| 54 // TODO(creis): Consider removing |frame_tree_node_id| in favor of | 55 // TODO(creis): Consider removing |frame_tree_node_id| in favor of |
| 55 // |frame_unique_name|, if we can move unique name computation to the browser | 56 // |frame_unique_name|, if we can move unique name computation to the browser |
| 56 // process. | 57 // process. |
| 57 int frame_tree_node_id() const { return frame_tree_node_id_; } | 58 int frame_tree_node_id() const { return frame_tree_node_id_; } |
| 58 void set_frame_tree_node_id(int frame_tree_node_id) { | 59 void set_frame_tree_node_id(int frame_tree_node_id) { |
| 59 frame_tree_node_id_ = frame_tree_node_id; | 60 frame_tree_node_id_ = frame_tree_node_id; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 94 |
| 94 // The actual URL loaded in the frame. This is in contrast to the virtual | 95 // The actual URL loaded in the frame. This is in contrast to the virtual |
| 95 // URL, which is shown to the user. | 96 // URL, which is shown to the user. |
| 96 void set_url(const GURL& url) { url_ = url; } | 97 void set_url(const GURL& url) { url_ = url; } |
| 97 const GURL& url() const { return url_; } | 98 const GURL& url() const { return url_; } |
| 98 | 99 |
| 99 // The referring URL. Can be empty. | 100 // The referring URL. Can be empty. |
| 100 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } | 101 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } |
| 101 const Referrer& referrer() const { return referrer_; } | 102 const Referrer& referrer() const { return referrer_; } |
| 102 | 103 |
| 103 void set_page_state(const PageState& page_state) { page_state_ = page_state; } | 104 void set_frame_state(const ExplodedFrameState& frame_state) { |
| 104 const PageState& page_state() const { return page_state_; } | 105 frame_state_ = frame_state; |
| 106 } |
| 107 const ExplodedFrameState& frame_state() const { return frame_state_; } |
| 105 | 108 |
| 106 private: | 109 private: |
| 107 friend class base::RefCounted<FrameNavigationEntry>; | 110 friend class base::RefCounted<FrameNavigationEntry>; |
| 108 virtual ~FrameNavigationEntry(); | 111 virtual ~FrameNavigationEntry(); |
| 109 | 112 |
| 110 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 113 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 111 // Add all new fields to |UpdateEntry|. | 114 // Add all new fields to |UpdateEntry|. |
| 112 // TODO(creis): These fields have implications for session restore. This is | 115 // TODO(creis): These fields have implications for session restore. This is |
| 113 // currently managed by NavigationEntry, but the logic will move here. | 116 // currently managed by NavigationEntry, but the logic will move here. |
| 117 // TODO(creis): Update this comment. |
| 114 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 118 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 115 | 119 |
| 116 // See the accessors above for descriptions. | 120 // See the accessors above for descriptions. |
| 117 int frame_tree_node_id_; | 121 int frame_tree_node_id_; |
| 118 std::string frame_unique_name_; | 122 std::string frame_unique_name_; |
| 119 int64 item_sequence_number_; | 123 int64 item_sequence_number_; |
| 120 int64 document_sequence_number_; | 124 int64 document_sequence_number_; |
| 121 scoped_refptr<SiteInstanceImpl> site_instance_; | 125 scoped_refptr<SiteInstanceImpl> site_instance_; |
| 122 GURL url_; | 126 GURL url_; |
| 123 Referrer referrer_; | 127 Referrer referrer_; |
| 124 // TODO(creis): Change this to FrameState. | 128 // TODO(creis): Drop ISN/DSN; add list of referenced files. |
| 125 PageState page_state_; | 129 ExplodedFrameState frame_state_; |
| 126 | 130 |
| 127 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); | 131 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 } // namespace content | 134 } // namespace content |
| 131 | 135 |
| 132 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ | 136 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ |
| OLD | NEW |