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

Unified Diff: cc/surfaces/surface_factory.cc

Issue 1587283002: Switch cc to std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unordered-map
Patch Set: 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
Index: cc/surfaces/surface_factory.cc
diff --git a/cc/surfaces/surface_factory.cc b/cc/surfaces/surface_factory.cc
index 12afab82e69b063d41b23ccd6282824a8ac6ee15..98b771c3836bfa88b2922d649452bd36233223f5 100644
--- a/cc/surfaces/surface_factory.cc
+++ b/cc/surfaces/surface_factory.cc
@@ -4,6 +4,8 @@
#include "cc/surfaces/surface_factory.h"
+#include <utility>
+
#include "base/trace_event/trace_event.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/copy_output_request.h"
@@ -32,7 +34,7 @@ SurfaceFactory::~SurfaceFactory() {
void SurfaceFactory::DestroyAll() {
for (auto it = surface_map_.begin(); it != surface_map_.end(); ++it)
- manager_->Destroy(surface_map_.take(it));
+ manager_->Destroy(std::move(it->second));
surface_map_.clear();
}
@@ -40,14 +42,15 @@ void SurfaceFactory::Create(SurfaceId surface_id) {
scoped_ptr<Surface> surface(new Surface(surface_id, this));
manager_->RegisterSurface(surface.get());
DCHECK(!surface_map_.count(surface_id));
- surface_map_.add(surface_id, std::move(surface));
+ surface_map_[surface_id] = std::move(surface);
}
void SurfaceFactory::Destroy(SurfaceId surface_id) {
OwningSurfaceMap::iterator it = surface_map_.find(surface_id);
DCHECK(it != surface_map_.end());
DCHECK(it->second->factory().get() == this);
- manager_->Destroy(surface_map_.take_and_erase(it));
+ manager_->Destroy(std::move(it->second));
+ surface_map_.erase(it);
}
void SurfaceFactory::SetBeginFrameSource(SurfaceId surface_id,

Powered by Google App Engine
This is Rietveld 408576698