Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 1667163002: Add methods to NavigationHandle to allow refactoring webNavigation to use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on Camille's review. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 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,
74 bool is_srcdoc,
73 const base::TimeTicks& navigation_start); 75 const base::TimeTicks& navigation_start);
74 ~NavigationHandleImpl() override; 76 ~NavigationHandleImpl() override;
75 77
76 // NavigationHandle implementation: 78 // NavigationHandle implementation:
77 const GURL& GetURL() override; 79 const GURL& GetURL() override;
78 bool IsInMainFrame() override; 80 bool IsInMainFrame() override;
81 bool IsParentMainFrame() override;
82 bool IsSynchronousNavigation() override;
83 bool IsSrcdoc() override;
84 bool WasServerRedirect() override;
85 int GetFrameTreeNodeId() override;
86 int GetParentFrameTreeNodeId() override;
79 const base::TimeTicks& NavigationStart() override; 87 const base::TimeTicks& NavigationStart() override;
80 bool IsPost() override; 88 bool IsPost() override;
81 const Referrer& GetReferrer() override; 89 const Referrer& GetReferrer() override;
82 bool HasUserGesture() override; 90 bool HasUserGesture() override;
83 ui::PageTransition GetPageTransition() override; 91 ui::PageTransition GetPageTransition() override;
84 bool IsExternalProtocol() override; 92 bool IsExternalProtocol() override;
85 net::Error GetNetErrorCode() override; 93 net::Error GetNetErrorCode() override;
86 RenderFrameHostImpl* GetRenderFrameHost() override; 94 RenderFrameHostImpl* GetRenderFrameHost() override;
87 bool IsSamePage() override; 95 bool IsSamePage() override;
88 bool HasCommitted() override; 96 bool HasCommitted() override;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 WILL_REDIRECT_REQUEST, 202 WILL_REDIRECT_REQUEST,
195 DEFERRING_REDIRECT, 203 DEFERRING_REDIRECT,
196 CANCELING, 204 CANCELING,
197 READY_TO_COMMIT, 205 READY_TO_COMMIT,
198 DID_COMMIT, 206 DID_COMMIT,
199 DID_COMMIT_ERROR_PAGE, 207 DID_COMMIT_ERROR_PAGE,
200 }; 208 };
201 209
202 NavigationHandleImpl(const GURL& url, 210 NavigationHandleImpl(const GURL& url,
203 FrameTreeNode* frame_tree_node, 211 FrameTreeNode* frame_tree_node,
212 bool is_synchronous,
213 bool is_srcdoc,
204 const base::TimeTicks& navigation_start); 214 const base::TimeTicks& navigation_start);
205 215
206 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); 216 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
207 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); 217 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
208 218
209 // Helper function to run and reset the |complete_callback_|. This marks the 219 // Helper function to run and reset the |complete_callback_|. This marks the
210 // end of a round of NavigationThrottleChecks. 220 // end of a round of NavigationThrottleChecks.
211 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); 221 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result);
212 222
213 // Used in tests. 223 // Used in tests.
214 State state() const { return state_; } 224 State state() const { return state_; }
215 225
216 // See NavigationHandle for a description of those member variables. 226 // See NavigationHandle for a description of those member variables.
217 GURL url_; 227 GURL url_;
218 bool is_post_; 228 bool is_post_;
219 Referrer sanitized_referrer_; 229 Referrer sanitized_referrer_;
220 bool has_user_gesture_; 230 bool has_user_gesture_;
221 ui::PageTransition transition_; 231 ui::PageTransition transition_;
222 bool is_external_protocol_; 232 bool is_external_protocol_;
223 net::Error net_error_code_; 233 net::Error net_error_code_;
224 RenderFrameHostImpl* render_frame_host_; 234 RenderFrameHostImpl* render_frame_host_;
225 bool is_same_page_; 235 bool is_same_page_;
236 const bool is_synchronous_;
237 const bool is_srcdoc_;
238 bool was_redirected_;
226 scoped_refptr<net::HttpResponseHeaders> response_headers_; 239 scoped_refptr<net::HttpResponseHeaders> response_headers_;
227 240
228 // The state the navigation is in. 241 // The state the navigation is in.
229 State state_; 242 State state_;
230 243
231 // Whether the navigation is in the middle of a transfer. Set to false when 244 // Whether the navigation is in the middle of a transfer. Set to false when
232 // the DidStartProvisionalLoad is received from the new renderer. 245 // the DidStartProvisionalLoad is received from the new renderer.
233 bool is_transferring_; 246 bool is_transferring_;
234 247
235 // The FrameTreeNode this navigation is happening in. 248 // The FrameTreeNode this navigation is happening in.
(...skipping 15 matching lines...) Expand all
251 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a 264 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
252 // corresponding ServiceWorkerNetworkProvider is created in the renderer. 265 // corresponding ServiceWorkerNetworkProvider is created in the renderer.
253 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; 266 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_;
254 267
255 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 268 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
256 }; 269 };
257 270
258 } // namespace content 271 } // namespace content
259 272
260 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 273 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698