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

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: Conflict Resolution: FrameHostMsg_DidStartProvisionalLoad 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // NavigationRequest. It is then owned by the NavigationRequest until the 50 // NavigationRequest. It is then owned by the NavigationRequest until the
51 // navigation is ready to commit. The NavigationHandleImpl ownership is then 51 // navigation is ready to commit. The NavigationHandleImpl ownership is then
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 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks
61 // both renderer-initiated and browser-initiated navigation start.
62 // PlzNavigate: This value always comes from the CommonNavigationParams
63 // associated with this navigation.
60 static scoped_ptr<NavigationHandleImpl> Create( 64 static scoped_ptr<NavigationHandleImpl> Create(
61 const GURL& url, 65 const GURL& url,
62 FrameTreeNode* frame_tree_node); 66 FrameTreeNode* frame_tree_node,
67 const base::TimeTicks& navigation_start);
63 ~NavigationHandleImpl() override; 68 ~NavigationHandleImpl() override;
64 69
65 // NavigationHandle implementation: 70 // NavigationHandle implementation:
66 const GURL& GetURL() override; 71 const GURL& GetURL() override;
67 bool IsInMainFrame() override; 72 bool IsInMainFrame() override;
68 bool IsPost() override; 73 bool IsPost() override;
69 const Referrer& GetReferrer() override; 74 const Referrer& GetReferrer() override;
70 bool HasUserGesture() override; 75 bool HasUserGesture() override;
71 ui::PageTransition GetPageTransition() override; 76 ui::PageTransition GetPageTransition() override;
72 bool IsExternalProtocol() override; 77 bool IsExternalProtocol() override;
(...skipping 10 matching lines...) Expand all
83 const Referrer& sanitized_referrer, 88 const Referrer& sanitized_referrer,
84 bool has_user_gesture, 89 bool has_user_gesture,
85 ui::PageTransition transition, 90 ui::PageTransition transition,
86 bool is_external_protocol) override; 91 bool is_external_protocol) override;
87 NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting( 92 NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting(
88 const GURL& new_url, 93 const GURL& new_url,
89 bool new_method_is_post, 94 bool new_method_is_post,
90 const GURL& new_referrer_url, 95 const GURL& new_referrer_url,
91 bool new_is_external_protocol) override; 96 bool new_is_external_protocol) override;
92 97
98 // The time the navigation started, recorded either in the renderer or browser
99 // process. Corresponds to Navigation Timing API.
100 // TODO(csharrison): Add this to the public class and mark this override.
101 const base::TimeTicks& navigation_start() { return navigation_start_; }
102
93 NavigatorDelegate* GetDelegate() const; 103 NavigatorDelegate* GetDelegate() const;
94 104
95 void set_net_error_code(net::Error net_error_code) { 105 void set_net_error_code(net::Error net_error_code) {
96 net_error_code_ = net_error_code; 106 net_error_code_ = net_error_code;
97 } 107 }
98 108
99 // Returns whether the navigation is currently being transferred from one 109 // Returns whether the navigation is currently being transferred from one
100 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC 110 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC
101 // for the navigation URL, received in the new RenderFrameHost, should not 111 // for the navigation URL, received in the new RenderFrameHost, should not
102 // indicate the start of a new navigation in that case. 112 // indicate the start of a new navigation in that case.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 WILL_SEND_REQUEST, 165 WILL_SEND_REQUEST,
156 DEFERRING_START, 166 DEFERRING_START,
157 WILL_REDIRECT_REQUEST, 167 WILL_REDIRECT_REQUEST,
158 DEFERRING_REDIRECT, 168 DEFERRING_REDIRECT,
159 READY_TO_COMMIT, 169 READY_TO_COMMIT,
160 DID_COMMIT, 170 DID_COMMIT,
161 DID_COMMIT_ERROR_PAGE, 171 DID_COMMIT_ERROR_PAGE,
162 }; 172 };
163 173
164 NavigationHandleImpl(const GURL& url, 174 NavigationHandleImpl(const GURL& url,
165 FrameTreeNode* frame_tree_node); 175 FrameTreeNode* frame_tree_node,
176 const base::TimeTicks& navigation_start);
166 177
167 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); 178 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
168 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); 179 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
169 180
170 // Used in tests. 181 // Used in tests.
171 State state() const { return state_; } 182 State state() const { return state_; }
172 183
173 // See NavigationHandle for a description of those member variables. 184 // See NavigationHandle for a description of those member variables.
174 GURL url_; 185 GURL url_;
175 bool is_post_; 186 bool is_post_;
(...skipping 14 matching lines...) Expand all
190 201
191 // The FrameTreeNode this navigation is happening in. 202 // The FrameTreeNode this navigation is happening in.
192 FrameTreeNode* frame_tree_node_; 203 FrameTreeNode* frame_tree_node_;
193 204
194 // A list of Throttles registered for this navigation. 205 // A list of Throttles registered for this navigation.
195 ScopedVector<NavigationThrottle> throttles_; 206 ScopedVector<NavigationThrottle> throttles_;
196 207
197 // The index of the next throttle to check. 208 // The index of the next throttle to check.
198 size_t next_index_; 209 size_t next_index_;
199 210
211 // The time this navigation started.
212 const base::TimeTicks navigation_start_;
213
200 // This callback will be run when all throttle checks have been performed. 214 // This callback will be run when all throttle checks have been performed.
201 ThrottleChecksFinishedCallback complete_callback_; 215 ThrottleChecksFinishedCallback complete_callback_;
202 216
203 // PlzNavigate 217 // PlzNavigate
204 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a 218 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
205 // corresponding ServiceWorkerNetworkProvider is created in the renderer. 219 // corresponding ServiceWorkerNetworkProvider is created in the renderer.
206 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; 220 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_;
207 221
208 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 222 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
209 }; 223 };
210 224
211 } // namespace content 225 } // namespace content
212 226
213 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 227 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698