Chromium Code Reviews| Index: content/browser/frame_host/navigation_handle_impl.h |
| diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h |
| index be65134bb7ae21905b647fa7fd4c90cf90aaa7c3..afba965ac3947fce3c3604ddd8611da0c44cde04 100644 |
| --- a/content/browser/frame_host/navigation_handle_impl.h |
| +++ b/content/browser/frame_host/navigation_handle_impl.h |
| @@ -9,20 +9,21 @@ |
| #include <stddef.h> |
| #include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/memory/scoped_vector.h" |
| #include "content/browser/frame_host/frame_tree_node.h" |
| #include "content/browser/frame_host/render_frame_host_impl.h" |
| #include "content/common/content_export.h" |
| #include "content/public/browser/navigation_throttle.h" |
| +#include "content/public/browser/navigation_user_data.h" |
| #include "url/gurl.h" |
| struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
| namespace content { |
| class NavigatorDelegate; |
| class ServiceWorkerContextWrapper; |
| class ServiceWorkerNavigationHandle; |
| struct NavigationRequestInfo; |
| @@ -104,20 +105,21 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { |
| bool is_post, |
| const Referrer& sanitized_referrer, |
| bool has_user_gesture, |
| ui::PageTransition transition, |
| bool is_external_protocol) override; |
| NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting( |
| const GURL& new_url, |
| bool new_method_is_post, |
| const GURL& new_referrer_url, |
| bool new_is_external_protocol) override; |
| + NavigationData* GetNavigationData() const override; |
| NavigatorDelegate* GetDelegate() const; |
| // Returns the response headers for the request or nullptr if there are none. |
| // This should only be accessed after a redirect was encountered or after the |
| // navigation is ready to commit. The headers returned should not be modified, |
| // as modifications will not be reflected in the network stack. |
| const net::HttpResponseHeaders* GetResponseHeaders(); |
| // Get the unique id from the NavigationEntry associated with this |
| @@ -204,20 +206,27 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { |
| // delegate. |
| void ReadyToCommitNavigation(RenderFrameHostImpl* render_frame_host); |
| // Called when the navigation was committed in |render_frame_host|. This will |
| // update the |state_|. |
| void DidCommitNavigation( |
| const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| bool same_page, |
| RenderFrameHostImpl* render_frame_host); |
| + // Called during commit. Takes ownership of the embedder's NavigationData |
| + // instance. This NavigationData may have been cloned prior to being added |
| + // here. |
| + void SetNavigationData(std::unique_ptr<NavigationData> navigation_data) { |
| + navigation_data_ = std::move(navigation_data); |
| + } |
| + |
| private: |
| friend class NavigationHandleImplTest; |
| // Used to track the state the navigation is currently in. |
| enum State { |
| INITIAL = 0, |
| WILL_SEND_REQUEST, |
| DEFERRING_START, |
| WILL_REDIRECT_REQUEST, |
| DEFERRING_REDIRECT, |
| @@ -285,16 +294,19 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { |
| int pending_nav_entry_id_; |
| // This callback will be run when all throttle checks have been performed. |
| ThrottleChecksFinishedCallback complete_callback_; |
| // PlzNavigate |
| // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
| // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
| std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
| + // Manages the lifetime of the embedder's NavigationData. |
|
nasko
2016/04/26 20:18:39
It is the embedder data, it doesn't manage much.
RyanSturm
2016/04/27 23:27:46
Done.
|
| + std::unique_ptr<NavigationData> navigation_data_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| }; |
| } // namespace content |
| #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |