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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { | 66 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { |
67 public: | 67 public: |
68 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks | 68 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks |
69 // both renderer-initiated and browser-initiated navigation start. | 69 // both renderer-initiated and browser-initiated navigation start. |
70 // PlzNavigate: This value always comes from the CommonNavigationParams | 70 // PlzNavigate: This value always comes from the CommonNavigationParams |
71 // associated with this navigation. | 71 // associated with this navigation. |
72 static std::unique_ptr<NavigationHandleImpl> Create( | 72 static std::unique_ptr<NavigationHandleImpl> Create( |
73 const GURL& url, | 73 const GURL& url, |
74 FrameTreeNode* frame_tree_node, | 74 FrameTreeNode* frame_tree_node, |
75 bool is_renderer_initiated, | 75 bool is_renderer_initiated, |
76 bool is_synchronous, | 76 bool is_same_page, |
77 bool is_srcdoc, | 77 bool is_srcdoc, |
78 const base::TimeTicks& navigation_start, | 78 const base::TimeTicks& navigation_start, |
79 int pending_nav_entry_id); | 79 int pending_nav_entry_id); |
80 ~NavigationHandleImpl() override; | 80 ~NavigationHandleImpl() override; |
81 | 81 |
82 // NavigationHandle implementation: | 82 // NavigationHandle implementation: |
83 const GURL& GetURL() override; | 83 const GURL& GetURL() override; |
84 bool IsInMainFrame() override; | 84 bool IsInMainFrame() override; |
85 bool IsParentMainFrame() override; | 85 bool IsParentMainFrame() override; |
86 bool IsRendererInitiated() override; | 86 bool IsRendererInitiated() override; |
87 bool IsSynchronousNavigation() override; | |
88 bool IsSrcdoc() override; | 87 bool IsSrcdoc() override; |
89 bool WasServerRedirect() override; | 88 bool WasServerRedirect() override; |
90 int GetFrameTreeNodeId() override; | 89 int GetFrameTreeNodeId() override; |
91 int GetParentFrameTreeNodeId() override; | 90 int GetParentFrameTreeNodeId() override; |
92 const base::TimeTicks& NavigationStart() override; | 91 const base::TimeTicks& NavigationStart() override; |
93 bool IsPost() override; | 92 bool IsPost() override; |
94 const Referrer& GetReferrer() override; | 93 const Referrer& GetReferrer() override; |
95 bool HasUserGesture() override; | 94 bool HasUserGesture() override; |
96 ui::PageTransition GetPageTransition() override; | 95 ui::PageTransition GetPageTransition() override; |
97 bool IsExternalProtocol() override; | 96 bool IsExternalProtocol() override; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 WILL_PROCESS_RESPONSE, | 245 WILL_PROCESS_RESPONSE, |
247 DEFERRING_RESPONSE, | 246 DEFERRING_RESPONSE, |
248 READY_TO_COMMIT, | 247 READY_TO_COMMIT, |
249 DID_COMMIT, | 248 DID_COMMIT, |
250 DID_COMMIT_ERROR_PAGE, | 249 DID_COMMIT_ERROR_PAGE, |
251 }; | 250 }; |
252 | 251 |
253 NavigationHandleImpl(const GURL& url, | 252 NavigationHandleImpl(const GURL& url, |
254 FrameTreeNode* frame_tree_node, | 253 FrameTreeNode* frame_tree_node, |
255 bool is_renderer_initiated, | 254 bool is_renderer_initiated, |
256 bool is_synchronous, | 255 bool is_same_page, |
257 bool is_srcdoc, | 256 bool is_srcdoc, |
258 const base::TimeTicks& navigation_start, | 257 const base::TimeTicks& navigation_start, |
259 int pending_nav_entry_id); | 258 int pending_nav_entry_id); |
260 | 259 |
261 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); | 260 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); |
262 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); | 261 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); |
263 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); | 262 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); |
264 | 263 |
265 // Helper function to run and reset the |complete_callback_|. This marks the | 264 // Helper function to run and reset the |complete_callback_|. This marks the |
266 // end of a round of NavigationThrottleChecks. | 265 // end of a round of NavigationThrottleChecks. |
267 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); | 266 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); |
268 | 267 |
269 // Used in tests. | 268 // Used in tests. |
270 State state() const { return state_; } | 269 State state() const { return state_; } |
271 | 270 |
272 // Populates |throttles_| with the throttles for this navigation. | 271 // Populates |throttles_| with the throttles for this navigation. |
273 void RegisterNavigationThrottles(); | 272 void RegisterNavigationThrottles(); |
274 | 273 |
275 // See NavigationHandle for a description of those member variables. | 274 // See NavigationHandle for a description of those member variables. |
276 GURL url_; | 275 GURL url_; |
277 Referrer sanitized_referrer_; | 276 Referrer sanitized_referrer_; |
278 bool has_user_gesture_; | 277 bool has_user_gesture_; |
279 ui::PageTransition transition_; | 278 ui::PageTransition transition_; |
280 bool is_external_protocol_; | 279 bool is_external_protocol_; |
281 net::Error net_error_code_; | 280 net::Error net_error_code_; |
282 RenderFrameHostImpl* render_frame_host_; | 281 RenderFrameHostImpl* render_frame_host_; |
283 const bool is_renderer_initiated_; | 282 const bool is_renderer_initiated_; |
284 bool is_same_page_; | 283 const bool is_same_page_; |
285 const bool is_synchronous_; | |
286 const bool is_srcdoc_; | 284 const bool is_srcdoc_; |
287 bool was_redirected_; | 285 bool was_redirected_; |
288 scoped_refptr<net::HttpResponseHeaders> response_headers_; | 286 scoped_refptr<net::HttpResponseHeaders> response_headers_; |
289 | 287 |
290 // The HTTP method used for the navigation. | 288 // The HTTP method used for the navigation. |
291 std::string method_; | 289 std::string method_; |
292 | 290 |
293 // The POST body associated with this navigation. This will be null for GET | 291 // The POST body associated with this navigation. This will be null for GET |
294 // and/or other non-POST requests (or if a response to a POST request was a | 292 // and/or other non-POST requests (or if a response to a POST request was a |
295 // redirect that changed the method to GET - for example 302). | 293 // redirect that changed the method to GET - for example 302). |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 std::unique_ptr<NavigationData> navigation_data_; | 325 std::unique_ptr<NavigationData> navigation_data_; |
328 | 326 |
329 SSLStatus ssl_status_; | 327 SSLStatus ssl_status_; |
330 | 328 |
331 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 329 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
332 }; | 330 }; |
333 | 331 |
334 } // namespace content | 332 } // namespace content |
335 | 333 |
336 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 334 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |