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

Unified Diff: cc/test/test_web_graphics_context_3d.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/test/test_web_graphics_context_3d.h ('k') | cc/tiles/image_decode_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_web_graphics_context_3d.cc
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
index 41f3eb0d312ef7ca48bcd6c42ebe6a9fb8019999..637549267c814e53af14d1e4ab4ce9af2a8158a9 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/test/test_web_graphics_context_3d.cc
@@ -526,12 +526,12 @@ void TestWebGraphicsContext3D::bindBuffer(GLenum target,
DCHECK_LT(buffer_id, namespace_->next_buffer_id);
DCHECK_EQ(context_id, context_id_);
- base::ScopedPtrHashMap<unsigned, scoped_ptr<Buffer>>& buffers =
+ std::unordered_map<unsigned, scoped_ptr<Buffer>>& buffers =
namespace_->buffers;
if (buffers.count(bound_buffer_) == 0)
- buffers.set(bound_buffer_, make_scoped_ptr(new Buffer));
+ buffers[bound_buffer_] = make_scoped_ptr(new Buffer);
- buffers.get(bound_buffer_)->target = target;
+ buffers[bound_buffer_]->target = target;
}
void TestWebGraphicsContext3D::bufferData(GLenum target,
@@ -539,11 +539,11 @@ void TestWebGraphicsContext3D::bufferData(GLenum target,
const void* data,
GLenum usage) {
base::AutoLock lock(namespace_->lock);
- base::ScopedPtrHashMap<unsigned, scoped_ptr<Buffer>>& buffers =
+ std::unordered_map<unsigned, scoped_ptr<Buffer>>& buffers =
namespace_->buffers;
DCHECK_GT(buffers.count(bound_buffer_), 0u);
- DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
- Buffer* buffer = buffers.get(bound_buffer_);
+ DCHECK_EQ(target, buffers[bound_buffer_]->target);
+ Buffer* buffer = buffers[bound_buffer_].get();
if (context_lost_) {
buffer->pixels = nullptr;
return;
@@ -589,10 +589,10 @@ void TestWebGraphicsContext3D::pixelStorei(GLenum pname, GLint param) {
void* TestWebGraphicsContext3D::mapBufferCHROMIUM(GLenum target,
GLenum access) {
base::AutoLock lock(namespace_->lock);
- base::ScopedPtrHashMap<unsigned, scoped_ptr<Buffer>>& buffers =
+ std::unordered_map<unsigned, scoped_ptr<Buffer>>& buffers =
namespace_->buffers;
DCHECK_GT(buffers.count(bound_buffer_), 0u);
- DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
+ DCHECK_EQ(target, buffers[bound_buffer_]->target);
if (times_map_buffer_chromium_succeeds_ >= 0) {
if (!times_map_buffer_chromium_succeeds_) {
return NULL;
@@ -600,17 +600,17 @@ void* TestWebGraphicsContext3D::mapBufferCHROMIUM(GLenum target,
--times_map_buffer_chromium_succeeds_;
}
- return buffers.get(bound_buffer_)->pixels.get();
+ return buffers[bound_buffer_]->pixels.get();
}
GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
GLenum target) {
base::AutoLock lock(namespace_->lock);
- base::ScopedPtrHashMap<unsigned, scoped_ptr<Buffer>>& buffers =
+ std::unordered_map<unsigned, scoped_ptr<Buffer>>& buffers =
namespace_->buffers;
DCHECK_GT(buffers.count(bound_buffer_), 0u);
- DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
- buffers.get(bound_buffer_)->pixels = nullptr;
+ DCHECK_EQ(target, buffers[bound_buffer_]->target);
+ buffers[bound_buffer_]->pixels = nullptr;
return true;
}
@@ -621,7 +621,7 @@ GLuint TestWebGraphicsContext3D::createImageCHROMIUM(ClientBuffer buffer,
DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat));
GLuint image_id = NextImageId();
base::AutoLock lock(namespace_->lock);
- base::hash_set<unsigned>& images = namespace_->images;
+ std::unordered_set<unsigned>& images = namespace_->images;
images.insert(image_id);
return image_id;
}
@@ -630,7 +630,7 @@ void TestWebGraphicsContext3D::destroyImageCHROMIUM(
GLuint id) {
RetireImageId(id);
base::AutoLock lock(namespace_->lock);
- base::hash_set<unsigned>& images = namespace_->images;
+ std::unordered_set<unsigned>& images = namespace_->images;
if (!images.count(id))
ADD_FAILURE() << "destroyImageCHROMIUM called on unknown image " << id;
images.erase(id);
@@ -644,7 +644,7 @@ GLuint TestWebGraphicsContext3D::createGpuMemoryBufferImageCHROMIUM(
DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat));
GLuint image_id = NextImageId();
base::AutoLock lock(namespace_->lock);
- base::hash_set<unsigned>& images = namespace_->images;
+ std::unordered_set<unsigned>& images = namespace_->images;
images.insert(image_id);
return image_id;
}
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/tiles/image_decode_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698