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 "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/browser/frame_host/navigation_entry_impl.h" | 14 #include "content/browser/frame_host/navigation_entry_impl.h" |
15 #include "content/browser/loader/navigation_url_loader_delegate.h" | 15 #include "content/browser/loader/navigation_url_loader_delegate.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/frame_message_enums.h" | 17 #include "content/common/frame_message_enums.h" |
18 #include "content/common/navigation_params.h" | 18 #include "content/common/navigation_params.h" |
19 #include "content/public/browser/navigation_throttle.h" | 19 #include "content/public/browser/navigation_throttle.h" |
20 #include "content/public/common/previews_state.h" | 20 #include "content/public/common/previews_state.h" |
| 21 #include "mojo/public/cpp/system/data_pipe.h" |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
24 class FrameNavigationEntry; | 25 class FrameNavigationEntry; |
25 class FrameTreeNode; | 26 class FrameTreeNode; |
26 class NavigationControllerImpl; | 27 class NavigationControllerImpl; |
27 class NavigationHandleImpl; | 28 class NavigationHandleImpl; |
28 class NavigationURLLoader; | 29 class NavigationURLLoader; |
29 class NavigationData; | 30 class NavigationData; |
30 class ResourceRequestBody; | 31 class ResourceRequestBody; |
31 class SiteInstanceImpl; | 32 class SiteInstanceImpl; |
32 class StreamHandle; | |
33 | 33 |
34 // PlzNavigate | 34 // PlzNavigate |
35 // A UI thread object that owns a navigation request until it commits. It | 35 // A UI thread object that owns a navigation request until it commits. It |
36 // ensures the UI thread can start a navigation request in the | 36 // ensures the UI thread can start a navigation request in the |
37 // ResourceDispatcherHost (that lives on the IO thread). | 37 // ResourceDispatcherHost (that lives on the IO thread). |
38 // TODO(clamy): Describe the interactions between the UI and IO thread during | 38 // TODO(clamy): Describe the interactions between the UI and IO thread during |
39 // the navigation following its refactoring. | 39 // the navigation following its refactoring. |
40 class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate { | 40 class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate { |
41 public: | 41 public: |
42 // Keeps track of the various stages of a NavigationRequest. | 42 // Keeps track of the various stages of a NavigationRequest. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 bool browser_initiated, | 175 bool browser_initiated, |
176 bool may_transfer, | 176 bool may_transfer, |
177 const FrameNavigationEntry* frame_navigation_entry, | 177 const FrameNavigationEntry* frame_navigation_entry, |
178 const NavigationEntryImpl* navitation_entry); | 178 const NavigationEntryImpl* navitation_entry); |
179 | 179 |
180 // NavigationURLLoaderDelegate implementation. | 180 // NavigationURLLoaderDelegate implementation. |
181 void OnRequestRedirected( | 181 void OnRequestRedirected( |
182 const net::RedirectInfo& redirect_info, | 182 const net::RedirectInfo& redirect_info, |
183 const scoped_refptr<ResourceResponse>& response) override; | 183 const scoped_refptr<ResourceResponse>& response) override; |
184 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, | 184 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, |
185 std::unique_ptr<StreamHandle> body, | 185 mojo::ScopedDataPipeConsumerHandle handle, |
186 const SSLStatus& ssl_status, | 186 const SSLStatus& ssl_status, |
187 std::unique_ptr<NavigationData> navigation_data, | 187 std::unique_ptr<NavigationData> navigation_data, |
188 const GlobalRequestID& request_id, | 188 const GlobalRequestID& request_id, |
189 bool is_download, | 189 bool is_download, |
190 bool is_stream) override; | 190 bool is_stream) override; |
191 void OnRequestFailed(bool has_stale_copy_in_cache, int net_error) override; | 191 void OnRequestFailed(bool has_stale_copy_in_cache, int net_error) override; |
192 void OnRequestStarted(base::TimeTicks timestamp) override; | 192 void OnRequestStarted(base::TimeTicks timestamp) override; |
193 | 193 |
194 // Called when the NavigationThrottles have been checked by the | 194 // Called when the NavigationThrottles have been checked by the |
195 // NavigationHandle. | 195 // NavigationHandle. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // True for browser-initiated navigations and renderer-inititated navigations | 242 // True for browser-initiated navigations and renderer-inititated navigations |
243 // started via the OpenURL path. | 243 // started via the OpenURL path. |
244 // Note: the RenderFrameHostManager may still decide to have the navigation | 244 // Note: the RenderFrameHostManager may still decide to have the navigation |
245 // commit in a different renderer process if it detects that a renderer | 245 // commit in a different renderer process if it detects that a renderer |
246 // transfer is needed. This is the case in particular when --site-per-process | 246 // transfer is needed. This is the case in particular when --site-per-process |
247 // is enabled. | 247 // is enabled. |
248 bool may_transfer_; | 248 bool may_transfer_; |
249 | 249 |
250 std::unique_ptr<NavigationHandleImpl> navigation_handle_; | 250 std::unique_ptr<NavigationHandleImpl> navigation_handle_; |
251 | 251 |
252 // Holds the ResourceResponse and the StreamHandle for the navigation while | 252 // Holds the ResourceResponse and the DataPipeConsumerHandle for the |
253 // the WillProcessResponse checks are performed by the NavigationHandle. | 253 // navigation while the WillProcessResponse checks are performed |
| 254 // by the NavigationHandle. |
254 scoped_refptr<ResourceResponse> response_; | 255 scoped_refptr<ResourceResponse> response_; |
255 std::unique_ptr<StreamHandle> body_; | 256 mojo::ScopedDataPipeConsumerHandle handle_; |
256 | 257 |
257 base::Closure on_start_checks_complete_closure_; | 258 base::Closure on_start_checks_complete_closure_; |
258 | 259 |
259 base::WeakPtrFactory<NavigationRequest> weak_factory_; | 260 base::WeakPtrFactory<NavigationRequest> weak_factory_; |
260 | 261 |
261 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 262 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
262 }; | 263 }; |
263 | 264 |
264 } // namespace content | 265 } // namespace content |
265 | 266 |
266 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 267 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
OLD | NEW |