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/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "content/browser/frame_host/navigation_entry_impl.h" | 13 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 14 #include "content/browser/frame_host/navigation_handle_impl.h" |
14 #include "content/browser/loader/navigation_url_loader_delegate.h" | 15 #include "content/browser/loader/navigation_url_loader_delegate.h" |
15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
16 #include "content/common/frame_message_enums.h" | 17 #include "content/common/frame_message_enums.h" |
17 #include "content/common/navigation_params.h" | 18 #include "content/common/navigation_params.h" |
18 #include "content/public/browser/navigation_throttle.h" | 19 #include "content/public/browser/navigation_throttle.h" |
19 #include "content/public/common/previews_state.h" | 20 #include "content/public/common/previews_state.h" |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 | 23 |
23 class FrameNavigationEntry; | 24 class FrameNavigationEntry; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 void CreateNavigationHandle(int pending_nav_entry_id); | 155 void CreateNavigationHandle(int pending_nav_entry_id); |
155 | 156 |
156 // Transfers the ownership of the NavigationHandle to |render_frame_host|. | 157 // Transfers the ownership of the NavigationHandle to |render_frame_host|. |
157 // This should be called when the navigation is ready to commit, because the | 158 // This should be called when the navigation is ready to commit, because the |
158 // NavigationHandle outlives the NavigationRequest. The NavigationHandle's | 159 // NavigationHandle outlives the NavigationRequest. The NavigationHandle's |
159 // lifetime is the entire navigation, while the NavigationRequest is | 160 // lifetime is the entire navigation, while the NavigationRequest is |
160 // destroyed when a navigation is ready for commit. | 161 // destroyed when a navigation is ready for commit. |
161 void TransferNavigationHandleOwnership( | 162 void TransferNavigationHandleOwnership( |
162 RenderFrameHostImpl* render_frame_host); | 163 RenderFrameHostImpl* render_frame_host); |
163 | 164 |
164 void set_on_start_checks_complete_closure_for_testing( | 165 void set_on_checks_complete_callback_for_testing( |
165 const base::Closure& closure) { | 166 const NavigationHandleImpl::ThrottleChecksFinishedCallback& callback) { |
166 on_start_checks_complete_closure_ = closure; | 167 on_checks_complete_callback_ = callback; |
167 } | 168 } |
168 | 169 |
169 private: | 170 private: |
170 NavigationRequest(FrameTreeNode* frame_tree_node, | 171 NavigationRequest(FrameTreeNode* frame_tree_node, |
171 const CommonNavigationParams& common_params, | 172 const CommonNavigationParams& common_params, |
172 const BeginNavigationParams& begin_params, | 173 const BeginNavigationParams& begin_params, |
173 const RequestNavigationParams& request_params, | 174 const RequestNavigationParams& request_params, |
174 bool browser_initiated, | 175 bool browser_initiated, |
175 bool may_transfer, | 176 bool may_transfer, |
176 const FrameNavigationEntry* frame_navigation_entry, | 177 const FrameNavigationEntry* frame_navigation_entry, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // is enabled. | 247 // is enabled. |
247 bool may_transfer_; | 248 bool may_transfer_; |
248 | 249 |
249 std::unique_ptr<NavigationHandleImpl> navigation_handle_; | 250 std::unique_ptr<NavigationHandleImpl> navigation_handle_; |
250 | 251 |
251 // Holds the ResourceResponse and the StreamHandle for the navigation while | 252 // Holds the ResourceResponse and the StreamHandle for the navigation while |
252 // the WillProcessResponse checks are performed by the NavigationHandle. | 253 // the WillProcessResponse checks are performed by the NavigationHandle. |
253 scoped_refptr<ResourceResponse> response_; | 254 scoped_refptr<ResourceResponse> response_; |
254 std::unique_ptr<StreamHandle> body_; | 255 std::unique_ptr<StreamHandle> body_; |
255 | 256 |
256 base::Closure on_start_checks_complete_closure_; | 257 NavigationHandleImpl::ThrottleChecksFinishedCallback |
| 258 on_checks_complete_callback_; |
257 | 259 |
258 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 260 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
259 }; | 261 }; |
260 | 262 |
261 } // namespace content | 263 } // namespace content |
262 | 264 |
263 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 265 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
OLD | NEW |