Chromium Code Reviews| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 373 | 373 |
| 374 CSPDisposition should_check_main_world_csp() const { | 374 CSPDisposition should_check_main_world_csp() const { |
| 375 return should_check_main_world_csp_; | 375 return should_check_main_world_csp_; |
| 376 } | 376 } |
| 377 | 377 |
| 378 const SourceLocation& source_location() const { return source_location_; } | 378 const SourceLocation& source_location() const { return source_location_; } |
| 379 void set_source_location(const SourceLocation& source_location) { | 379 void set_source_location(const SourceLocation& source_location) { |
| 380 source_location_ = source_location; | 380 source_location_ = source_location; |
| 381 } | 381 } |
| 382 | 382 |
| 383 // PlzNavigate | |
| 384 // Sets ID of the RenderProcessHost we expect the navigation to commit in. | |
| 385 // This is used to inform the RenderProcessHost to expect a navigation to the | |
| 386 // url we're navigating to. | |
| 387 void SetSpeculativeProcess(RenderProcessHost* speculative_host); | |
| 388 | |
| 383 private: | 389 private: |
| 384 friend class NavigationHandleImplTest; | 390 friend class NavigationHandleImplTest; |
| 385 | 391 |
| 386 NavigationHandleImpl(const GURL& url, | 392 NavigationHandleImpl(const GURL& url, |
| 387 const std::vector<GURL>& redirect_chain, | 393 const std::vector<GURL>& redirect_chain, |
| 388 FrameTreeNode* frame_tree_node, | 394 FrameTreeNode* frame_tree_node, |
| 389 bool is_renderer_initiated, | 395 bool is_renderer_initiated, |
| 390 bool is_same_page, | 396 bool is_same_page, |
| 391 const base::TimeTicks& navigation_start, | 397 const base::TimeTicks& navigation_start, |
| 392 int pending_nav_entry_id, | 398 int pending_nav_entry_id, |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 419 State state() const { return state_; } | 425 State state() const { return state_; } |
| 420 | 426 |
| 421 // Populates |throttles_| with the throttles for this navigation. | 427 // Populates |throttles_| with the throttles for this navigation. |
| 422 void RegisterNavigationThrottles(); | 428 void RegisterNavigationThrottles(); |
| 423 | 429 |
| 424 // Checks for attempts to navigate to a page that is already referenced more | 430 // Checks for attempts to navigate to a page that is already referenced more |
| 425 // than once in the frame's ancestors. This is a helper function used by | 431 // than once in the frame's ancestors. This is a helper function used by |
| 426 // WillStartRequest and WillRedirectRequest to prevent the navigation. | 432 // WillStartRequest and WillRedirectRequest to prevent the navigation. |
| 427 bool IsSelfReferentialURL(); | 433 bool IsSelfReferentialURL(); |
| 428 | 434 |
| 435 // Updates the SiteURL this navigation is navigating to. This is called on | |
| 436 // redirects. | |
| 437 // PlzNavigate: When redirected cross-site, the speculative RenderProcessHost | |
| 438 // will stop expecting this navigation to commit. | |
| 439 void UpdateSiteURL(); | |
| 440 | |
| 429 // See NavigationHandle for a description of those member variables. | 441 // See NavigationHandle for a description of those member variables. |
| 430 GURL url_; | 442 GURL url_; |
| 431 scoped_refptr<SiteInstance> starting_site_instance_; | 443 scoped_refptr<SiteInstance> starting_site_instance_; |
| 432 Referrer sanitized_referrer_; | 444 Referrer sanitized_referrer_; |
| 433 bool has_user_gesture_; | 445 bool has_user_gesture_; |
| 434 ui::PageTransition transition_; | 446 ui::PageTransition transition_; |
| 435 bool is_external_protocol_; | 447 bool is_external_protocol_; |
| 436 net::Error net_error_code_; | 448 net::Error net_error_code_; |
| 437 RenderFrameHostImpl* render_frame_host_; | 449 RenderFrameHostImpl* render_frame_host_; |
| 438 const bool is_renderer_initiated_; | 450 const bool is_renderer_initiated_; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 554 CSPDisposition should_check_main_world_csp_; | 566 CSPDisposition should_check_main_world_csp_; |
| 555 | 567 |
| 556 // Whether or not the navigation results from the submission of a form. | 568 // Whether or not the navigation results from the submission of a form. |
| 557 bool is_form_submission_; | 569 bool is_form_submission_; |
| 558 | 570 |
| 559 // PlzNavigate | 571 // PlzNavigate |
| 560 // Information about the JavaScript that started the navigation. For | 572 // Information about the JavaScript that started the navigation. For |
| 561 // navigations initiated by Javascript. | 573 // navigations initiated by Javascript. |
| 562 SourceLocation source_location_; | 574 SourceLocation source_location_; |
| 563 | 575 |
| 576 // The SiteURL of this navigation. | |
|
Charlie Reis
2017/05/18 00:58:34
nit: The site URL of this navigation, as obtained
clamy
2017/05/22 16:59:52
Done.
| |
| 577 GURL site_url_; | |
| 578 | |
| 579 // PlzNavigate | |
| 580 // Used to inform a RenderProcessHost that we expect this navigation to commit | |
| 581 // in it. | |
| 582 int speculative_render_process_host_id_; | |
| 583 | |
| 564 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; | 584 base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; |
| 565 | 585 |
| 566 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 586 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
| 567 }; | 587 }; |
| 568 | 588 |
| 569 } // namespace content | 589 } // namespace content |
| 570 | 590 |
| 571 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 591 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
| OLD | NEW |