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

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

Issue 1964863002: Persist prompt/block download limiter state on renderer-initiated loads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comments Created 4 years, 7 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // the RenderFrameHost still apply. 62 // the RenderFrameHost still apply.
63 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle { 63 class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
64 public: 64 public:
65 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks 65 // |navigation_start| comes from the DidStartProvisionalLoad IPC, which tracks
66 // both renderer-initiated and browser-initiated navigation start. 66 // both renderer-initiated and browser-initiated navigation start.
67 // PlzNavigate: This value always comes from the CommonNavigationParams 67 // PlzNavigate: This value always comes from the CommonNavigationParams
68 // associated with this navigation. 68 // associated with this navigation.
69 static std::unique_ptr<NavigationHandleImpl> Create( 69 static std::unique_ptr<NavigationHandleImpl> Create(
70 const GURL& url, 70 const GURL& url,
71 FrameTreeNode* frame_tree_node, 71 FrameTreeNode* frame_tree_node,
72 bool is_renderer_initiated,
72 bool is_synchronous, 73 bool is_synchronous,
73 bool is_srcdoc, 74 bool is_srcdoc,
74 const base::TimeTicks& navigation_start, 75 const base::TimeTicks& navigation_start,
75 int pending_nav_entry_id); 76 int pending_nav_entry_id);
76 ~NavigationHandleImpl() override; 77 ~NavigationHandleImpl() override;
77 78
78 // NavigationHandle implementation: 79 // NavigationHandle implementation:
79 const GURL& GetURL() override; 80 const GURL& GetURL() override;
80 bool IsInMainFrame() override; 81 bool IsInMainFrame() override;
81 bool IsParentMainFrame() override; 82 bool IsParentMainFrame() override;
83 bool IsRendererInitiated() override;
82 bool IsSynchronousNavigation() override; 84 bool IsSynchronousNavigation() override;
83 bool IsSrcdoc() override; 85 bool IsSrcdoc() override;
84 bool WasServerRedirect() override; 86 bool WasServerRedirect() override;
85 int GetFrameTreeNodeId() override; 87 int GetFrameTreeNodeId() override;
86 int GetParentFrameTreeNodeId() override; 88 int GetParentFrameTreeNodeId() override;
87 const base::TimeTicks& NavigationStart() override; 89 const base::TimeTicks& NavigationStart() override;
88 bool IsPost() override; 90 bool IsPost() override;
89 const Referrer& GetReferrer() override; 91 const Referrer& GetReferrer() override;
90 bool HasUserGesture() override; 92 bool HasUserGesture() override;
91 ui::PageTransition GetPageTransition() override; 93 ui::PageTransition GetPageTransition() override;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 CANCELING, 226 CANCELING,
225 WILL_PROCESS_RESPONSE, 227 WILL_PROCESS_RESPONSE,
226 DEFERRING_RESPONSE, 228 DEFERRING_RESPONSE,
227 READY_TO_COMMIT, 229 READY_TO_COMMIT,
228 DID_COMMIT, 230 DID_COMMIT,
229 DID_COMMIT_ERROR_PAGE, 231 DID_COMMIT_ERROR_PAGE,
230 }; 232 };
231 233
232 NavigationHandleImpl(const GURL& url, 234 NavigationHandleImpl(const GURL& url,
233 FrameTreeNode* frame_tree_node, 235 FrameTreeNode* frame_tree_node,
236 bool is_renderer_initiated,
234 bool is_synchronous, 237 bool is_synchronous,
235 bool is_srcdoc, 238 bool is_srcdoc,
236 const base::TimeTicks& navigation_start, 239 const base::TimeTicks& navigation_start,
237 int pending_nav_entry_id); 240 int pending_nav_entry_id);
238 241
239 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); 242 NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
240 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); 243 NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
241 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse(); 244 NavigationThrottle::ThrottleCheckResult CheckWillProcessResponse();
242 245
243 // Helper function to run and reset the |complete_callback_|. This marks the 246 // Helper function to run and reset the |complete_callback_|. This marks the
244 // end of a round of NavigationThrottleChecks. 247 // end of a round of NavigationThrottleChecks.
245 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result); 248 void RunCompleteCallback(NavigationThrottle::ThrottleCheckResult result);
246 249
247 // Used in tests. 250 // Used in tests.
248 State state() const { return state_; } 251 State state() const { return state_; }
249 252
250 // See NavigationHandle for a description of those member variables. 253 // See NavigationHandle for a description of those member variables.
251 GURL url_; 254 GURL url_;
252 Referrer sanitized_referrer_; 255 Referrer sanitized_referrer_;
253 bool has_user_gesture_; 256 bool has_user_gesture_;
254 ui::PageTransition transition_; 257 ui::PageTransition transition_;
255 bool is_external_protocol_; 258 bool is_external_protocol_;
256 net::Error net_error_code_; 259 net::Error net_error_code_;
257 RenderFrameHostImpl* render_frame_host_; 260 RenderFrameHostImpl* render_frame_host_;
261 const bool is_renderer_initiated_;
258 bool is_same_page_; 262 bool is_same_page_;
259 const bool is_synchronous_; 263 const bool is_synchronous_;
260 const bool is_srcdoc_; 264 const bool is_srcdoc_;
261 bool was_redirected_; 265 bool was_redirected_;
262 scoped_refptr<net::HttpResponseHeaders> response_headers_; 266 scoped_refptr<net::HttpResponseHeaders> response_headers_;
263 267
264 // The HTTP method used for the navigation. 268 // The HTTP method used for the navigation.
265 std::string method_; 269 std::string method_;
266 270
267 // The state the navigation is in. 271 // The state the navigation is in.
(...skipping 25 matching lines...) Expand all
293 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a 297 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
294 // corresponding ServiceWorkerNetworkProvider is created in the renderer. 298 // corresponding ServiceWorkerNetworkProvider is created in the renderer.
295 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; 299 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_;
296 300
297 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 301 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
298 }; 302 };
299 303
300 } // namespace content 304 } // namespace content
301 305
302 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 306 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698