| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // PlzNavigate: This value always comes from the CommonNavigationParams | 74 // PlzNavigate: This value always comes from the CommonNavigationParams |
| 75 // associated with this navigation. | 75 // associated with this navigation. |
| 76 static std::unique_ptr<NavigationHandleImpl> Create( | 76 static std::unique_ptr<NavigationHandleImpl> Create( |
| 77 const GURL& url, | 77 const GURL& url, |
| 78 FrameTreeNode* frame_tree_node, | 78 FrameTreeNode* frame_tree_node, |
| 79 bool is_renderer_initiated, | 79 bool is_renderer_initiated, |
| 80 bool is_same_page, | 80 bool is_same_page, |
| 81 bool is_srcdoc, | 81 bool is_srcdoc, |
| 82 const base::TimeTicks& navigation_start, | 82 const base::TimeTicks& navigation_start, |
| 83 int pending_nav_entry_id, | 83 int pending_nav_entry_id, |
| 84 NavigationGesture gesture, |
| 84 bool started_from_context_menu); | 85 bool started_from_context_menu); |
| 85 ~NavigationHandleImpl() override; | 86 ~NavigationHandleImpl() override; |
| 86 | 87 |
| 87 // NavigationHandle implementation: | 88 // NavigationHandle implementation: |
| 88 const GURL& GetURL() override; | 89 const GURL& GetURL() override; |
| 89 SiteInstance* GetStartingSiteInstance() override; | 90 SiteInstance* GetStartingSiteInstance() override; |
| 90 bool IsInMainFrame() override; | 91 bool IsInMainFrame() override; |
| 91 bool IsParentMainFrame() override; | 92 bool IsParentMainFrame() override; |
| 92 bool IsRendererInitiated() override; | 93 bool IsRendererInitiated() override; |
| 93 bool IsSrcdoc() override; | 94 bool IsSrcdoc() override; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 108 const net::HttpResponseHeaders* GetResponseHeaders() override; | 109 const net::HttpResponseHeaders* GetResponseHeaders() override; |
| 109 net::HttpResponseInfo::ConnectionInfo GetConnectionInfo() override; | 110 net::HttpResponseInfo::ConnectionInfo GetConnectionInfo() override; |
| 110 void Resume() override; | 111 void Resume() override; |
| 111 void CancelDeferredNavigation( | 112 void CancelDeferredNavigation( |
| 112 NavigationThrottle::ThrottleCheckResult result) override; | 113 NavigationThrottle::ThrottleCheckResult result) override; |
| 113 void RegisterThrottleForTesting( | 114 void RegisterThrottleForTesting( |
| 114 std::unique_ptr<NavigationThrottle> navigation_throttle) override; | 115 std::unique_ptr<NavigationThrottle> navigation_throttle) override; |
| 115 NavigationThrottle::ThrottleCheckResult CallWillStartRequestForTesting( | 116 NavigationThrottle::ThrottleCheckResult CallWillStartRequestForTesting( |
| 116 bool is_post, | 117 bool is_post, |
| 117 const Referrer& sanitized_referrer, | 118 const Referrer& sanitized_referrer, |
| 118 bool has_user_gesture, | |
| 119 ui::PageTransition transition, | 119 ui::PageTransition transition, |
| 120 bool is_external_protocol) override; | 120 bool is_external_protocol) override; |
| 121 NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting( | 121 NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting( |
| 122 const GURL& new_url, | 122 const GURL& new_url, |
| 123 bool new_method_is_post, | 123 bool new_method_is_post, |
| 124 const GURL& new_referrer_url, | 124 const GURL& new_referrer_url, |
| 125 bool new_is_external_protocol) override; | 125 bool new_is_external_protocol) override; |
| 126 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting( | 126 NavigationThrottle::ThrottleCheckResult CallWillProcessResponseForTesting( |
| 127 RenderFrameHost* render_frame_host, | 127 RenderFrameHost* render_frame_host, |
| 128 const std::string& raw_response_header) override; | 128 const std::string& raw_response_header) override; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 typedef base::Callback<void(NavigationThrottle::ThrottleCheckResult)> | 196 typedef base::Callback<void(NavigationThrottle::ThrottleCheckResult)> |
| 197 ThrottleChecksFinishedCallback; | 197 ThrottleChecksFinishedCallback; |
| 198 | 198 |
| 199 // Called when the URLRequest will start in the network stack. |callback| | 199 // Called when the URLRequest will start in the network stack. |callback| |
| 200 // will be called when all throttle checks have completed. This will allow | 200 // will be called when all throttle checks have completed. This will allow |
| 201 // the caller to cancel the navigation or let it proceed. | 201 // the caller to cancel the navigation or let it proceed. |
| 202 void WillStartRequest( | 202 void WillStartRequest( |
| 203 const std::string& method, | 203 const std::string& method, |
| 204 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, | 204 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, |
| 205 const Referrer& sanitized_referrer, | 205 const Referrer& sanitized_referrer, |
| 206 bool has_user_gesture, | |
| 207 ui::PageTransition transition, | 206 ui::PageTransition transition, |
| 208 bool is_external_protocol, | 207 bool is_external_protocol, |
| 209 RequestContextType request_context_type, | 208 RequestContextType request_context_type, |
| 210 const ThrottleChecksFinishedCallback& callback); | 209 const ThrottleChecksFinishedCallback& callback); |
| 211 | 210 |
| 212 // Called when the URLRequest will be redirected in the network stack. | 211 // Called when the URLRequest will be redirected in the network stack. |
| 213 // |callback| will be called when all throttles check have completed. This | 212 // |callback| will be called when all throttles check have completed. This |
| 214 // will allow the caller to cancel the navigation or let it proceed. | 213 // will allow the caller to cancel the navigation or let it proceed. |
| 215 // This will also inform the delegate that the request was redirected. | 214 // This will also inform the delegate that the request was redirected. |
| 216 void WillRedirectRequest( | 215 void WillRedirectRequest( |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 DID_COMMIT_ERROR_PAGE, | 305 DID_COMMIT_ERROR_PAGE, |
| 307 }; | 306 }; |
| 308 | 307 |
| 309 NavigationHandleImpl(const GURL& url, | 308 NavigationHandleImpl(const GURL& url, |
| 310 FrameTreeNode* frame_tree_node, | 309 FrameTreeNode* frame_tree_node, |
| 311 bool is_renderer_initiated, | 310 bool is_renderer_initiated, |
| 312 bool is_same_page, | 311 bool is_same_page, |
| 313 bool is_srcdoc, | 312 bool is_srcdoc, |
| 314 const base::TimeTicks& navigation_start, | 313 const base::TimeTicks& navigation_start, |
| 315 int pending_nav_entry_id, | 314 int pending_nav_entry_id, |
| 315 NavigationGesture gesture, |
| 316 bool started_from_context_menu); | 316 bool started_from_context_menu); |
| 317 | 317 |
| 318 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); | 318 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); |
| 319 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); | 319 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); |
| 320 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); | 320 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); |
| 321 | 321 |
| 322 // Called when WillProcessResponse checks are done, to find the final | 322 // Called when WillProcessResponse checks are done, to find the final |
| 323 // RenderFrameHost for the navigation. Checks whether the navigation should be | 323 // RenderFrameHost for the navigation. Checks whether the navigation should be |
| 324 // transferred. Returns false if the transfer attempt results in the | 324 // transferred. Returns false if the transfer attempt results in the |
| 325 // destruction of this NavigationHandle and the navigation should no longer | 325 // destruction of this NavigationHandle and the navigation should no longer |
| (...skipping 13 matching lines...) Expand all Loading... |
| 339 // Used in tests. | 339 // Used in tests. |
| 340 State state() const { return state_; } | 340 State state() const { return state_; } |
| 341 | 341 |
| 342 // Populates |throttles_| with the throttles for this navigation. | 342 // Populates |throttles_| with the throttles for this navigation. |
| 343 void RegisterNavigationThrottles(); | 343 void RegisterNavigationThrottles(); |
| 344 | 344 |
| 345 // See NavigationHandle for a description of those member variables. | 345 // See NavigationHandle for a description of those member variables. |
| 346 GURL url_; | 346 GURL url_; |
| 347 scoped_refptr<SiteInstance> starting_site_instance_; | 347 scoped_refptr<SiteInstance> starting_site_instance_; |
| 348 Referrer sanitized_referrer_; | 348 Referrer sanitized_referrer_; |
| 349 bool has_user_gesture_; | 349 const NavigationGesture gesture_; |
| 350 ui::PageTransition transition_; | 350 ui::PageTransition transition_; |
| 351 bool is_external_protocol_; | 351 bool is_external_protocol_; |
| 352 net::Error net_error_code_; | 352 net::Error net_error_code_; |
| 353 RenderFrameHostImpl* render_frame_host_; | 353 RenderFrameHostImpl* render_frame_host_; |
| 354 const bool is_renderer_initiated_; | 354 const bool is_renderer_initiated_; |
| 355 const bool is_same_page_; | 355 const bool is_same_page_; |
| 356 const bool is_srcdoc_; | 356 const bool is_srcdoc_; |
| 357 bool was_redirected_; | 357 bool was_redirected_; |
| 358 scoped_refptr<net::HttpResponseHeaders> response_headers_; | 358 scoped_refptr<net::HttpResponseHeaders> response_headers_; |
| 359 net::HttpResponseInfo::ConnectionInfo connection_info_; | 359 net::HttpResponseInfo::ConnectionInfo connection_info_; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 std::string searchable_form_encoding_; | 435 std::string searchable_form_encoding_; |
| 436 | 436 |
| 437 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; | 437 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; |
| 438 | 438 |
| 439 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 439 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| 440 }; | 440 }; |
| 441 | 441 |
| 442 } // namespace content | 442 } // namespace content |
| 443 | 443 |
| 444 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 444 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
| OLD | NEW |