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

Unified Diff: cc/resources/resource_provider.cc

Issue 2826583002: Use flat_set for ResourceIdSet (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 5275af92daf0e788ea7b1cbfe1fa901acc546066..86fd5aec123a8e56df6cdfa7f2f862fbd86a0526 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -1623,7 +1623,7 @@ void ResourceProvider::ReceiveFromChild(
// Don't allocate a texture for a child.
resource->allocated = true;
resource->imported_count = 1;
- child_info.parent_to_child_map[local_id] = it->id;
+ resource->id_in_child = it->id;
child_info.child_to_parent_map[it->id] = local_id;
}
}
@@ -1835,9 +1835,8 @@ void ResourceProvider::DeleteAndReturnUnusedResourcesToChild(
Resource& resource = it->second;
DCHECK(!resource.locked_for_write);
- DCHECK(child_info->parent_to_child_map.count(local_id));
- ResourceId child_id = child_info->parent_to_child_map[local_id];
+ ResourceId child_id = resource.id_in_child;
DCHECK(child_info->child_to_parent_map.count(child_id));
bool is_lost = resource.lost ||
@@ -1892,7 +1891,6 @@ void ResourceProvider::DeleteAndReturnUnusedResourcesToChild(
}
}
- child_info->parent_to_child_map.erase(local_id);
child_info->child_to_parent_map.erase(child_id);
resource.imported_count = 0;
DeleteResourceInternal(it, style);
@@ -1924,8 +1922,7 @@ void ResourceProvider::DeleteAndReturnUnusedResourcesToChild(
blocking_main_thread_task_runner_);
if (child_info->marked_for_deletion &&
- child_info->parent_to_child_map.empty()) {
- DCHECK(child_info->child_to_parent_map.empty());
+ child_info->child_to_parent_map.empty()) {
children_.erase(child_it);
}
}
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698