| 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 SetExpectedProcess(RenderProcessHost* expected_process); |
| 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 destination site URL for this navigation. 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_; |
| 439 const bool is_same_page_; | 451 const bool is_same_page_; |
| 440 bool was_redirected_; | 452 bool was_redirected_; |
| 441 bool did_replace_entry_; | 453 bool did_replace_entry_; |
| 442 bool should_update_history_; | 454 bool should_update_history_; |
| 443 bool subframe_entry_committed_; | 455 bool subframe_entry_committed_; |
| 444 scoped_refptr<net::HttpResponseHeaders> response_headers_; | 456 scoped_refptr<net::HttpResponseHeaders> response_headers_; |
| 445 net::HttpResponseInfo::ConnectionInfo connection_info_; | 457 net::HttpResponseInfo::ConnectionInfo connection_info_; |
| 446 | 458 |
| 447 // The original url of the navigation. This may differ from |url_| if the | 459 // The original url of the navigation. This may differ from |url_| if the |
| 448 // navigation encounters redirects. | 460 // navigation encounters redirects. |
| 449 const GURL original_url_; | 461 const GURL original_url_; |
| 450 | 462 |
| 463 // The site URL of this navigation, as obtained from SiteInstance::GetSiteURL. |
| 464 GURL site_url_; |
| 465 |
| 451 // The HTTP method used for the navigation. | 466 // The HTTP method used for the navigation. |
| 452 std::string method_; | 467 std::string method_; |
| 453 | 468 |
| 454 // The POST body associated with this navigation. This will be null for GET | 469 // The POST body associated with this navigation. This will be null for GET |
| 455 // and/or other non-POST requests (or if a response to a POST request was a | 470 // and/or other non-POST requests (or if a response to a POST request was a |
| 456 // redirect that changed the method to GET - for example 302). | 471 // redirect that changed the method to GET - for example 302). |
| 457 scoped_refptr<ResourceRequestBodyImpl> resource_request_body_; | 472 scoped_refptr<ResourceRequestBodyImpl> resource_request_body_; |
| 458 | 473 |
| 459 // The state the navigation is in. | 474 // The state the navigation is in. |
| 460 State state_; | 475 State state_; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 CSPDisposition should_check_main_world_csp_; | 569 CSPDisposition should_check_main_world_csp_; |
| 555 | 570 |
| 556 // Whether or not the navigation results from the submission of a form. | 571 // Whether or not the navigation results from the submission of a form. |
| 557 bool is_form_submission_; | 572 bool is_form_submission_; |
| 558 | 573 |
| 559 // PlzNavigate | 574 // PlzNavigate |
| 560 // Information about the JavaScript that started the navigation. For | 575 // Information about the JavaScript that started the navigation. For |
| 561 // navigations initiated by Javascript. | 576 // navigations initiated by Javascript. |
| 562 SourceLocation source_location_; | 577 SourceLocation source_location_; |
| 563 | 578 |
| 579 // PlzNavigate |
| 580 // Used to inform a RenderProcessHost that we expect this navigation to commit |
| 581 // in it. |
| 582 int expected_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 |