OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_REQUEST_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 // Creates a request for a renderer-intiated navigation. | 86 // Creates a request for a renderer-intiated navigation. |
87 // Note: |body| is sent to the IO thread when calling BeginNavigation, and | 87 // Note: |body| is sent to the IO thread when calling BeginNavigation, and |
88 // should no longer be manipulated afterwards on the UI thread. | 88 // should no longer be manipulated afterwards on the UI thread. |
89 // TODO(clamy): see if ResourceRequestBody could be un-refcounted to avoid | 89 // TODO(clamy): see if ResourceRequestBody could be un-refcounted to avoid |
90 // threading subtleties. | 90 // threading subtleties. |
91 static std::unique_ptr<NavigationRequest> CreateRendererInitiated( | 91 static std::unique_ptr<NavigationRequest> CreateRendererInitiated( |
92 FrameTreeNode* frame_tree_node, | 92 FrameTreeNode* frame_tree_node, |
93 const CommonNavigationParams& common_params, | 93 const CommonNavigationParams& common_params, |
94 const BeginNavigationParams& begin_params, | 94 const BeginNavigationParams& begin_params, |
95 scoped_refptr<ResourceRequestBody> body, | |
96 int current_history_list_offset, | 95 int current_history_list_offset, |
97 int current_history_list_length); | 96 int current_history_list_length); |
98 | 97 |
99 ~NavigationRequest() override; | 98 ~NavigationRequest() override; |
100 | 99 |
101 // Called on the UI thread by the Navigator to start the navigation. | 100 // Called on the UI thread by the Navigator to start the navigation. |
102 void BeginNavigation(); | 101 void BeginNavigation(); |
103 | 102 |
104 const CommonNavigationParams& common_params() const { return common_params_; } | 103 const CommonNavigationParams& common_params() const { return common_params_; } |
105 | 104 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // lifetime is the entire navigation, while the NavigationRequest is | 158 // lifetime is the entire navigation, while the NavigationRequest is |
160 // destroyed when a navigation is ready for commit. | 159 // destroyed when a navigation is ready for commit. |
161 void TransferNavigationHandleOwnership( | 160 void TransferNavigationHandleOwnership( |
162 RenderFrameHostImpl* render_frame_host); | 161 RenderFrameHostImpl* render_frame_host); |
163 | 162 |
164 private: | 163 private: |
165 NavigationRequest(FrameTreeNode* frame_tree_node, | 164 NavigationRequest(FrameTreeNode* frame_tree_node, |
166 const CommonNavigationParams& common_params, | 165 const CommonNavigationParams& common_params, |
167 const BeginNavigationParams& begin_params, | 166 const BeginNavigationParams& begin_params, |
168 const RequestNavigationParams& request_params, | 167 const RequestNavigationParams& request_params, |
169 scoped_refptr<ResourceRequestBody> body, | |
170 bool browser_initiated, | 168 bool browser_initiated, |
171 const FrameNavigationEntry* frame_navigation_entry, | 169 const FrameNavigationEntry* frame_navigation_entry, |
172 const NavigationEntryImpl* navitation_entry); | 170 const NavigationEntryImpl* navitation_entry); |
173 | 171 |
174 // NavigationURLLoaderDelegate implementation. | 172 // NavigationURLLoaderDelegate implementation. |
175 void OnRequestRedirected( | 173 void OnRequestRedirected( |
176 const net::RedirectInfo& redirect_info, | 174 const net::RedirectInfo& redirect_info, |
177 const scoped_refptr<ResourceResponse>& response) override; | 175 const scoped_refptr<ResourceResponse>& response) override; |
178 void OnResponseStarted( | 176 void OnResponseStarted( |
179 const scoped_refptr<ResourceResponse>& response, | 177 const scoped_refptr<ResourceResponse>& response, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 221 |
224 // These next items are used in browser-initiated navigations to store | 222 // These next items are used in browser-initiated navigations to store |
225 // information from the NavigationEntryImpl that is required after request | 223 // information from the NavigationEntryImpl that is required after request |
226 // creation time. | 224 // creation time. |
227 scoped_refptr<SiteInstanceImpl> source_site_instance_; | 225 scoped_refptr<SiteInstanceImpl> source_site_instance_; |
228 scoped_refptr<SiteInstanceImpl> dest_site_instance_; | 226 scoped_refptr<SiteInstanceImpl> dest_site_instance_; |
229 NavigationEntryImpl::RestoreType restore_type_; | 227 NavigationEntryImpl::RestoreType restore_type_; |
230 bool is_view_source_; | 228 bool is_view_source_; |
231 int bindings_; | 229 int bindings_; |
232 | 230 |
233 // This is kept to be sent to the renderer on commit. | |
234 scoped_refptr<ResourceRequestBody> post_data_; | |
235 | |
236 // The type of SiteInstance associated with this navigation. | 231 // The type of SiteInstance associated with this navigation. |
237 AssociatedSiteInstanceType associated_site_instance_type_; | 232 AssociatedSiteInstanceType associated_site_instance_type_; |
238 | 233 |
239 std::unique_ptr<NavigationHandleImpl> navigation_handle_; | 234 std::unique_ptr<NavigationHandleImpl> navigation_handle_; |
240 | 235 |
241 // Holds the ResourceResponse and the StreamHandle for the navigation while | 236 // Holds the ResourceResponse and the StreamHandle for the navigation while |
242 // the WillProcessResponse checks are performed by the NavigationHandle. | 237 // the WillProcessResponse checks are performed by the NavigationHandle. |
243 scoped_refptr<ResourceResponse> response_; | 238 scoped_refptr<ResourceResponse> response_; |
244 std::unique_ptr<StreamHandle> body_; | 239 std::unique_ptr<StreamHandle> body_; |
245 | 240 |
246 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 241 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
247 }; | 242 }; |
248 | 243 |
249 } // namespace content | 244 } // namespace content |
250 | 245 |
251 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 246 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
OLD | NEW |