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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
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 bool is_synchronous, | 73 bool is_synchronous, |
74 bool is_srcdoc, | 74 bool is_srcdoc, |
75 const base::TimeTicks& navigation_start, | 75 const base::TimeTicks& navigation_start); |
76 int pending_nav_entry_id); | |
77 ~NavigationHandleImpl() override; | 76 ~NavigationHandleImpl() override; |
78 | 77 |
79 // NavigationHandle implementation: | 78 // NavigationHandle implementation: |
80 const GURL& GetURL() override; | 79 const GURL& GetURL() override; |
81 bool IsInMainFrame() override; | 80 bool IsInMainFrame() override; |
82 bool IsParentMainFrame() override; | 81 bool IsParentMainFrame() override; |
83 bool IsSynchronousNavigation() override; | 82 bool IsSynchronousNavigation() override; |
84 bool IsSrcdoc() override; | 83 bool IsSrcdoc() override; |
85 bool WasServerRedirect() override; | 84 bool WasServerRedirect() override; |
86 int GetFrameTreeNodeId() override; | 85 int GetFrameTreeNodeId() override; |
(...skipping 27 matching lines...) Expand all Loading... |
114 bool new_is_external_protocol) override; | 113 bool new_is_external_protocol) override; |
115 | 114 |
116 NavigatorDelegate* GetDelegate() const; | 115 NavigatorDelegate* GetDelegate() const; |
117 | 116 |
118 // Returns the response headers for the request or nullptr if there are none. | 117 // Returns the response headers for the request or nullptr if there are none. |
119 // This should only be accessed after a redirect was encountered or after the | 118 // This should only be accessed after a redirect was encountered or after the |
120 // navigation is ready to commit. The headers returned should not be modified, | 119 // navigation is ready to commit. The headers returned should not be modified, |
121 // as modifications will not be reflected in the network stack. | 120 // as modifications will not be reflected in the network stack. |
122 const net::HttpResponseHeaders* GetResponseHeaders(); | 121 const net::HttpResponseHeaders* GetResponseHeaders(); |
123 | 122 |
124 // Get the unique id from the NavigationEntry associated with this | |
125 // NavigationHandle. Note that a synchronous, renderer-initiated navigation | |
126 // will not have a NavigationEntry associated with it, and this will return 0. | |
127 int pending_nav_entry_id() const { return pending_nav_entry_id_; } | |
128 | |
129 void set_net_error_code(net::Error net_error_code) { | 123 void set_net_error_code(net::Error net_error_code) { |
130 net_error_code_ = net_error_code; | 124 net_error_code_ = net_error_code; |
131 } | 125 } |
132 | 126 |
133 // Returns whether the navigation is currently being transferred from one | 127 // Returns whether the navigation is currently being transferred from one |
134 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC | 128 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC |
135 // for the navigation URL, received in the new RenderFrameHost, should not | 129 // for the navigation URL, received in the new RenderFrameHost, should not |
136 // indicate the start of a new navigation in that case. | 130 // indicate the start of a new navigation in that case. |
137 bool is_transferring() const { return is_transferring_; } | 131 bool is_transferring() const { return is_transferring_; } |
138 void set_is_transferring(bool is_transferring) { | 132 void set_is_transferring(bool is_transferring) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 DEFERRING_RESPONSE, | 215 DEFERRING_RESPONSE, |
222 READY_TO_COMMIT, | 216 READY_TO_COMMIT, |
223 DID_COMMIT, | 217 DID_COMMIT, |
224 DID_COMMIT_ERROR_PAGE, | 218 DID_COMMIT_ERROR_PAGE, |
225 }; | 219 }; |
226 | 220 |
227 NavigationHandleImpl(const GURL& url, | 221 NavigationHandleImpl(const GURL& url, |
228 FrameTreeNode* frame_tree_node, | 222 FrameTreeNode* frame_tree_node, |
229 bool is_synchronous, | 223 bool is_synchronous, |
230 bool is_srcdoc, | 224 bool is_srcdoc, |
231 const base::TimeTicks& navigation_start, | 225 const base::TimeTicks& navigation_start); |
232 int pending_nav_entry_id); | |
233 | 226 |
234 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); | 227 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); |
235 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); | 228 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); |
236 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); | 229 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); |
237 | 230 |
238 // Helper function to run and reset the |complete_callback_|. This marks the | 231 // Helper function to run and reset the |complete_callback_|. This marks the |
239 // end of a round of NavigationThrottleChecks. | 232 // end of a round of NavigationThrottleChecks. |
240 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); | 233 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); |
241 | 234 |
242 // Used in tests. | 235 // Used in tests. |
(...skipping 26 matching lines...) Expand all Loading... |
269 | 262 |
270 // A list of Throttles registered for this navigation. | 263 // A list of Throttles registered for this navigation. |
271 ScopedVector<NavigationThrottle> throttles_; | 264 ScopedVector<NavigationThrottle> throttles_; |
272 | 265 |
273 // The index of the next throttle to check. | 266 // The index of the next throttle to check. |
274 size_t next_index_; | 267 size_t next_index_; |
275 | 268 |
276 // The time this navigation started. | 269 // The time this navigation started. |
277 const base::TimeTicks navigation_start_; | 270 const base::TimeTicks navigation_start_; |
278 | 271 |
279 // The unique id of the corresponding NavigationEntry. | |
280 const int pending_nav_entry_id_; | |
281 | |
282 // This callback will be run when all throttle checks have been performed. | 272 // This callback will be run when all throttle checks have been performed. |
283 ThrottleChecksFinishedCallback complete_callback_; | 273 ThrottleChecksFinishedCallback complete_callback_; |
284 | 274 |
285 // PlzNavigate | 275 // PlzNavigate |
286 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a | 276 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a |
287 // corresponding ServiceWorkerNetworkProvider is created in the renderer. | 277 // corresponding ServiceWorkerNetworkProvider is created in the renderer. |
288 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; | 278 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; |
289 | 279 |
290 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 280 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
291 }; | 281 }; |
292 | 282 |
293 } // namespace content | 283 } // namespace content |
294 | 284 |
295 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 285 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |