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

Unified Diff: content/test/content_browser_test_utils_internal.cc

Issue 1685213002: Propagate window coordinates to out-of-process iframes renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sendscreenrects
Patch Set: fixing ordering in DepictFrameTree 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 side-by-side diff with in-line comments
Download patch
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()));
}

Powered by Google App Engine
This is Rietveld 408576698