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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2875793002: Why this CL triggers an OilPan crash.
Patch Set: Created 3 years, 7 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 | « content/browser/browsing_instance.cc ('k') | content/browser/site_instance_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 51c20a6a5edc7613df5df254e71128c4a70f7af2..483e83785d96eb8d3214b68796ed779a12e3853c 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -34,6 +34,7 @@
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/frame_host/frame_tree.h"
+#include "content/browser/frame_host/render_frame_proxy_host.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/gpu/gpu_process_host.h"
@@ -304,7 +305,26 @@ bool RenderViewHostImpl::CreateRenderView(
}
params->session_storage_namespace_id =
delegate_->GetSessionStorageNamespace(instance_.get())->id();
- // Ensure the RenderView sets its opener correctly.
+ if (main_frame_routing_id_ != MSG_ROUTING_NONE) {
+ params->browsing_instance_id = RenderFrameHostImpl::FromID(
+ GetProcess()->GetID(), main_frame_routing_id_)
+ ->GetSiteInstance()
+ ->GetBrowsingInstanceId();
+ } else if (opener_frame_route_id != MSG_ROUTING_NONE) {
+ params->browsing_instance_id = RenderFrameHostImpl::FromID(
+ GetProcess()->GetID(), opener_frame_route_id)
+ ->GetSiteInstance()
+ ->GetBrowsingInstanceId();
+ } else if (proxy_route_id != MSG_ROUTING_NONE) {
+ SiteInstance* site_instance = RenderFrameProxyHost::FromID(
+ GetProcess()->GetID(), proxy_route_id)
+ ->GetSiteInstance();
+ params->browsing_instance_id = static_cast<SiteInstanceImpl*>(site_instance)
+ ->GetBrowsingInstanceId();
+ } else {
+ CHECK(false);
+ params->browsing_instance_id = -1;
+ }
params->opener_frame_route_id = opener_frame_route_id;
params->swapped_out = !is_active_;
params->replicated_frame_state = replicated_frame_state;
« no previous file with comments | « content/browser/browsing_instance.cc ('k') | content/browser/site_instance_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698