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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
804 request.common_params().url); | 805 request.common_params().url); |
805 | 806 |
806 no_renderer_swap |= | 807 no_renderer_swap |= |
807 !request.may_transfer() && !can_renderer_initiate_transfer; | 808 !request.may_transfer() && !can_renderer_initiate_transfer; |
808 } else { | 809 } else { |
809 // Subframe navigations will use the current renderer, unless specifically | 810 // Subframe navigations will use the current renderer, unless specifically |
810 // allowed to swap processes. | 811 // allowed to swap processes. |
811 no_renderer_swap |= !CanSubframeSwapProcess( | 812 no_renderer_swap |= !CanSubframeSwapProcess( |
812 request.common_params().url, request.source_site_instance(), | 813 request.common_params().url, request.source_site_instance(), |
813 request.dest_site_instance(), was_server_redirect); | 814 request.dest_site_instance(), was_server_redirect); |
815 | |
816 // Even if the url should warrant a process swap, check if the newly created | |
817 // SiteInstance would use the same storage partition as its parent. If | |
nasko
2017/03/03 23:04:23
nit: StoragePartition
arthursonzogni
2017/03/06 15:10:13
Done.
| |
818 // that's not the case, the subframe should not swap processes, as there is | |
819 // not support for having an OOPIF that does not share the storage partition | |
820 // of its parent. | |
nasko
2017/03/03 23:04:23
That seems like a good property to enforce long te
arthursonzogni
2017/03/06 15:10:13
I moved it to:
https://codereview.chromium.org/273
| |
821 BrowserContext* browser_context = | |
822 frame_tree_node_->navigator()->GetController()->GetBrowserContext(); | |
823 bool share_parent_storage_partition = | |
824 BrowserContext::GetStoragePartition(browser_context, | |
825 dest_site_instance.get()) == | |
826 BrowserContext::GetStoragePartition(browser_context, | |
827 frame_tree_node_->parent() | |
828 ->current_frame_host() | |
829 ->GetSiteInstance()); | |
830 no_renderer_swap |= | |
831 (!SiteIsolationPolicy::UseDedicatedProcessesForAllSites() && | |
nasko
2017/03/03 23:04:23
Why check for UseDedicatedProcessesForAllSites? If
arthursonzogni
2017/03/06 15:10:13
I checked with Camille. It was because what is wri
| |
832 !share_parent_storage_partition); | |
814 } | 833 } |
815 | 834 |
816 if (no_renderer_swap) { | 835 if (no_renderer_swap) { |
817 // GetFrameHostForNavigation will be called more than once during a | 836 // GetFrameHostForNavigation will be called more than once during a |
818 // navigation (currently twice, on request and when it's about to commit in | 837 // navigation (currently twice, on request and when it's about to commit in |
819 // the renderer). In the follow up calls an existing pending WebUI should | 838 // the renderer). In the follow up calls an existing pending WebUI should |
820 // not be recreated if the URL didn't change. So instead of calling | 839 // not be recreated if the URL didn't change. So instead of calling |
821 // CleanUpNavigation just discard the speculative RenderFrameHost if one | 840 // CleanUpNavigation just discard the speculative RenderFrameHost if one |
822 // exists. | 841 // exists. |
823 if (speculative_render_frame_host_) | 842 if (speculative_render_frame_host_) |
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2814 resolved_url)) { | 2833 resolved_url)) { |
2815 DCHECK(!dest_instance || | 2834 DCHECK(!dest_instance || |
2816 dest_instance == render_frame_host_->GetSiteInstance()); | 2835 dest_instance == render_frame_host_->GetSiteInstance()); |
2817 return false; | 2836 return false; |
2818 } | 2837 } |
2819 | 2838 |
2820 return true; | 2839 return true; |
2821 } | 2840 } |
2822 | 2841 |
2823 } // namespace content | 2842 } // namespace content |
OLD | NEW |