| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDER_FRAME_HOST_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 bool new_is_view_source_mode) const; | 589 bool new_is_view_source_mode) const; |
| 590 | 590 |
| 591 // Returns the SiteInstance to use for the navigation. | 591 // Returns the SiteInstance to use for the navigation. |
| 592 scoped_refptr<SiteInstance> GetSiteInstanceForNavigation( | 592 scoped_refptr<SiteInstance> GetSiteInstanceForNavigation( |
| 593 const GURL& dest_url, | 593 const GURL& dest_url, |
| 594 SiteInstance* source_instance, | 594 SiteInstance* source_instance, |
| 595 SiteInstance* dest_instance, | 595 SiteInstance* dest_instance, |
| 596 SiteInstance* candidate_instance, | 596 SiteInstance* candidate_instance, |
| 597 ui::PageTransition transition, | 597 ui::PageTransition transition, |
| 598 bool dest_is_restore, | 598 bool dest_is_restore, |
| 599 bool dest_is_view_source_mode); | 599 bool dest_is_view_source_mode, |
| 600 bool was_server_redirect); |
| 600 | 601 |
| 601 // Returns a descriptor of the appropriate SiteInstance object for the given | 602 // Returns a descriptor of the appropriate SiteInstance object for the given |
| 602 // |dest_url|, possibly reusing the current, source or destination | 603 // |dest_url|, possibly reusing the current, source or destination |
| 603 // SiteInstance. The actual SiteInstance can then be obtained calling | 604 // SiteInstance. The actual SiteInstance can then be obtained calling |
| 604 // ConvertToSiteInstance with the descriptor. | 605 // ConvertToSiteInstance with the descriptor. |
| 605 // | 606 // |
| 606 // |source_instance| is the SiteInstance of the frame that initiated the | 607 // |source_instance| is the SiteInstance of the frame that initiated the |
| 607 // navigation. |current_instance| is the SiteInstance of the frame that is | 608 // navigation. |current_instance| is the SiteInstance of the frame that is |
| 608 // currently navigating. |dest_instance| is a predetermined SiteInstance that | 609 // currently navigating. |dest_instance| is a predetermined SiteInstance that |
| 609 // will be used if not null. | 610 // will be used if not null. |
| 610 // For example, if you have a parent frame A, which has a child frame B, and | 611 // For example, if you have a parent frame A, which has a child frame B, and |
| 611 // A is trying to change the src attribute of B, this will cause a navigation | 612 // A is trying to change the src attribute of B, this will cause a navigation |
| 612 // where the source SiteInstance is A and B is the current SiteInstance. | 613 // where the source SiteInstance is A and B is the current SiteInstance. |
| 613 // | 614 // |
| 614 // This is a helper function for GetSiteInstanceForNavigation. | 615 // This is a helper function for GetSiteInstanceForNavigation. |
| 615 SiteInstanceDescriptor DetermineSiteInstanceForURL( | 616 SiteInstanceDescriptor DetermineSiteInstanceForURL( |
| 616 const GURL& dest_url, | 617 const GURL& dest_url, |
| 617 SiteInstance* source_instance, | 618 SiteInstance* source_instance, |
| 618 SiteInstance* current_instance, | 619 SiteInstance* current_instance, |
| 619 SiteInstance* dest_instance, | 620 SiteInstance* dest_instance, |
| 620 ui::PageTransition transition, | 621 ui::PageTransition transition, |
| 621 bool dest_is_restore, | 622 bool dest_is_restore, |
| 622 bool dest_is_view_source_mode, | 623 bool dest_is_view_source_mode, |
| 623 bool force_browsing_instance_swap); | 624 bool force_browsing_instance_swap, |
| 625 bool was_server_redirect); |
| 624 | 626 |
| 625 // Converts a SiteInstanceDescriptor to the actual SiteInstance it describes. | 627 // Converts a SiteInstanceDescriptor to the actual SiteInstance it describes. |
| 626 // If a |candidate_instance| is provided (is not nullptr) and it matches the | 628 // If a |candidate_instance| is provided (is not nullptr) and it matches the |
| 627 // description, it is returned as is. | 629 // description, it is returned as is. |
| 628 scoped_refptr<SiteInstance> ConvertToSiteInstance( | 630 scoped_refptr<SiteInstance> ConvertToSiteInstance( |
| 629 const SiteInstanceDescriptor& descriptor, | 631 const SiteInstanceDescriptor& descriptor, |
| 630 SiteInstance* candidate_instance); | 632 SiteInstance* candidate_instance); |
| 631 | 633 |
| 632 // Returns true if |candidate| is currently on the same web site as dest_url. | 634 // Returns true if |candidate| is currently on the same web site as dest_url. |
| 633 bool IsCurrentlySameSite(RenderFrameHostImpl* candidate, | 635 bool IsCurrentlySameSite(RenderFrameHostImpl* candidate, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 bool is_reload); | 745 bool is_reload); |
| 744 | 746 |
| 745 // Updates the pending WebUI of the current RenderFrameHost for a same-site | 747 // Updates the pending WebUI of the current RenderFrameHost for a same-site |
| 746 // navigation. | 748 // navigation. |
| 747 void UpdatePendingWebUIOnCurrentFrameHost(const GURL& dest_url, | 749 void UpdatePendingWebUIOnCurrentFrameHost(const GURL& dest_url, |
| 748 int entry_bindings); | 750 int entry_bindings); |
| 749 | 751 |
| 750 // Returns true if a subframe can navigate cross-process. | 752 // Returns true if a subframe can navigate cross-process. |
| 751 bool CanSubframeSwapProcess(const GURL& dest_url, | 753 bool CanSubframeSwapProcess(const GURL& dest_url, |
| 752 SiteInstance* source_instance, | 754 SiteInstance* source_instance, |
| 753 SiteInstance* dest_instance); | 755 SiteInstance* dest_instance, |
| 756 bool was_server_redirect); |
| 754 | 757 |
| 755 // For use in creating RenderFrameHosts. | 758 // For use in creating RenderFrameHosts. |
| 756 FrameTreeNode* frame_tree_node_; | 759 FrameTreeNode* frame_tree_node_; |
| 757 | 760 |
| 758 // Our delegate, not owned by us. Guaranteed non-NULL. | 761 // Our delegate, not owned by us. Guaranteed non-NULL. |
| 759 Delegate* delegate_; | 762 Delegate* delegate_; |
| 760 | 763 |
| 761 // Implemented by the owner of this class. These delegates are installed into | 764 // Implemented by the owner of this class. These delegates are installed into |
| 762 // all the RenderFrameHosts that we create. | 765 // all the RenderFrameHosts that we create. |
| 763 RenderFrameHostDelegate* render_frame_delegate_; | 766 RenderFrameHostDelegate* render_frame_delegate_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; | 809 std::unique_ptr<RenderFrameHostImpl> speculative_render_frame_host_; |
| 807 | 810 |
| 808 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; | 811 base::WeakPtrFactory<RenderFrameHostManager> weak_factory_; |
| 809 | 812 |
| 810 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); | 813 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostManager); |
| 811 }; | 814 }; |
| 812 | 815 |
| 813 } // namespace content | 816 } // namespace content |
| 814 | 817 |
| 815 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ | 818 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_MANAGER_H_ |
| OLD | NEW |