Chromium Code Reviews| 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 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2011 // the proxy it is replacing, so that it can fully initialize itself. | 2011 // the proxy it is replacing, so that it can fully initialize itself. |
| 2012 // NOTE: This is the only time that a RenderFrameProxyHost can be in the same | 2012 // NOTE: This is the only time that a RenderFrameProxyHost can be in the same |
| 2013 // SiteInstance as its RenderFrameHost. This is only the case until the | 2013 // SiteInstance as its RenderFrameHost. This is only the case until the |
| 2014 // RenderFrameHost commits, at which point it will replace and delete the | 2014 // RenderFrameHost commits, at which point it will replace and delete the |
| 2015 // RenderFrameProxyHost. | 2015 // RenderFrameProxyHost. |
| 2016 int proxy_routing_id = MSG_ROUTING_NONE; | 2016 int proxy_routing_id = MSG_ROUTING_NONE; |
| 2017 RenderFrameProxyHost* existing_proxy = GetRenderFrameProxyHost(site_instance); | 2017 RenderFrameProxyHost* existing_proxy = GetRenderFrameProxyHost(site_instance); |
| 2018 if (existing_proxy) { | 2018 if (existing_proxy) { |
| 2019 proxy_routing_id = existing_proxy->GetRoutingID(); | 2019 proxy_routing_id = existing_proxy->GetRoutingID(); |
| 2020 CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE); | 2020 CHECK_NE(proxy_routing_id, MSG_ROUTING_NONE); |
| 2021 if (!existing_proxy->is_render_frame_proxy_live()) { | 2021 if (!existing_proxy->is_render_frame_proxy_live()) |
| 2022 // Calling InitRenderFrameProxy on main frames seems to be causing | |
| 2023 // https://crbug.com/575245, so track down how this can happen. | |
| 2024 // TODO(creis): Remove this once we've found the cause. | |
| 2025 if (!frame_tree_node_->parent()) { | |
| 2026 base::debug::SetCrashKeyValue( | |
| 2027 "initrf_frame_id", | |
| 2028 base::IntToString(render_frame_host->GetRoutingID())); | |
| 2029 base::debug::SetCrashKeyValue("initrf_proxy_id", | |
| 2030 base::IntToString(proxy_routing_id)); | |
| 2031 base::debug::SetCrashKeyValue( | |
| 2032 "initrf_view_id", | |
| 2033 base::IntToString( | |
| 2034 render_frame_host->render_view_host()->GetRoutingID())); | |
| 2035 base::debug::SetCrashKeyValue( | |
| 2036 "initrf_main_frame_id", | |
| 2037 base::IntToString(render_frame_host->render_view_host() | |
| 2038 ->main_frame_routing_id())); | |
| 2039 base::debug::SetCrashKeyValue( | |
| 2040 "initrf_view_is_live", | |
| 2041 render_frame_host->render_view_host()->IsRenderViewLive() ? "yes" | |
| 2042 : "no"); | |
| 2043 base::debug::DumpWithoutCrashing(); | |
| 2044 } | |
| 2045 | |
| 2046 existing_proxy->InitRenderFrameProxy(); | 2022 existing_proxy->InitRenderFrameProxy(); |
| 2047 } | |
| 2048 } | 2023 } |
| 2049 | 2024 |
| 2050 // TODO(alexmos): These crash keys are temporary to track down | 2025 // TODO(alexmos): These crash keys are temporary to track down |
| 2051 // https://crbug.com/591478. Verify that the parent routing ID | 2026 // https://crbug.com/591478. Verify that the parent routing ID |
| 2052 // points to a live RenderFrameProxy when this is not a remote-to-local | 2027 // points to a live RenderFrameProxy when this is not a remote-to-local |
| 2053 // navigation (i.e., when there's no |existing_proxy|). | 2028 // navigation (i.e., when there's no |existing_proxy|). |
| 2054 if (!existing_proxy && frame_tree_node_->parent()) { | 2029 if (!existing_proxy && frame_tree_node_->parent()) { |
| 2055 RenderFrameProxyHost* parent_proxy = RenderFrameProxyHost::FromID( | 2030 RenderFrameProxyHost* parent_proxy = RenderFrameProxyHost::FromID( |
| 2056 render_frame_host->GetProcess()->GetID(), parent_routing_id); | 2031 render_frame_host->GetProcess()->GetID(), parent_routing_id); |
| 2057 if (!parent_proxy || !parent_proxy->is_render_frame_proxy_live()) { | 2032 if (!parent_proxy || !parent_proxy->is_render_frame_proxy_live()) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2098 | 2073 |
| 2099 RenderFrameProxyHost* top_proxy = | 2074 RenderFrameProxyHost* top_proxy = |
| 2100 root->render_manager()->GetRenderFrameProxyHost(site_instance); | 2075 root->render_manager()->GetRenderFrameProxyHost(site_instance); |
| 2101 if (top_proxy) { | 2076 if (top_proxy) { |
| 2102 base::debug::SetCrashKeyValue( | 2077 base::debug::SetCrashKeyValue( |
| 2103 "initrf_root_proxy_is_live", | 2078 "initrf_root_proxy_is_live", |
| 2104 top_proxy->is_render_frame_proxy_live() ? "yes" : "no"); | 2079 top_proxy->is_render_frame_proxy_live() ? "yes" : "no"); |
| 2105 } | 2080 } |
| 2106 } | 2081 } |
| 2107 | 2082 |
| 2108 base::debug::DumpWithoutCrashing(); | 2083 base::debug::DumpWithoutCrashing(); |
|
Charlie Reis
2017/05/09 16:42:26
Agreed that about 2/3 of the reports are from this
| |
| 2109 } | 2084 } |
| 2110 } | 2085 } |
| 2111 | 2086 |
| 2112 return delegate_->CreateRenderFrameForRenderManager( | 2087 return delegate_->CreateRenderFrameForRenderManager( |
| 2113 render_frame_host, proxy_routing_id, opener_routing_id, parent_routing_id, | 2088 render_frame_host, proxy_routing_id, opener_routing_id, parent_routing_id, |
| 2114 previous_sibling_routing_id); | 2089 previous_sibling_routing_id); |
| 2115 } | 2090 } |
| 2116 | 2091 |
| 2117 bool RenderFrameHostManager::ReinitializeRenderFrame( | 2092 bool RenderFrameHostManager::ReinitializeRenderFrame( |
| 2118 RenderFrameHostImpl* render_frame_host) { | 2093 RenderFrameHostImpl* render_frame_host) { |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2854 delegate_->IsHidden()) { | 2829 delegate_->IsHidden()) { |
| 2855 if (delegate_->IsHidden()) { | 2830 if (delegate_->IsHidden()) { |
| 2856 render_frame_host_->GetView()->Hide(); | 2831 render_frame_host_->GetView()->Hide(); |
| 2857 } else { | 2832 } else { |
| 2858 render_frame_host_->GetView()->Show(); | 2833 render_frame_host_->GetView()->Show(); |
| 2859 } | 2834 } |
| 2860 } | 2835 } |
| 2861 } | 2836 } |
| 2862 | 2837 |
| 2863 } // namespace content | 2838 } // namespace content |
| OLD | NEW |