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 #include "content/browser/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 22 matching lines...) Expand all Loading... | |
33 #include "content/browser/frame_host/render_frame_proxy_host.h" | 33 #include "content/browser/frame_host/render_frame_proxy_host.h" |
34 #include "content/browser/renderer_host/render_process_host_impl.h" | 34 #include "content/browser/renderer_host/render_process_host_impl.h" |
35 #include "content/browser/renderer_host/render_view_host_factory.h" | 35 #include "content/browser/renderer_host/render_view_host_factory.h" |
36 #include "content/browser/renderer_host/render_view_host_impl.h" | 36 #include "content/browser/renderer_host/render_view_host_impl.h" |
37 #include "content/browser/site_instance_impl.h" | 37 #include "content/browser/site_instance_impl.h" |
38 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 38 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
39 #include "content/common/frame_messages.h" | 39 #include "content/common/frame_messages.h" |
40 #include "content/common/frame_owner_properties.h" | 40 #include "content/common/frame_owner_properties.h" |
41 #include "content/common/site_isolation_policy.h" | 41 #include "content/common/site_isolation_policy.h" |
42 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
43 #include "content/public/browser/browser_context.h" | |
43 #include "content/public/browser/content_browser_client.h" | 44 #include "content/public/browser/content_browser_client.h" |
44 #include "content/public/browser/render_process_host_observer.h" | 45 #include "content/public/browser/render_process_host_observer.h" |
45 #include "content/public/browser/render_widget_host_iterator.h" | 46 #include "content/public/browser/render_widget_host_iterator.h" |
46 #include "content/public/browser/render_widget_host_view.h" | 47 #include "content/public/browser/render_widget_host_view.h" |
47 #include "content/public/browser/user_metrics.h" | 48 #include "content/public/browser/user_metrics.h" |
48 #include "content/public/common/browser_side_navigation_policy.h" | 49 #include "content/public/common/browser_side_navigation_policy.h" |
49 #include "content/public/common/content_switches.h" | 50 #include "content/public/common/content_switches.h" |
50 #include "content/public/common/referrer.h" | 51 #include "content/public/common/referrer.h" |
51 #include "content/public/common/url_constants.h" | 52 #include "content/public/common/url_constants.h" |
52 | 53 |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 request.common_params().url); | 766 request.common_params().url); |
766 | 767 |
767 no_renderer_swap |= | 768 no_renderer_swap |= |
768 !request.may_transfer() && !can_renderer_initiate_transfer; | 769 !request.may_transfer() && !can_renderer_initiate_transfer; |
769 } else { | 770 } else { |
770 // Subframe navigations will use the current renderer, unless specifically | 771 // Subframe navigations will use the current renderer, unless specifically |
771 // allowed to swap processes. | 772 // allowed to swap processes. |
772 no_renderer_swap |= !CanSubframeSwapProcess( | 773 no_renderer_swap |= !CanSubframeSwapProcess( |
773 request.common_params().url, request.source_site_instance(), | 774 request.common_params().url, request.source_site_instance(), |
774 request.dest_site_instance(), was_server_redirect); | 775 request.dest_site_instance(), was_server_redirect); |
776 | |
777 // Even if the url should warrant a process swap, check if the newly | |
778 // created SiteInstance would use the same StoragePartition as its parent. | |
779 // If that's not the case, the subframe should not swap processes, as there | |
780 // is not support for having an OOPIF that does not share the storage | |
nasko
2017/03/06 18:12:07
nit: StoragePartition.
| |
781 // partition of its parent. | |
782 BrowserContext* browser_context = | |
783 frame_tree_node_->navigator()->GetController()->GetBrowserContext(); | |
784 no_renderer_swap |= BrowserContext::GetStoragePartition( | |
785 browser_context, dest_site_instance.get()) != | |
786 BrowserContext::GetStoragePartition( | |
787 browser_context, frame_tree_node_->parent() | |
788 ->current_frame_host() | |
789 ->GetSiteInstance()); | |
775 } | 790 } |
776 | 791 |
777 if (no_renderer_swap) { | 792 if (no_renderer_swap) { |
778 // GetFrameHostForNavigation will be called more than once during a | 793 // GetFrameHostForNavigation will be called more than once during a |
779 // navigation (currently twice, on request and when it's about to commit in | 794 // navigation (currently twice, on request and when it's about to commit in |
780 // the renderer). In the follow up calls an existing pending WebUI should | 795 // the renderer). In the follow up calls an existing pending WebUI should |
781 // not be recreated if the URL didn't change. So instead of calling | 796 // not be recreated if the URL didn't change. So instead of calling |
782 // CleanUpNavigation just discard the speculative RenderFrameHost if one | 797 // CleanUpNavigation just discard the speculative RenderFrameHost if one |
783 // exists. | 798 // exists. |
784 if (speculative_render_frame_host_) | 799 if (speculative_render_frame_host_) |
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2775 resolved_url)) { | 2790 resolved_url)) { |
2776 DCHECK(!dest_instance || | 2791 DCHECK(!dest_instance || |
2777 dest_instance == render_frame_host_->GetSiteInstance()); | 2792 dest_instance == render_frame_host_->GetSiteInstance()); |
2778 return false; | 2793 return false; |
2779 } | 2794 } |
2780 | 2795 |
2781 return true; | 2796 return true; |
2782 } | 2797 } |
2783 | 2798 |
2784 } // namespace content | 2799 } // namespace content |
OLD | NEW |