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> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 // | 59 // |
60 // When PlzNavigate is enabled, the NavigationHandleImpl will never be reset | 60 // When PlzNavigate is enabled, the NavigationHandleImpl will never be reset |
61 // following the receipt of a DidStartProvisionalLoad IPC. There are also no | 61 // following the receipt of a DidStartProvisionalLoad IPC. There are also no |
62 // transferring navigations. The other causes of NavigationHandleImpl reset in | 62 // transferring navigations. The other causes of NavigationHandleImpl reset in |
63 // the RenderFrameHost still apply. | 63 // the RenderFrameHost still apply. |
64 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { | 64 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { |
65 public: | 65 public: |
66 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks | 66 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks |
67 // both renderer-initiated and browser-initiated navigation start. | 67 // both renderer-initiated and browser-initiated navigation start. |
68 // PlzNavigate: This value always comes from the CommonNavigationParams | 68 // PlzNavigate: This value always comes from the CommonNavigationParams |
69 // associated with this navigation. | 69 // associated with this navigation. |
Charlie Reis
2016/02/05 19:36:11
Need to document what cases it's ok for the NavEnt
Charlie Harrison
2016/02/05 23:10:23
Yeah, that what I gathered. Perhaps the nav_entry_
Charlie Reis
2016/02/06 00:54:57
Yes, I like pending_nav_entry_id.
| |
70 static scoped_ptr<NavigationHandleImpl> Create( | 70 static scoped_ptr<NavigationHandleImpl> Create( |
71 const GURL& url, | 71 const GURL& url, |
72 FrameTreeNode* frame_tree_node, | 72 FrameTreeNode* frame_tree_node, |
73 const base::TimeTicks& navigation_start); | 73 const base::TimeTicks& navigation_start, |
74 NavigationEntry* navigation_entry); | |
74 ~NavigationHandleImpl() override; | 75 ~NavigationHandleImpl() override; |
75 | 76 |
76 // NavigationHandle implementation: | 77 // NavigationHandle implementation: |
77 const GURL& GetURL() override; | 78 const GURL& GetURL() override; |
78 bool IsInMainFrame() override; | 79 bool IsInMainFrame() override; |
79 const base::TimeTicks& NavigationStart() override; | 80 const base::TimeTicks& NavigationStart() override; |
80 bool IsPost() override; | 81 bool IsPost() override; |
81 const Referrer& GetReferrer() override; | 82 const Referrer& GetReferrer() override; |
82 bool HasUserGesture() override; | 83 bool HasUserGesture() override; |
83 ui::PageTransition GetPageTransition() override; | 84 ui::PageTransition GetPageTransition() override; |
(...skipping 21 matching lines...) Expand all Loading... | |
105 bool new_is_external_protocol) override; | 106 bool new_is_external_protocol) override; |
106 | 107 |
107 NavigatorDelegate* GetDelegate() const; | 108 NavigatorDelegate* GetDelegate() const; |
108 | 109 |
109 // Returns the response headers for the request. This can only be accessed | 110 // Returns the response headers for the request. This can only be accessed |
110 // after a redirect was encountered or after the the navigation is ready to | 111 // after a redirect was encountered or after the the navigation is ready to |
111 // commit. It should not be modified, as modifications will not be reflected | 112 // commit. It should not be modified, as modifications will not be reflected |
112 // in the network stack. | 113 // in the network stack. |
113 const net::HttpResponseHeaders* GetResponseHeaders(); | 114 const net::HttpResponseHeaders* GetResponseHeaders(); |
114 | 115 |
116 int get_entry_id() { return entry_id_; } | |
Charlie Reis
2016/02/05 19:36:11
nit: Maybe nav_entry_id(), as in RenderFrameHostIm
Charlie Harrison
2016/02/05 23:10:23
I don't *think* it can change over time, so I'll m
| |
117 | |
115 void set_net_error_code(net::Error net_error_code) { | 118 void set_net_error_code(net::Error net_error_code) { |
116 net_error_code_ = net_error_code; | 119 net_error_code_ = net_error_code; |
117 } | 120 } |
118 | 121 |
119 // Returns whether the navigation is currently being transferred from one | 122 // Returns whether the navigation is currently being transferred from one |
120 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC | 123 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC |
121 // for the navigation URL, received in the new RenderFrameHost, should not | 124 // for the navigation URL, received in the new RenderFrameHost, should not |
122 // indicate the start of a new navigation in that case. | 125 // indicate the start of a new navigation in that case. |
123 bool is_transferring() const { return is_transferring_; } | 126 bool is_transferring() const { return is_transferring_; } |
124 void set_is_transferring(bool is_transferring) { | 127 void set_is_transferring(bool is_transferring) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 WILL_REDIRECT_REQUEST, | 197 WILL_REDIRECT_REQUEST, |
195 DEFERRING_REDIRECT, | 198 DEFERRING_REDIRECT, |
196 CANCELING, | 199 CANCELING, |
197 READY_TO_COMMIT, | 200 READY_TO_COMMIT, |
198 DID_COMMIT, | 201 DID_COMMIT, |
199 DID_COMMIT_ERROR_PAGE, | 202 DID_COMMIT_ERROR_PAGE, |
200 }; | 203 }; |
201 | 204 |
202 NavigationHandleImpl(const GURL& url, | 205 NavigationHandleImpl(const GURL& url, |
203 FrameTreeNode* frame_tree_node, | 206 FrameTreeNode* frame_tree_node, |
204 const base::TimeTicks& navigation_start); | 207 const base::TimeTicks& navigation_start, |
208 NavigationEntry* navigation_entry); | |
205 | 209 |
206 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); | 210 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); |
207 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); | 211 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); |
208 | 212 |
209 // Helper function to run and reset the |complete_callback_|. This marks the | 213 // Helper function to run and reset the |complete_callback_|. This marks the |
210 // end of a round of NavigationThrottleChecks. | 214 // end of a round of NavigationThrottleChecks. |
211 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); | 215 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); |
212 | 216 |
213 // Used in tests. | 217 // Used in tests. |
214 State state() const { return state_; } | 218 State state() const { return state_; } |
(...skipping 22 matching lines...) Expand all Loading... | |
237 | 241 |
238 // A list of Throttles registered for this navigation. | 242 // A list of Throttles registered for this navigation. |
239 ScopedVector<NavigationThrottle> throttles_; | 243 ScopedVector<NavigationThrottle> throttles_; |
240 | 244 |
241 // The index of the next throttle to check. | 245 // The index of the next throttle to check. |
242 size_t next_index_; | 246 size_t next_index_; |
243 | 247 |
244 // The time this navigation started. | 248 // The time this navigation started. |
245 const base::TimeTicks navigation_start_; | 249 const base::TimeTicks navigation_start_; |
246 | 250 |
251 // The unique id of the corresponding NavigationEntry. | |
252 int entry_id_; | |
253 | |
247 // This callback will be run when all throttle checks have been performed. | 254 // This callback will be run when all throttle checks have been performed. |
248 ThrottleChecksFinishedCallback complete_callback_; | 255 ThrottleChecksFinishedCallback complete_callback_; |
249 | 256 |
250 // PlzNavigate | 257 // PlzNavigate |
251 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a | 258 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
252 // corresponding ServiceWorkerNetworkProvider is created in the renderer. | 259 // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
253 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; | 260 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
254 | 261 |
255 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 262 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
256 }; | 263 }; |
257 | 264 |
258 } // namespace content | 265 } // namespace content |
259 | 266 |
260 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 267 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |