Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 1427633004: Send navigation_start to the browser in DidStartProvisionalLoad IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation_start_renderer
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 const base::TimeTicks& 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 const base::TimeTicks& 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
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 their
clamy 2015/11/04 13:53:39 In PlzNavigate, it should always come from the Com
Charlie Harrison 2015/11/04 14:24:52 Ahh you're right. Oops! Done.
169 // CommonNavigationParams. Browser-initiated navigations set it at the
170 // call-site.
164 NavigationHandleImpl(const GURL& url, 171 NavigationHandleImpl(const GURL& url,
165 FrameTreeNode* frame_tree_node); 172 FrameTreeNode* frame_tree_node,
173 const base::TimeTicks& navigation_start);
166 174
167 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); 175 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
168 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); 176 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
169 177
170 // Used in tests. 178 // Used in tests.
171 State state() const { return state_; } 179 State state() const { return state_; }
172 180
173 // See NavigationHandle for a description of those member variables. 181 // See NavigationHandle for a description of those member variables.
174 GURL url_; 182 GURL url_;
175 bool is_post_; 183 bool is_post_;
(...skipping 14 matching lines...) Expand all
190 198
191 // The FrameTreeNode this navigation is happening in. 199 // The FrameTreeNode this navigation is happening in.
192 FrameTreeNode* frame_tree_node_; 200 FrameTreeNode* frame_tree_node_;
193 201
194 // A list of Throttles registered for this navigation. 202 // A list of Throttles registered for this navigation.
195 ScopedVector<NavigationThrottle> throttles_; 203 ScopedVector<NavigationThrottle> throttles_;
196 204
197 // The index of the next throttle to check. 205 // The index of the next throttle to check.
198 size_t next_index_; 206 size_t next_index_;
199 207
208 // The time this navigation started.
209 base::TimeTicks navigation_start_;
clamy 2015/11/04 13:53:39 This should be const.
Charlie Harrison 2015/11/04 14:24:52 Done.
210
200 // This callback will be run when all throttle checks have been performed. 211 // This callback will be run when all throttle checks have been performed.
201 ThrottleChecksFinishedCallback complete_callback_; 212 ThrottleChecksFinishedCallback complete_callback_;
202 213
203 // PlzNavigate 214 // PlzNavigate
204 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a 215 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
205 // corresponding ServiceWorkerNetworkProvider is created in the renderer. 216 // corresponding ServiceWorkerNetworkProvider is created in the renderer.
206 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; 217 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_;
207 218
208 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 219 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
209 }; 220 };
210 221
211 } // namespace content 222 } // namespace content
212 223
213 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 224 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698