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 <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 "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/browser/frame_host/frame_navigation_entry.h" | 15 #include "content/browser/frame_host/frame_navigation_entry.h" |
16 #include "content/browser/frame_host/frame_tree_node.h" | 16 #include "content/browser/frame_host/frame_tree_node.h" |
17 #include "content/browser/site_instance_impl.h" | 17 #include "content/browser/site_instance_impl.h" |
18 #include "content/common/frame_message_enums.h" | 18 #include "content/common/frame_message_enums.h" |
| 19 #include "content/common/resource_request_body_impl.h" |
19 #include "content/public/browser/favicon_status.h" | 20 #include "content/public/browser/favicon_status.h" |
20 #include "content/public/browser/global_request_id.h" | 21 #include "content/public/browser/global_request_id.h" |
21 #include "content/public/browser/navigation_entry.h" | 22 #include "content/public/browser/navigation_entry.h" |
22 #include "content/public/common/page_state.h" | 23 #include "content/public/common/page_state.h" |
23 #include "content/public/common/ssl_status.h" | 24 #include "content/public/common/ssl_status.h" |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 class ResourceRequestBodyImpl; | 27 class ResourceRequestBodyImpl; |
27 struct CommonNavigationParams; | 28 struct CommonNavigationParams; |
28 struct RequestNavigationParams; | 29 struct RequestNavigationParams; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 int32_t GetPageID() const override; | 112 int32_t GetPageID() const override; |
112 const base::string16& GetTitleForDisplay() const override; | 113 const base::string16& GetTitleForDisplay() const override; |
113 bool IsViewSourceMode() const override; | 114 bool IsViewSourceMode() const override; |
114 void SetTransitionType(ui::PageTransition transition_type) override; | 115 void SetTransitionType(ui::PageTransition transition_type) override; |
115 ui::PageTransition GetTransitionType() const override; | 116 ui::PageTransition GetTransitionType() const override; |
116 const GURL& GetUserTypedURL() const override; | 117 const GURL& GetUserTypedURL() const override; |
117 void SetHasPostData(bool has_post_data) override; | 118 void SetHasPostData(bool has_post_data) override; |
118 bool GetHasPostData() const override; | 119 bool GetHasPostData() const override; |
119 void SetPostID(int64_t post_id) override; | 120 void SetPostID(int64_t post_id) override; |
120 int64_t GetPostID() const override; | 121 int64_t GetPostID() const override; |
121 void SetBrowserInitiatedPostData(const base::RefCountedMemory* data) override; | 122 void SetPostData(const scoped_refptr<ResourceRequestBody>& data) override; |
122 const base::RefCountedMemory* GetBrowserInitiatedPostData() const override; | 123 scoped_refptr<ResourceRequestBody> GetPostData() const override; |
123 const FaviconStatus& GetFavicon() const override; | 124 const FaviconStatus& GetFavicon() const override; |
124 FaviconStatus& GetFavicon() override; | 125 FaviconStatus& GetFavicon() override; |
125 const SSLStatus& GetSSL() const override; | 126 const SSLStatus& GetSSL() const override; |
126 SSLStatus& GetSSL() override; | 127 SSLStatus& GetSSL() override; |
127 void SetOriginalRequestURL(const GURL& original_url) override; | 128 void SetOriginalRequestURL(const GURL& original_url) override; |
128 const GURL& GetOriginalRequestURL() const override; | 129 const GURL& GetOriginalRequestURL() const override; |
129 void SetIsOverridingUserAgent(bool override) override; | 130 void SetIsOverridingUserAgent(bool override) override; |
130 bool GetIsOverridingUserAgent() const override; | 131 bool GetIsOverridingUserAgent() const override; |
131 void SetTimestamp(base::Time timestamp) override; | 132 void SetTimestamp(base::Time timestamp) override; |
132 base::Time GetTimestamp() const override; | 133 base::Time GetTimestamp() const override; |
(...skipping 20 matching lines...) Expand all Loading... |
153 // TODO(creis): Once we start sharing FrameNavigationEntries between | 154 // TODO(creis): Once we start sharing FrameNavigationEntries between |
154 // NavigationEntryImpls, we will need to support two versions of Clone: one | 155 // NavigationEntryImpls, we will need to support two versions of Clone: one |
155 // that shares the existing FrameNavigationEntries (for use within the same | 156 // that shares the existing FrameNavigationEntries (for use within the same |
156 // tab) and one that draws them from a different pool (for use in a new tab). | 157 // tab) and one that draws them from a different pool (for use in a new tab). |
157 std::unique_ptr<NavigationEntryImpl> CloneAndReplace( | 158 std::unique_ptr<NavigationEntryImpl> CloneAndReplace( |
158 FrameTreeNode* frame_tree_node, | 159 FrameTreeNode* frame_tree_node, |
159 FrameNavigationEntry* frame_entry) const; | 160 FrameNavigationEntry* frame_entry) const; |
160 | 161 |
161 // Helper functions to construct NavigationParameters for a navigation to this | 162 // Helper functions to construct NavigationParameters for a navigation to this |
162 // NavigationEntry. | 163 // NavigationEntry. |
163 scoped_refptr<ResourceRequestBodyImpl> | |
164 ConstructBodyFromBrowserInitiatedPostData() const; | |
165 CommonNavigationParams ConstructCommonNavigationParams( | 164 CommonNavigationParams ConstructCommonNavigationParams( |
166 const FrameNavigationEntry& frame_entry, | 165 const FrameNavigationEntry& frame_entry, |
167 const scoped_refptr<ResourceRequestBodyImpl>& post_body, | 166 const scoped_refptr<ResourceRequestBodyImpl>& post_body, |
168 const GURL& dest_url, | 167 const GURL& dest_url, |
169 const Referrer& dest_referrer, | 168 const Referrer& dest_referrer, |
170 FrameMsg_Navigate_Type::Value navigation_type, | 169 FrameMsg_Navigate_Type::Value navigation_type, |
171 LoFiState lofi_state, | 170 LoFiState lofi_state, |
172 const base::TimeTicks& navigation_start) const; | 171 const base::TimeTicks& navigation_start) const; |
173 StartNavigationParams ConstructStartNavigationParams() const; | 172 StartNavigationParams ConstructStartNavigationParams() const; |
174 RequestNavigationParams ConstructRequestNavigationParams( | 173 RequestNavigationParams ConstructRequestNavigationParams( |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 ui::PageTransition transition_type_; | 404 ui::PageTransition transition_type_; |
406 GURL user_typed_url_; | 405 GURL user_typed_url_; |
407 RestoreType restore_type_; | 406 RestoreType restore_type_; |
408 GURL original_request_url_; | 407 GURL original_request_url_; |
409 bool is_overriding_user_agent_; | 408 bool is_overriding_user_agent_; |
410 base::Time timestamp_; | 409 base::Time timestamp_; |
411 int http_status_code_; | 410 int http_status_code_; |
412 | 411 |
413 // This member is not persisted with session restore because it is transient. | 412 // This member is not persisted with session restore because it is transient. |
414 // If the post request succeeds, this field is cleared since the same | 413 // If the post request succeeds, this field is cleared since the same |
415 // information is stored in |content_state_| above. It is also only shallow | 414 // information is stored in PageState. It is also only shallow copied with |
416 // copied with compiler provided copy constructor. | 415 // compiler provided copy constructor. Cleared in |ResetForCommit|. |
417 // Cleared in |ResetForCommit|. | 416 scoped_refptr<ResourceRequestBodyImpl> post_data_; |
418 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_; | |
419 | 417 |
420 // This is also a transient member (i.e. is not persisted with session | 418 // This is also a transient member (i.e. is not persisted with session |
421 // restore). The screenshot of a page is taken when navigating away from the | 419 // restore). The screenshot of a page is taken when navigating away from the |
422 // page. This screenshot is displayed during an overscroll-navigation | 420 // page. This screenshot is displayed during an overscroll-navigation |
423 // gesture. |screenshot_| will be NULL when the screenshot is not available | 421 // gesture. |screenshot_| will be NULL when the screenshot is not available |
424 // (e.g. after a session restore, or if taking the screenshot of a page | 422 // (e.g. after a session restore, or if taking the screenshot of a page |
425 // failed). The UI is responsible for dealing with missing screenshots | 423 // failed). The UI is responsible for dealing with missing screenshots |
426 // appropriately (e.g. display a placeholder image instead). | 424 // appropriately (e.g. display a placeholder image instead). |
427 scoped_refptr<base::RefCountedBytes> screenshot_; | 425 scoped_refptr<base::RefCountedBytes> screenshot_; |
428 | 426 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 // persisted, unless specific data is taken out/put back in at save/restore | 505 // persisted, unless specific data is taken out/put back in at save/restore |
508 // time (see TabNavigation for an example of this). | 506 // time (see TabNavigation for an example of this). |
509 std::map<std::string, base::string16> extra_data_; | 507 std::map<std::string, base::string16> extra_data_; |
510 | 508 |
511 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); | 509 DISALLOW_COPY_AND_ASSIGN(NavigationEntryImpl); |
512 }; | 510 }; |
513 | 511 |
514 } // namespace content | 512 } // namespace content |
515 | 513 |
516 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ | 514 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_ENTRY_IMPL_H_ |
OLD | NEW |