Chromium Code Reviews| 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 "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 // transferred to the RenderFrameHost in which the navigation will commit. | 52 // transferred to the RenderFrameHost in which the navigation will commit. |
| 53 // | 53 // |
| 54 // When PlzNavigate is enabled, the NavigationHandleImpl will never be reset | 54 // When PlzNavigate is enabled, the NavigationHandleImpl will never be reset |
| 55 // following the receipt of a DidStartProvisionalLoad IPC. There are also no | 55 // following the receipt of a DidStartProvisionalLoad IPC. There are also no |
| 56 // transferring navigations. The other causes of NavigationHandleImpl reset in | 56 // transferring navigations. The other causes of NavigationHandleImpl reset in |
| 57 // the RenderFrameHost still apply. | 57 // the RenderFrameHost still apply. |
| 58 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { | 58 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { |
| 59 public: | 59 public: |
| 60 static scoped_ptr<NavigationHandleImpl> Create( | 60 static scoped_ptr<NavigationHandleImpl> Create( |
| 61 const GURL& url, | 61 const GURL& url, |
| 62 FrameTreeNode* frame_tree_node); | 62 FrameTreeNode* frame_tree_node, |
| 63 double navigation_start); | |
| 63 ~NavigationHandleImpl() override; | 64 ~NavigationHandleImpl() override; |
| 64 | 65 |
| 65 // NavigationHandle implementation: | 66 // NavigationHandle implementation: |
| 66 const GURL& GetURL() override; | 67 const GURL& GetURL() override; |
| 67 bool IsInMainFrame() override; | 68 bool IsInMainFrame() override; |
| 69 double GetNavigationStart() override; | |
| 68 bool IsPost() override; | 70 bool IsPost() override; |
| 69 const Referrer& GetReferrer() override; | 71 const Referrer& GetReferrer() override; |
| 70 bool HasUserGesture() override; | 72 bool HasUserGesture() override; |
| 71 ui::PageTransition GetPageTransition() override; | 73 ui::PageTransition GetPageTransition() override; |
| 72 bool IsExternalProtocol() override; | 74 bool IsExternalProtocol() override; |
| 73 net::Error GetNetErrorCode() override; | 75 net::Error GetNetErrorCode() override; |
| 74 RenderFrameHostImpl* GetRenderFrameHost() override; | 76 RenderFrameHostImpl* GetRenderFrameHost() override; |
| 75 bool IsSamePage() override; | 77 bool IsSamePage() override; |
| 76 bool HasCommitted() override; | 78 bool HasCommitted() override; |
| 77 bool IsErrorPage() override; | 79 bool IsErrorPage() override; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 INITIAL = 0, | 156 INITIAL = 0, |
| 155 WILL_SEND_REQUEST, | 157 WILL_SEND_REQUEST, |
| 156 DEFERRING_START, | 158 DEFERRING_START, |
| 157 WILL_REDIRECT_REQUEST, | 159 WILL_REDIRECT_REQUEST, |
| 158 DEFERRING_REDIRECT, | 160 DEFERRING_REDIRECT, |
| 159 READY_TO_COMMIT, | 161 READY_TO_COMMIT, |
| 160 DID_COMMIT, | 162 DID_COMMIT, |
| 161 DID_COMMIT_ERROR_PAGE, | 163 DID_COMMIT_ERROR_PAGE, |
| 162 }; | 164 }; |
| 163 | 165 |
| 166 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks | |
| 167 // both renderer-initiated and browser-initiated navigation start. | |
| 168 // PlzNavigate: Renderer-initated navigations send this with a BeginNavigation | |
| 169 // IPC. Browser-initiated navigations set it at the call-site. | |
| 164 NavigationHandleImpl(const GURL& url, | 170 NavigationHandleImpl(const GURL& url, |
| 165 FrameTreeNode* frame_tree_node); | 171 FrameTreeNode* frame_tree_node, |
| 172 double navigation_start); | |
| 166 | 173 |
| 167 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); | 174 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); |
| 168 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); | 175 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); |
| 169 | 176 |
| 170 // Used in tests. | 177 // Used in tests. |
| 171 State state() const { return state_; } | 178 State state() const { return state_; } |
| 172 | 179 |
| 173 // See NavigationHandle for a description of those member variables. | 180 // See NavigationHandle for a description of those member variables. |
| 174 GURL url_; | 181 GURL url_; |
| 175 bool is_post_; | 182 bool is_post_; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 190 | 197 |
| 191 // The FrameTreeNode this navigation is happening in. | 198 // The FrameTreeNode this navigation is happening in. |
| 192 FrameTreeNode* frame_tree_node_; | 199 FrameTreeNode* frame_tree_node_; |
| 193 | 200 |
| 194 // A list of Throttles registered for this navigation. | 201 // A list of Throttles registered for this navigation. |
| 195 ScopedVector<NavigationThrottle> throttles_; | 202 ScopedVector<NavigationThrottle> throttles_; |
| 196 | 203 |
| 197 // The index of the next throttle to check. | 204 // The index of the next throttle to check. |
| 198 size_t next_index_; | 205 size_t next_index_; |
| 199 | 206 |
| 207 // The time this navigation started. | |
| 208 double navigation_start_; | |
|
clamy
2015/10/28 12:40:01
This should be a base::TimeTicks or a base::Time (
| |
| 209 | |
| 200 // This callback will be run when all throttle checks have been performed. | 210 // This callback will be run when all throttle checks have been performed. |
| 201 ThrottleChecksFinishedCallback complete_callback_; | 211 ThrottleChecksFinishedCallback complete_callback_; |
| 202 | 212 |
| 203 // PlzNavigate | 213 // PlzNavigate |
| 204 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a | 214 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
| 205 // corresponding ServiceWorkerNetworkProvider is created in the renderer. | 215 // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
| 206 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; | 216 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
| 207 | 217 |
| 208 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 218 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| 209 }; | 219 }; |
| 210 | 220 |
| 211 } // namespace content | 221 } // namespace content |
| 212 | 222 |
| 213 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 223 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
| OLD | NEW |