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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "content/browser/site_instance_impl.h" | 12 #include "content/browser/site_instance_impl.h" |
| 13 #include "content/common/resource_request_body.h" |
13 #include "content/public/common/page_state.h" | 14 #include "content/public/common/page_state.h" |
14 #include "content/public/common/referrer.h" | 15 #include "content/public/common/referrer.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 // Represents a session history item for a particular frame. It is matched with | 19 // Represents a session history item for a particular frame. It is matched with |
19 // corresponding FrameTreeNodes using unique name (or by the root position). | 20 // corresponding FrameTreeNodes using unique name (or by the root position). |
20 // | 21 // |
21 // This class is refcounted and can be shared across multiple NavigationEntries. | 22 // This class is refcounted and can be shared across multiple NavigationEntries. |
22 // For now, it is owned by a single NavigationEntry and only tracks the main | 23 // For now, it is owned by a single NavigationEntry and only tracks the main |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 101 |
101 // The HTTP method used to navigate. | 102 // The HTTP method used to navigate. |
102 const std::string& method() const { return method_; } | 103 const std::string& method() const { return method_; } |
103 void set_method(const std::string& method) { method_ = method; } | 104 void set_method(const std::string& method) { method_ = method; } |
104 | 105 |
105 // The id of the post corresponding to this navigation or -1 if the | 106 // The id of the post corresponding to this navigation or -1 if the |
106 // navigation was not a POST. | 107 // navigation was not a POST. |
107 int64_t post_id() const { return post_id_; } | 108 int64_t post_id() const { return post_id_; } |
108 void set_post_id(int64_t post_id) { post_id_ = post_id; } | 109 void set_post_id(int64_t post_id) { post_id_ = post_id; } |
109 | 110 |
| 111 // The data sent during a POST navigation. Returns nullptr if the navigation |
| 112 // is not a POST. |
| 113 scoped_refptr<ResourceRequestBody> GetPostData() const; |
| 114 |
110 private: | 115 private: |
111 friend class base::RefCounted<FrameNavigationEntry>; | 116 friend class base::RefCounted<FrameNavigationEntry>; |
112 virtual ~FrameNavigationEntry(); | 117 virtual ~FrameNavigationEntry(); |
113 | 118 |
114 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 119 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
115 // Add all new fields to |UpdateEntry|. | 120 // Add all new fields to |UpdateEntry|. |
116 // TODO(creis): These fields have implications for session restore. This is | 121 // TODO(creis): These fields have implications for session restore. This is |
117 // currently managed by NavigationEntry, but the logic will move here. | 122 // currently managed by NavigationEntry, but the logic will move here. |
118 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 123 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
119 | 124 |
120 // See the accessors above for descriptions. | 125 // See the accessors above for descriptions. |
121 std::string frame_unique_name_; | 126 std::string frame_unique_name_; |
122 int64_t item_sequence_number_; | 127 int64_t item_sequence_number_; |
123 int64_t document_sequence_number_; | 128 int64_t document_sequence_number_; |
124 scoped_refptr<SiteInstanceImpl> site_instance_; | 129 scoped_refptr<SiteInstanceImpl> site_instance_; |
125 GURL url_; | 130 GURL url_; |
126 Referrer referrer_; | 131 Referrer referrer_; |
127 // TODO(creis): Change this to FrameState. | 132 // TODO(creis): Change this to FrameState. |
128 PageState page_state_; | 133 PageState page_state_; |
129 std::string method_; | 134 std::string method_; |
130 int64_t post_id_; | 135 int64_t post_id_; |
131 | 136 |
132 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); | 137 DISALLOW_COPY_AND_ASSIGN(FrameNavigationEntry); |
133 }; | 138 }; |
134 | 139 |
135 } // namespace content | 140 } // namespace content |
136 | 141 |
137 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ | 142 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ |
OLD | NEW |