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

Unified Diff: cc/trees/tree_synchronizer.cc

Issue 1587283002: Switch cc to std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unordered-map
Patch Set: Fix MSVC build issue Created 4 years, 11 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/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/tree_synchronizer.cc
diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
index 72b6daade02d288f26cc79539f2f6eb831b32051..a257c57bca0cc56c78ebd53cc18bedfc3bf77fda 100644
--- a/cc/trees/tree_synchronizer.cc
+++ b/cc/trees/tree_synchronizer.cc
@@ -7,9 +7,8 @@
#include <stddef.h>
#include <set>
+#include <unordered_map>
-#include "base/containers/hash_tables.h"
-#include "base/containers/scoped_ptr_hash_map.h"
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
#include "cc/layers/layer.h"
@@ -17,9 +16,8 @@
namespace cc {
-typedef base::ScopedPtrHashMap<int, scoped_ptr<LayerImpl>>
- ScopedPtrLayerImplMap;
-typedef base::hash_map<int, LayerImpl*> RawPtrLayerImplMap;
+using ScopedPtrLayerImplMap = std::unordered_map<int, scoped_ptr<LayerImpl>>;
+using RawPtrLayerImplMap = std::unordered_map<int, LayerImpl*>;
void CollectExistingLayerImplRecursive(ScopedPtrLayerImplMap* old_layers,
scoped_ptr<LayerImpl> layer_impl) {
@@ -34,7 +32,7 @@ void CollectExistingLayerImplRecursive(ScopedPtrLayerImplMap* old_layers,
CollectExistingLayerImplRecursive(old_layers, layer_impl->TakeReplicaLayer());
int id = layer_impl->id();
- old_layers->set(id, std::move(layer_impl));
+ (*old_layers)[id] = std::move(layer_impl);
}
template <typename LayerType>
@@ -78,7 +76,7 @@ scoped_ptr<LayerImpl> ReuseOrCreateLayerImpl(RawPtrLayerImplMap* new_layers,
ScopedPtrLayerImplMap* old_layers,
LayerType* layer,
LayerTreeImpl* tree_impl) {
- scoped_ptr<LayerImpl> layer_impl = old_layers->take(layer->id());
+ scoped_ptr<LayerImpl> layer_impl = std::move((*old_layers)[layer->id()]);
if (!layer_impl)
layer_impl = layer->CreateLayerImpl(tree_impl);
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698