| 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 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
| 16 #include "base/supports_user_data.h" |
| 16 #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/navigation_user_data.h" |
| 17 #include "content/browser/frame_host/render_frame_host_impl.h" | 19 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 18 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 19 #include "content/public/browser/navigation_throttle.h" | 21 #include "content/public/browser/navigation_throttle.h" |
| 20 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 21 | 23 |
| 22 struct FrameHostMsg_DidCommitProvisionalLoad_Params; | 24 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
| 23 | 25 |
| 24 namespace content { | 26 namespace content { |
| 25 | 27 |
| 28 class NavigationUserData; |
| 26 class NavigatorDelegate; | 29 class NavigatorDelegate; |
| 27 class ServiceWorkerContextWrapper; | 30 class ServiceWorkerContextWrapper; |
| 28 class ServiceWorkerNavigationHandle; | 31 class ServiceWorkerNavigationHandle; |
| 29 struct NavigationRequestInfo; | 32 struct NavigationRequestInfo; |
| 30 | 33 |
| 31 // This class keeps track of a single navigation. It is created upon receipt of | 34 // This class keeps track of a single navigation. It is created upon receipt of |
| 32 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns | 35 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns |
| 33 // the newly created NavigationHandleImpl as long as the navigation is ongoing. | 36 // the newly created NavigationHandleImpl as long as the navigation is ongoing. |
| 34 // The NavigationHandleImpl in the RenderFrameHost will be reset when the | 37 // The NavigationHandleImpl in the RenderFrameHost will be reset when the |
| 35 // navigation stops, that is if one of the following events happen: | 38 // navigation stops, that is if one of the following events happen: |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 RenderFrameHostImpl* render_frame_host, | 210 RenderFrameHostImpl* render_frame_host, |
| 208 scoped_refptr<net::HttpResponseHeaders> response_headers); | 211 scoped_refptr<net::HttpResponseHeaders> response_headers); |
| 209 | 212 |
| 210 // Called when the navigation was committed in |render_frame_host|. This will | 213 // Called when the navigation was committed in |render_frame_host|. This will |
| 211 // update the |state_|. | 214 // update the |state_|. |
| 212 void DidCommitNavigation( | 215 void DidCommitNavigation( |
| 213 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 216 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 214 bool same_page, | 217 bool same_page, |
| 215 RenderFrameHostImpl* render_frame_host); | 218 RenderFrameHostImpl* render_frame_host); |
| 216 | 219 |
| 220 void SetNavigationSupportsUserData( |
| 221 scoped_ptr<NavigationSupportsUserData> navigation_supports_user_data); |
| 222 base::SupportsUserData::Data* GetUserData(const void* key) override; |
| 223 |
| 217 private: | 224 private: |
| 218 friend class NavigationHandleImplTest; | 225 friend class NavigationHandleImplTest; |
| 219 | 226 |
| 220 // Used to track the state the navigation is currently in. | 227 // Used to track the state the navigation is currently in. |
| 221 enum State { | 228 enum State { |
| 222 INITIAL = 0, | 229 INITIAL = 0, |
| 223 WILL_SEND_REQUEST, | 230 WILL_SEND_REQUEST, |
| 224 DEFERRING_START, | 231 DEFERRING_START, |
| 225 WILL_REDIRECT_REQUEST, | 232 WILL_REDIRECT_REQUEST, |
| 226 DEFERRING_REDIRECT, | 233 DEFERRING_REDIRECT, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 int pending_nav_entry_id_; | 295 int pending_nav_entry_id_; |
| 289 | 296 |
| 290 // This callback will be run when all throttle checks have been performed. | 297 // This callback will be run when all throttle checks have been performed. |
| 291 ThrottleChecksFinishedCallback complete_callback_; | 298 ThrottleChecksFinishedCallback complete_callback_; |
| 292 | 299 |
| 293 // PlzNavigate | 300 // PlzNavigate |
| 294 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a | 301 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
| 295 // corresponding ServiceWorkerNetworkProvider is created in the renderer. | 302 // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
| 296 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; | 303 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
| 297 | 304 |
| 305 scoped_ptr<NavigationSupportsUserData> navigation_supports_user_data_; |
| 306 |
| 298 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 307 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| 299 }; | 308 }; |
| 300 | 309 |
| 301 } // namespace content | 310 } // namespace content |
| 302 | 311 |
| 303 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 312 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
| OLD | NEW |