| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 17 #include "content/browser/frame_host/frame_tree_node.h" | 17 #include "content/browser/frame_host/frame_tree_node.h" |
| 18 #include "content/browser/frame_host/render_frame_host_impl.h" | 18 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/navigation_data.h" | 20 #include "content/public/browser/navigation_data.h" |
| 21 #include "content/public/browser/navigation_throttle.h" | 21 #include "content/public/browser/navigation_throttle.h" |
| 22 #include "content/public/browser/ssl_status.h" | 22 #include "content/public/browser/ssl_status.h" |
| 23 #include "content/public/common/request_context_type.h" | 23 #include "content/public/common/request_context_type.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| 26 struct FrameHostMsg_DidCommitProvisionalLoad_Params; | 26 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 class NavigationUIData; |
| 30 class NavigatorDelegate; | 31 class NavigatorDelegate; |
| 31 class ResourceRequestBodyImpl; | 32 class ResourceRequestBodyImpl; |
| 32 class ServiceWorkerContextWrapper; | 33 class ServiceWorkerContextWrapper; |
| 33 class ServiceWorkerNavigationHandle; | 34 class ServiceWorkerNavigationHandle; |
| 34 | 35 |
| 35 // This class keeps track of a single navigation. It is created upon receipt of | 36 // This class keeps track of a single navigation. It is created upon receipt of |
| 36 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns | 37 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns |
| 37 // the newly created NavigationHandleImpl as long as the navigation is ongoing. | 38 // the newly created NavigationHandleImpl as long as the navigation is ongoing. |
| 38 // The NavigationHandleImpl in the RenderFrameHost will be reset when the | 39 // The NavigationHandleImpl in the RenderFrameHost will be reset when the |
| 39 // navigation stops, that is if one of the following events happen: | 40 // navigation stops, that is if one of the following events happen: |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 235 |
| 235 // Called during commit. Takes ownership of the embedder's NavigationData | 236 // Called during commit. Takes ownership of the embedder's NavigationData |
| 236 // instance. This NavigationData may have been cloned prior to being added | 237 // instance. This NavigationData may have been cloned prior to being added |
| 237 // here. | 238 // here. |
| 238 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { | 239 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { |
| 239 navigation_data_ = std::move(navigation_data); | 240 navigation_data_ = std::move(navigation_data); |
| 240 } | 241 } |
| 241 | 242 |
| 242 SSLStatus ssl_status() { return ssl_status_; } | 243 SSLStatus ssl_status() { return ssl_status_; } |
| 243 | 244 |
| 245 NavigationUIData* navigation_ui_data() const { |
| 246 return navigation_ui_data_.get(); |
| 247 } |
| 248 |
| 244 private: | 249 private: |
| 245 friend class NavigationHandleImplTest; | 250 friend class NavigationHandleImplTest; |
| 246 | 251 |
| 247 // Used to track the state the navigation is currently in. | 252 // Used to track the state the navigation is currently in. |
| 248 enum State { | 253 enum State { |
| 249 INITIAL = 0, | 254 INITIAL = 0, |
| 250 WILL_SEND_REQUEST, | 255 WILL_SEND_REQUEST, |
| 251 DEFERRING_START, | 256 DEFERRING_START, |
| 252 WILL_REDIRECT_REQUEST, | 257 WILL_REDIRECT_REQUEST, |
| 253 DEFERRING_REDIRECT, | 258 DEFERRING_REDIRECT, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 RequestContextType request_context_type_; | 335 RequestContextType request_context_type_; |
| 331 | 336 |
| 332 // This callback will be run when all throttle checks have been performed. | 337 // This callback will be run when all throttle checks have been performed. |
| 333 ThrottleChecksFinishedCallback complete_callback_; | 338 ThrottleChecksFinishedCallback complete_callback_; |
| 334 | 339 |
| 335 // PlzNavigate | 340 // PlzNavigate |
| 336 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a | 341 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
| 337 // corresponding ServiceWorkerNetworkProvider is created in the renderer. | 342 // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
| 338 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; | 343 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
| 339 | 344 |
| 340 // Embedder data tied to this navigation. | 345 // Embedder data from the IO thread tied to this navigation. |
| 341 std::unique_ptr<NavigationData> navigation_data_; | 346 std::unique_ptr<NavigationData> navigation_data_; |
| 342 | 347 |
| 348 // PlzNavigate |
| 349 // Embedder data from the UI thread tied to this navigation. |
| 350 std::unique_ptr<NavigationUIData> navigation_ui_data_; |
| 351 |
| 343 SSLStatus ssl_status_; | 352 SSLStatus ssl_status_; |
| 344 | 353 |
| 345 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 354 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| 346 }; | 355 }; |
| 347 | 356 |
| 348 } // namespace content | 357 } // namespace content |
| 349 | 358 |
| 350 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 359 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
| OLD | NEW |