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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1656603002: Diagnose renderer-side crash with browser-side stack trace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 10 #include <utility>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/debug/crash_logging.h"
14 #include "base/debug/dump_without_crashing.h"
13 #include "base/logging.h" 15 #include "base/logging.h"
14 #include "base/stl_util.h" 16 #include "base/stl_util.h"
15 #include "base/trace_event/trace_event.h" 17 #include "base/trace_event/trace_event.h"
16 #include "content/browser/child_process_security_policy_impl.h" 18 #include "content/browser/child_process_security_policy_impl.h"
17 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 19 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
18 #include "content/browser/frame_host/cross_site_transferring_request.h" 20 #include "content/browser/frame_host/cross_site_transferring_request.h"
19 #include "content/browser/frame_host/debug_urls.h" 21 #include "content/browser/frame_host/debug_urls.h"
20 #include "content/browser/frame_host/frame_navigation_entry.h" 22 #include "content/browser/frame_host/frame_navigation_entry.h"
21 #include "content/browser/frame_host/interstitial_page_impl.h" 23 #include "content/browser/frame_host/interstitial_page_impl.h"
22 #include "content/browser/frame_host/navigation_controller_impl.h" 24 #include "content/browser/frame_host/navigation_controller_impl.h"
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 // the proxy it is replacing, so that it can fully initialize itself. 1877 // the proxy it is replacing, so that it can fully initialize itself.
1876 // NOTE: This is the only time that a RenderFrameProxyHost can be in the same 1878 // NOTE: This is the only time that a RenderFrameProxyHost can be in the same
1877 // SiteInstance as its RenderFrameHost. This is only the case until the 1879 // SiteInstance as its RenderFrameHost. This is only the case until the
1878 // RenderFrameHost commits, at which point it will replace and delete the 1880 // RenderFrameHost commits, at which point it will replace and delete the
1879 // RenderFrameProxyHost. 1881 // RenderFrameProxyHost.
1880 int proxy_routing_id = MSG_ROUTING_NONE; 1882 int proxy_routing_id = MSG_ROUTING_NONE;
1881 RenderFrameProxyHost* existing_proxy = GetRenderFrameProxyHost(site_instance); 1883 RenderFrameProxyHost* existing_proxy = GetRenderFrameProxyHost(site_instance);
1882 if (existing_proxy) { 1884 if (existing_proxy) {
1883 proxy_routing_id = existing_proxy->GetRoutingID(); 1885 proxy_routing_id = existing_proxy->GetRoutingID();
1884 CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE); 1886 CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE);
1885 if (!existing_proxy->is_render_frame_proxy_live()) 1887 if (!existing_proxy->is_render_frame_proxy_live()) {
1888 // Calling InitRenderFrameProxy on main frames seems to be causing
1889 // https://crbug.com/575245, so track down how this can happen.
1890 // TODO(creis): Remove this once we've found the cause.
1891 if (SiteIsolationPolicy::IsSwappedOutStateForbidden() &&
1892 !frame_tree_node_->parent()) {
1893 base::debug::SetCrashKeyValue(
1894 "initrf_frame_id",
1895 base::IntToString(render_frame_host->GetRoutingID()));
1896 base::debug::SetCrashKeyValue("initrf_proxy_id",
1897 base::IntToString(proxy_routing_id));
1898 base::debug::SetCrashKeyValue(
1899 "initrf_view_id",
1900 base::IntToString(
1901 render_frame_host->render_view_host()->GetRoutingID()));
1902 base::debug::SetCrashKeyValue(
1903 "initrf_main_frame_id",
1904 base::IntToString(render_frame_host->render_view_host()
1905 ->main_frame_routing_id()));
1906 base::debug::SetCrashKeyValue(
1907 "initrf_view_is_live",
1908 render_frame_host->render_view_host()->IsRenderViewLive() ? "yes"
1909 : "no");
1910 base::debug::DumpWithoutCrashing();
1911 }
1912
1886 existing_proxy->InitRenderFrameProxy(); 1913 existing_proxy->InitRenderFrameProxy();
1914 }
1887 } 1915 }
1888 1916
1889 return delegate_->CreateRenderFrameForRenderManager( 1917 return delegate_->CreateRenderFrameForRenderManager(
1890 render_frame_host, proxy_routing_id, opener_routing_id, parent_routing_id, 1918 render_frame_host, proxy_routing_id, opener_routing_id, parent_routing_id,
1891 previous_sibling_routing_id); 1919 previous_sibling_routing_id);
1892 } 1920 }
1893 1921
1894 int RenderFrameHostManager::GetRoutingIdForSiteInstance( 1922 int RenderFrameHostManager::GetRoutingIdForSiteInstance(
1895 SiteInstance* site_instance) { 1923 SiteInstance* site_instance) {
1896 if (render_frame_host_->GetSiteInstance() == site_instance) 1924 if (render_frame_host_->GetSiteInstance() == site_instance)
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { 2485 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
2458 if (!frame_tree_node_->opener()) 2486 if (!frame_tree_node_->opener())
2459 return MSG_ROUTING_NONE; 2487 return MSG_ROUTING_NONE;
2460 2488
2461 return frame_tree_node_->opener() 2489 return frame_tree_node_->opener()
2462 ->render_manager() 2490 ->render_manager()
2463 ->GetRoutingIdForSiteInstance(instance); 2491 ->GetRoutingIdForSiteInstance(instance);
2464 } 2492 }
2465 2493
2466 } // namespace content 2494 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698