Index: content/test/content_browser_test_utils_internal.cc |
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc |
index 431e2abeaf5fbcc64e5981f956484f7ee2c62e36..115009fb5292f53ac8f0905e63152293f39671f7 100644 |
--- a/content/test/content_browser_test_utils_internal.cc |
+++ b/content/test/content_browser_test_utils_internal.cc |
@@ -87,12 +87,16 @@ std::string FrameTreeVisualizer::DepictFrameTree(FrameTreeNode* root) { |
} |
// Sort the proxies by SiteInstance ID to avoid hash_map ordering. |
- std::map<int, RenderFrameProxyHost*> sorted_proxy_hosts = |
- node->render_manager()->GetAllProxyHostsForTesting(); |
- for (auto& proxy_pair : sorted_proxy_hosts) { |
- RenderFrameProxyHost* proxy = proxy_pair.second; |
- legend[GetName(proxy->GetSiteInstance())] = proxy->GetSiteInstance(); |
- } |
+ std::vector<SiteInstance*> site_instances; |
+ for (const auto& proxy_pair : node->render_manager()->GetAllProxyHosts()) |
+ site_instances.push_back(proxy_pair.second->GetSiteInstance()); |
+ std::sort(site_instances.begin(), site_instances.end(), |
+ [](const SiteInstance* lhs, const SiteInstance* rhs) { |
+ return lhs->GetId() < rhs->GetId(); |
+ }); |
+ |
+ for (SiteInstance* site_instance : site_instances) |
+ legend[GetName(site_instance)] = site_instance; |
} |
// Traversal 4: Now that all names are assigned, make a big loop to pretty- |
@@ -155,9 +159,8 @@ std::string FrameTreeVisualizer::DepictFrameTree(FrameTreeNode* root) { |
} |
// Show the SiteInstances of the RenderFrameProxyHosts of this node. |
- std::map<int, RenderFrameProxyHost*> sorted_proxy_host_map = |
- node->render_manager()->GetAllProxyHostsForTesting(); |
- if (!sorted_proxy_host_map.empty()) { |
+ const auto& proxy_host_map = node->render_manager()->GetAllProxyHosts(); |
+ if (!proxy_host_map.empty()) { |
// Show a dashed line of variable length before the proxy list. Always at |
// least two dashes. |
line.append(" --"); |
@@ -176,7 +179,7 @@ std::string FrameTreeVisualizer::DepictFrameTree(FrameTreeNode* root) { |
// Sort these alphabetically, to avoid hash_map ordering dependency. |
std::vector<std::string> sorted_proxy_hosts; |
- for (auto& proxy_pair : sorted_proxy_host_map) { |
+ for (const auto& proxy_pair : proxy_host_map) { |
sorted_proxy_hosts.push_back( |
GetName(proxy_pair.second->GetSiteInstance())); |
} |