| 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/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "content/browser/frame_host/navigation_entry_impl.h" | 13 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 13 #include "content/browser/loader/navigation_url_loader_delegate.h" | 14 #include "content/browser/loader/navigation_url_loader_delegate.h" |
| 14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 15 #include "content/common/frame_message_enums.h" | 16 #include "content/common/frame_message_enums.h" |
| 16 #include "content/common/navigation_params.h" | 17 #include "content/common/navigation_params.h" |
| 17 #include "content/public/browser/navigation_throttle.h" | 18 #include "content/public/browser/navigation_throttle.h" |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void CreateNavigationHandle(int pending_nav_entry_id); | 151 void CreateNavigationHandle(int pending_nav_entry_id); |
| 151 | 152 |
| 152 // Transfers the ownership of the NavigationHandle to |render_frame_host|. | 153 // Transfers the ownership of the NavigationHandle to |render_frame_host|. |
| 153 // This should be called when the navigation is ready to commit, because the | 154 // This should be called when the navigation is ready to commit, because the |
| 154 // NavigationHandle outlives the NavigationRequest. The NavigationHandle's | 155 // NavigationHandle outlives the NavigationRequest. The NavigationHandle's |
| 155 // lifetime is the entire navigation, while the NavigationRequest is | 156 // lifetime is the entire navigation, while the NavigationRequest is |
| 156 // destroyed when a navigation is ready for commit. | 157 // destroyed when a navigation is ready for commit. |
| 157 void TransferNavigationHandleOwnership( | 158 void TransferNavigationHandleOwnership( |
| 158 RenderFrameHostImpl* render_frame_host); | 159 RenderFrameHostImpl* render_frame_host); |
| 159 | 160 |
| 161 void set_on_start_checks_complete_closure_for_testing( |
| 162 const base::Closure& closure) { |
| 163 on_start_checks_complete_closure_ = closure; |
| 164 } |
| 165 |
| 160 private: | 166 private: |
| 161 NavigationRequest(FrameTreeNode* frame_tree_node, | 167 NavigationRequest(FrameTreeNode* frame_tree_node, |
| 162 const CommonNavigationParams& common_params, | 168 const CommonNavigationParams& common_params, |
| 163 const BeginNavigationParams& begin_params, | 169 const BeginNavigationParams& begin_params, |
| 164 const RequestNavigationParams& request_params, | 170 const RequestNavigationParams& request_params, |
| 165 bool browser_initiated, | 171 bool browser_initiated, |
| 166 const FrameNavigationEntry* frame_navigation_entry, | 172 const FrameNavigationEntry* frame_navigation_entry, |
| 167 const NavigationEntryImpl* navitation_entry); | 173 const NavigationEntryImpl* navitation_entry); |
| 168 | 174 |
| 169 // NavigationURLLoaderDelegate implementation. | 175 // NavigationURLLoaderDelegate implementation. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // The type of SiteInstance associated with this navigation. | 229 // The type of SiteInstance associated with this navigation. |
| 224 AssociatedSiteInstanceType associated_site_instance_type_; | 230 AssociatedSiteInstanceType associated_site_instance_type_; |
| 225 | 231 |
| 226 std::unique_ptr<NavigationHandleImpl> navigation_handle_; | 232 std::unique_ptr<NavigationHandleImpl> navigation_handle_; |
| 227 | 233 |
| 228 // Holds the ResourceResponse and the StreamHandle for the navigation while | 234 // Holds the ResourceResponse and the StreamHandle for the navigation while |
| 229 // the WillProcessResponse checks are performed by the NavigationHandle. | 235 // the WillProcessResponse checks are performed by the NavigationHandle. |
| 230 scoped_refptr<ResourceResponse> response_; | 236 scoped_refptr<ResourceResponse> response_; |
| 231 std::unique_ptr<StreamHandle> body_; | 237 std::unique_ptr<StreamHandle> body_; |
| 232 | 238 |
| 239 base::Closure on_start_checks_complete_closure_; |
| 240 |
| 233 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 241 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
| 234 }; | 242 }; |
| 235 | 243 |
| 236 } // namespace content | 244 } // namespace content |
| 237 | 245 |
| 238 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 246 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
| OLD | NEW |