Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 2732883003: OOPIF: Prevent process swap when not sharing the StoragePartition. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 3ec87d36263b55afd0769088dbaf5edcc6980a7e..66dcee66dcc35059bf923b25ab6f54857474fe07 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -40,6 +40,7 @@
#include "content/common/frame_owner_properties.h"
#include "content/common/site_isolation_policy.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_process_host_observer.h"
#include "content/public/browser/render_widget_host_iterator.h"
@@ -772,6 +773,20 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
no_renderer_swap |= !CanSubframeSwapProcess(
request.common_params().url, request.source_site_instance(),
request.dest_site_instance(), was_server_redirect);
+
+ // Even if the url should warrant a process swap, check if the newly
+ // created SiteInstance would use the same StoragePartition as its parent.
+ // If that's not the case, the subframe should not swap processes, as there
+ // is not support for having an OOPIF that does not share the storage
nasko 2017/03/06 18:12:07 nit: StoragePartition.
+ // partition of its parent.
+ BrowserContext* browser_context =
+ frame_tree_node_->navigator()->GetController()->GetBrowserContext();
+ no_renderer_swap |= BrowserContext::GetStoragePartition(
+ browser_context, dest_site_instance.get()) !=
+ BrowserContext::GetStoragePartition(
+ browser_context, frame_tree_node_->parent()
+ ->current_frame_host()
+ ->GetSiteInstance());
}
if (no_renderer_swap) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698