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

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

Issue 2954623003: PlzNavigate: implement REUSE_COMMITTED_OR_PENDING_SITE for redirects (Closed)
Patch Set: Addressed comments Created 3 years, 5 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 ui::PageTransition transition, 270 ui::PageTransition transition,
271 bool is_external_protocol, 271 bool is_external_protocol,
272 RequestContextType request_context_type, 272 RequestContextType request_context_type,
273 blink::WebMixedContentContextType mixed_content_context_type, 273 blink::WebMixedContentContextType mixed_content_context_type,
274 const ThrottleChecksFinishedCallback& callback); 274 const ThrottleChecksFinishedCallback& callback);
275 275
276 // Called when the URLRequest will be redirected in the network stack. 276 // Called when the URLRequest will be redirected in the network stack.
277 // |callback| will be called when all throttles check have completed. This 277 // |callback| will be called when all throttles check have completed. This
278 // will allow the caller to cancel the navigation or let it proceed. 278 // will allow the caller to cancel the navigation or let it proceed.
279 // This will also inform the delegate that the request was redirected. 279 // This will also inform the delegate that the request was redirected.
280 //
281 // PlzNavigate: |post_redirect_process_host| is the renderer process we expect
Charlie Reis 2017/06/28 17:05:22 nit: Same here (drop _host)
clamy 2017/06/30 15:12:59 Done.
282 // to use to commit the navigation now that it has been redirected. It can be
283 // null if there is no live process that can be used. In that case, a suitable
284 // renderer process will be created at commit time.
280 void WillRedirectRequest( 285 void WillRedirectRequest(
281 const GURL& new_url, 286 const GURL& new_url,
282 const std::string& new_method, 287 const std::string& new_method,
283 const GURL& new_referrer_url, 288 const GURL& new_referrer_url,
284 bool new_is_external_protocol, 289 bool new_is_external_protocol,
285 scoped_refptr<net::HttpResponseHeaders> response_headers, 290 scoped_refptr<net::HttpResponseHeaders> response_headers,
286 net::HttpResponseInfo::ConnectionInfo connection_info, 291 net::HttpResponseInfo::ConnectionInfo connection_info,
292 RenderProcessHost* post_redirect_process,
287 const ThrottleChecksFinishedCallback& callback); 293 const ThrottleChecksFinishedCallback& callback);
288 294
289 // Called when the URLRequest has delivered response headers and metadata. 295 // Called when the URLRequest has delivered response headers and metadata.
290 // |callback| will be called when all throttle checks have completed, 296 // |callback| will be called when all throttle checks have completed,
291 // allowing the caller to cancel the navigation or let it proceed. 297 // allowing the caller to cancel the navigation or let it proceed.
292 // NavigationHandle will not call |callback| with a result of DEFER. 298 // NavigationHandle will not call |callback| with a result of DEFER.
293 // If the result is PROCEED, then 'ReadyToCommitNavigation' will be called 299 // If the result is PROCEED, then 'ReadyToCommitNavigation' will be called
294 // with |render_frame_host| and |response_headers| just before calling 300 // with |render_frame_host| and |response_headers| just before calling
295 // |callback|. Should a transfer navigation happen, |transfer_callback| will 301 // |callback|. Should a transfer navigation happen, |transfer_callback| will
296 // be run on the IO thread. 302 // be run on the IO thread.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // Populates |throttles_| with the throttles for this navigation. 429 // Populates |throttles_| with the throttles for this navigation.
424 void RegisterNavigationThrottles(); 430 void RegisterNavigationThrottles();
425 431
426 // Checks for attempts to navigate to a page that is already referenced more 432 // Checks for attempts to navigate to a page that is already referenced more
427 // than once in the frame's ancestors. This is a helper function used by 433 // than once in the frame's ancestors. This is a helper function used by
428 // WillStartRequest and WillRedirectRequest to prevent the navigation. 434 // WillStartRequest and WillRedirectRequest to prevent the navigation.
429 bool IsSelfReferentialURL(); 435 bool IsSelfReferentialURL();
430 436
431 // Updates the destination site URL for this navigation. This is called on 437 // Updates the destination site URL for this navigation. This is called on
432 // redirects. 438 // redirects.
433 // PlzNavigate: When redirected cross-site, the speculative RenderProcessHost 439 // PlzNavigate: |post_redirect_process| is the renderer process that should
434 // will stop expecting this navigation to commit. 440 // handle the navigation following the redirect if it can be handled by an
435 void UpdateSiteURL(); 441 // existing RenderProcessHost. Otherwise, it should be null.
442 void UpdateSiteURL(RenderProcessHost* post_redirect_process);
436 443
437 // See NavigationHandle for a description of those member variables. 444 // See NavigationHandle for a description of those member variables.
438 GURL url_; 445 GURL url_;
439 scoped_refptr<SiteInstance> starting_site_instance_; 446 scoped_refptr<SiteInstance> starting_site_instance_;
440 Referrer sanitized_referrer_; 447 Referrer sanitized_referrer_;
441 bool has_user_gesture_; 448 bool has_user_gesture_;
442 ui::PageTransition transition_; 449 ui::PageTransition transition_;
443 bool is_external_protocol_; 450 bool is_external_protocol_;
444 net::Error net_error_code_; 451 net::Error net_error_code_;
445 RenderFrameHostImpl* render_frame_host_; 452 RenderFrameHostImpl* render_frame_host_;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 int expected_render_process_host_id_; 588 int expected_render_process_host_id_;
582 589
583 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; 590 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_;
584 591
585 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 592 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
586 }; 593 };
587 594
588 } // namespace content 595 } // namespace content
589 596
590 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 597 #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') | content/browser/frame_host/navigation_request.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698