| 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 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 // the proxy it is replacing, so that it can fully initialize itself. | 1960 // the proxy it is replacing, so that it can fully initialize itself. |
| 1961 // NOTE: This is the only time that a RenderFrameProxyHost can be in the same | 1961 // NOTE: This is the only time that a RenderFrameProxyHost can be in the same |
| 1962 // SiteInstance as its RenderFrameHost. This is only the case until the | 1962 // SiteInstance as its RenderFrameHost. This is only the case until the |
| 1963 // RenderFrameHost commits, at which point it will replace and delete the | 1963 // RenderFrameHost commits, at which point it will replace and delete the |
| 1964 // RenderFrameProxyHost. | 1964 // RenderFrameProxyHost. |
| 1965 int proxy_routing_id = MSG_ROUTING_NONE; | 1965 int proxy_routing_id = MSG_ROUTING_NONE; |
| 1966 RenderFrameProxyHost* existing_proxy = GetRenderFrameProxyHost(site_instance); | 1966 RenderFrameProxyHost* existing_proxy = GetRenderFrameProxyHost(site_instance); |
| 1967 if (existing_proxy) { | 1967 if (existing_proxy) { |
| 1968 proxy_routing_id = existing_proxy->GetRoutingID(); | 1968 proxy_routing_id = existing_proxy->GetRoutingID(); |
| 1969 CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE); | 1969 CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE); |
| 1970 if (!existing_proxy->is_render_frame_proxy_live()) { | 1970 if (!existing_proxy->is_render_frame_proxy_live()) |
| 1971 // Calling InitRenderFrameProxy on main frames seems to be causing | |
| 1972 // https://crbug.com/575245, so track down how this can happen. | |
| 1973 // TODO(creis): Remove this once we've found the cause. | |
| 1974 if (!frame_tree_node_->parent()) { | |
| 1975 base::debug::SetCrashKeyValue( | |
| 1976 "initrf_frame_id", | |
| 1977 base::IntToString(render_frame_host->GetRoutingID())); | |
| 1978 base::debug::SetCrashKeyValue("initrf_proxy_id", | |
| 1979 base::IntToString(proxy_routing_id)); | |
| 1980 base::debug::SetCrashKeyValue( | |
| 1981 "initrf_view_id", | |
| 1982 base::IntToString( | |
| 1983 render_frame_host->render_view_host()->GetRoutingID())); | |
| 1984 base::debug::SetCrashKeyValue( | |
| 1985 "initrf_main_frame_id", | |
| 1986 base::IntToString(render_frame_host->render_view_host() | |
| 1987 ->main_frame_routing_id())); | |
| 1988 base::debug::SetCrashKeyValue( | |
| 1989 "initrf_view_is_live", | |
| 1990 render_frame_host->render_view_host()->IsRenderViewLive() ? "yes" | |
| 1991 : "no"); | |
| 1992 base::debug::DumpWithoutCrashing(); | |
| 1993 } | |
| 1994 | |
| 1995 existing_proxy->InitRenderFrameProxy(); | 1971 existing_proxy->InitRenderFrameProxy(); |
| 1996 } | |
| 1997 } | 1972 } |
| 1998 | 1973 |
| 1999 // TODO(alexmos): These crash keys are temporary to track down | 1974 // TODO(alexmos): These crash keys are temporary to track down |
| 2000 // https://crbug.com/591478. Verify that the parent routing ID | 1975 // https://crbug.com/591478. Verify that the parent routing ID |
| 2001 // points to a live RenderFrameProxy when this is not a remote-to-local | 1976 // points to a live RenderFrameProxy when this is not a remote-to-local |
| 2002 // navigation (i.e., when there's no |existing_proxy|). | 1977 // navigation (i.e., when there's no |existing_proxy|). |
| 2003 if (!existing_proxy && frame_tree_node_->parent()) { | 1978 if (!existing_proxy && frame_tree_node_->parent()) { |
| 2004 RenderFrameProxyHost* parent_proxy = RenderFrameProxyHost::FromID( | 1979 RenderFrameProxyHost* parent_proxy = RenderFrameProxyHost::FromID( |
| 2005 render_frame_host->GetProcess()->GetID(), parent_routing_id); | 1980 render_frame_host->GetProcess()->GetID(), parent_routing_id); |
| 2006 if (!parent_proxy || !parent_proxy->is_render_frame_proxy_live()) { | 1981 if (!parent_proxy || !parent_proxy->is_render_frame_proxy_live()) { |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 resolved_url)) { | 2711 resolved_url)) { |
| 2737 DCHECK(!dest_instance || | 2712 DCHECK(!dest_instance || |
| 2738 dest_instance == render_frame_host_->GetSiteInstance()); | 2713 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2739 return false; | 2714 return false; |
| 2740 } | 2715 } |
| 2741 | 2716 |
| 2742 return true; | 2717 return true; |
| 2743 } | 2718 } |
| 2744 | 2719 |
| 2745 } // namespace content | 2720 } // namespace content |
| OLD | NEW |