| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 70 static std::unique_ptr<NavigationHandleImpl> Create( | 70 static std::unique_ptr<NavigationHandleImpl> Create( |
| 71 const GURL& url, | 71 const GURL& url, |
| 72 FrameTreeNode* frame_tree_node, | 72 FrameTreeNode* frame_tree_node, |
| 73 bool is_renderer_initiated, |
| 73 bool is_synchronous, | 74 bool is_synchronous, |
| 74 bool is_srcdoc, | 75 bool is_srcdoc, |
| 75 const base::TimeTicks& navigation_start, | 76 const base::TimeTicks& navigation_start, |
| 76 int pending_nav_entry_id); | 77 int pending_nav_entry_id); |
| 77 ~NavigationHandleImpl() override; | 78 ~NavigationHandleImpl() override; |
| 78 | 79 |
| 79 // NavigationHandle implementation: | 80 // NavigationHandle implementation: |
| 80 const GURL& GetURL() override; | 81 const GURL& GetURL() override; |
| 81 bool IsInMainFrame() override; | 82 bool IsInMainFrame() override; |
| 82 bool IsParentMainFrame() override; | 83 bool IsParentMainFrame() override; |
| 84 bool IsRendererInitiated() override; |
| 83 bool IsSynchronousNavigation() override; | 85 bool IsSynchronousNavigation() override; |
| 84 bool IsSrcdoc() override; | 86 bool IsSrcdoc() override; |
| 85 bool WasServerRedirect() override; | 87 bool WasServerRedirect() override; |
| 86 int GetFrameTreeNodeId() override; | 88 int GetFrameTreeNodeId() override; |
| 87 int GetParentFrameTreeNodeId() override; | 89 int GetParentFrameTreeNodeId() override; |
| 88 const base::TimeTicks& NavigationStart() override; | 90 const base::TimeTicks& NavigationStart() override; |
| 89 bool IsPost() override; | 91 bool IsPost() override; |
| 90 const Referrer& GetReferrer() override; | 92 const Referrer& GetReferrer() override; |
| 91 bool HasUserGesture() override; | 93 bool HasUserGesture() override; |
| 92 ui::PageTransition GetPageTransition() override; | 94 ui::PageTransition GetPageTransition() override; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 CANCELING, | 235 CANCELING, |
| 234 WILL_PROCESS_RESPONSE, | 236 WILL_PROCESS_RESPONSE, |
| 235 DEFERRING_RESPONSE, | 237 DEFERRING_RESPONSE, |
| 236 READY_TO_COMMIT, | 238 READY_TO_COMMIT, |
| 237 DID_COMMIT, | 239 DID_COMMIT, |
| 238 DID_COMMIT_ERROR_PAGE, | 240 DID_COMMIT_ERROR_PAGE, |
| 239 }; | 241 }; |
| 240 | 242 |
| 241 NavigationHandleImpl(const GURL& url, | 243 NavigationHandleImpl(const GURL& url, |
| 242 FrameTreeNode* frame_tree_node, | 244 FrameTreeNode* frame_tree_node, |
| 245 bool is_renderer_initiated, |
| 243 bool is_synchronous, | 246 bool is_synchronous, |
| 244 bool is_srcdoc, | 247 bool is_srcdoc, |
| 245 const base::TimeTicks& navigation_start, | 248 const base::TimeTicks& navigation_start, |
| 246 int pending_nav_entry_id); | 249 int pending_nav_entry_id); |
| 247 | 250 |
| 248 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); | 251 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); |
| 249 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); | 252 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); |
| 250 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); | 253 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); |
| 251 | 254 |
| 252 // Helper function to run and reset the |complete_callback_|. This marks the | 255 // Helper function to run and reset the |complete_callback_|. This marks the |
| 253 // end of a round of NavigationThrottleChecks. | 256 // end of a round of NavigationThrottleChecks. |
| 254 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); | 257 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); |
| 255 | 258 |
| 256 // Used in tests. | 259 // Used in tests. |
| 257 State state() const { return state_; } | 260 State state() const { return state_; } |
| 258 | 261 |
| 259 // See NavigationHandle for a description of those member variables. | 262 // See NavigationHandle for a description of those member variables. |
| 260 GURL url_; | 263 GURL url_; |
| 261 Referrer sanitized_referrer_; | 264 Referrer sanitized_referrer_; |
| 262 bool has_user_gesture_; | 265 bool has_user_gesture_; |
| 263 ui::PageTransition transition_; | 266 ui::PageTransition transition_; |
| 264 bool is_external_protocol_; | 267 bool is_external_protocol_; |
| 265 net::Error net_error_code_; | 268 net::Error net_error_code_; |
| 266 RenderFrameHostImpl* render_frame_host_; | 269 RenderFrameHostImpl* render_frame_host_; |
| 270 const bool is_renderer_initiated_; |
| 267 bool is_same_page_; | 271 bool is_same_page_; |
| 268 const bool is_synchronous_; | 272 const bool is_synchronous_; |
| 269 const bool is_srcdoc_; | 273 const bool is_srcdoc_; |
| 270 bool was_redirected_; | 274 bool was_redirected_; |
| 271 scoped_refptr<net::HttpResponseHeaders> response_headers_; | 275 scoped_refptr<net::HttpResponseHeaders> response_headers_; |
| 272 | 276 |
| 273 // The HTTP method used for the navigation. | 277 // The HTTP method used for the navigation. |
| 274 std::string method_; | 278 std::string method_; |
| 275 | 279 |
| 276 // The state the navigation is in. | 280 // The state the navigation is in. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 305 | 309 |
| 306 // Embedder data tied to this navigation. | 310 // Embedder data tied to this navigation. |
| 307 std::unique_ptr<NavigationData> navigation_data_; | 311 std::unique_ptr<NavigationData> navigation_data_; |
| 308 | 312 |
| 309 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 313 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| 310 }; | 314 }; |
| 311 | 315 |
| 312 } // namespace content | 316 } // namespace content |
| 313 | 317 |
| 314 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 318 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
| OLD | NEW |