OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_HANDLE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
7 | 7 |
8 #include "content/public/browser/navigation_handle.h" | 8 #include "content/public/browser/navigation_handle.h" |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "content/public/browser/navigation_data.h" | 21 #include "content/public/browser/navigation_data.h" |
22 #include "content/public/browser/navigation_throttle.h" | 22 #include "content/public/browser/navigation_throttle.h" |
23 #include "content/public/browser/ssl_status.h" | 23 #include "content/public/browser/ssl_status.h" |
24 #include "content/public/common/request_context_type.h" | 24 #include "content/public/common/request_context_type.h" |
25 #include "url/gurl.h" | 25 #include "url/gurl.h" |
26 | 26 |
27 struct FrameHostMsg_DidCommitProvisionalLoad_Params; | 27 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
| 31 class NavigationUIData; |
31 class NavigatorDelegate; | 32 class NavigatorDelegate; |
32 class ResourceRequestBodyImpl; | 33 class ResourceRequestBodyImpl; |
33 class ServiceWorkerContextWrapper; | 34 class ServiceWorkerContextWrapper; |
34 class ServiceWorkerNavigationHandle; | 35 class ServiceWorkerNavigationHandle; |
35 class SiteInstance; | 36 class SiteInstance; |
36 | 37 |
37 // This class keeps track of a single navigation. It is created upon receipt of | 38 // This class keeps track of a single navigation. It is created upon receipt of |
38 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns | 39 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns |
39 // the newly created NavigationHandleImpl as long as the navigation is ongoing. | 40 // the newly created NavigationHandleImpl as long as the navigation is ongoing. |
40 // The NavigationHandleImpl in the RenderFrameHost will be reset when the | 41 // The NavigationHandleImpl in the RenderFrameHost will be reset when the |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // non-transfer code. There may be some issues in PlzNavigate, where | 266 // non-transfer code. There may be some issues in PlzNavigate, where |
266 // WillStartRequest will be called before starting a request on the IO thread. | 267 // WillStartRequest will be called before starting a request on the IO thread. |
267 const GlobalRequestID& request_id() const { | 268 const GlobalRequestID& request_id() const { |
268 DCHECK_GE(state_, WILL_PROCESS_RESPONSE); | 269 DCHECK_GE(state_, WILL_PROCESS_RESPONSE); |
269 return request_id_; | 270 return request_id_; |
270 } | 271 } |
271 | 272 |
272 // Called when the navigation is transferred to a different renderer. | 273 // Called when the navigation is transferred to a different renderer. |
273 void Transfer(); | 274 void Transfer(); |
274 | 275 |
| 276 NavigationUIData* navigation_ui_data() const { |
| 277 return navigation_ui_data_.get(); |
| 278 } |
| 279 |
275 private: | 280 private: |
276 friend class NavigationHandleImplTest; | 281 friend class NavigationHandleImplTest; |
277 | 282 |
278 // Used to track the state the navigation is currently in. | 283 // Used to track the state the navigation is currently in. |
279 enum State { | 284 enum State { |
280 INITIAL = 0, | 285 INITIAL = 0, |
281 WILL_SEND_REQUEST, | 286 WILL_SEND_REQUEST, |
282 DEFERRING_START, | 287 DEFERRING_START, |
283 WILL_REDIRECT_REQUEST, | 288 WILL_REDIRECT_REQUEST, |
284 DEFERRING_REDIRECT, | 289 DEFERRING_REDIRECT, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 RequestContextType request_context_type_; | 383 RequestContextType request_context_type_; |
379 | 384 |
380 // This callback will be run when all throttle checks have been performed. | 385 // This callback will be run when all throttle checks have been performed. |
381 ThrottleChecksFinishedCallback complete_callback_; | 386 ThrottleChecksFinishedCallback complete_callback_; |
382 | 387 |
383 // PlzNavigate | 388 // PlzNavigate |
384 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a | 389 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
385 // corresponding ServiceWorkerNetworkProvider is created in the renderer. | 390 // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
386 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; | 391 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
387 | 392 |
388 // Embedder data tied to this navigation. | 393 // Embedder data from the IO thread tied to this navigation. |
389 std::unique_ptr<NavigationData> navigation_data_; | 394 std::unique_ptr<NavigationData> navigation_data_; |
390 | 395 |
| 396 // PlzNavigate |
| 397 // Embedder data from the UI thread tied to this navigation. |
| 398 std::unique_ptr<NavigationUIData> navigation_ui_data_; |
| 399 |
391 SSLStatus ssl_status_; | 400 SSLStatus ssl_status_; |
392 | 401 |
393 // The id of the URLRequest tied to this navigation. | 402 // The id of the URLRequest tied to this navigation. |
394 GlobalRequestID request_id_; | 403 GlobalRequestID request_id_; |
395 | 404 |
396 // Whether the current NavigationEntry should be replaced upon commit. | 405 // Whether the current NavigationEntry should be replaced upon commit. |
397 bool should_replace_current_entry_; | 406 bool should_replace_current_entry_; |
398 | 407 |
399 // The chain of redirects. | 408 // The chain of redirects. |
400 std::vector<GURL> redirect_chain_; | 409 std::vector<GURL> redirect_chain_; |
401 | 410 |
402 // A callback to run on the IO thread if the navigation transfers. | 411 // A callback to run on the IO thread if the navigation transfers. |
403 base::Closure transfer_callback_; | 412 base::Closure transfer_callback_; |
404 | 413 |
405 // Whether the navigation ended up being a download or a stream. | 414 // Whether the navigation ended up being a download or a stream. |
406 bool is_download_; | 415 bool is_download_; |
407 bool is_stream_; | 416 bool is_stream_; |
408 | 417 |
409 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; | 418 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; |
410 | 419 |
411 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 420 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
412 }; | 421 }; |
413 | 422 |
414 } // namespace content | 423 } // namespace content |
415 | 424 |
416 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 425 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |