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

Unified Diff: cc/test/test_gpu_memory_buffer_manager.h

Issue 2682743007: cc: Lock access to |buffers_| in TestGpuMemoryBufferManager (Closed)
Patch Set: lockbuffers: . Created 3 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
« no previous file with comments | « no previous file | cc/test/test_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_gpu_memory_buffer_manager.h
diff --git a/cc/test/test_gpu_memory_buffer_manager.h b/cc/test/test_gpu_memory_buffer_manager.h
index befa88f3a149db79849c57809101c939c085f180..0df87da60f19abf44bcf0145c845e1b90d8457b0 100644
--- a/cc/test/test_gpu_memory_buffer_manager.h
+++ b/cc/test/test_gpu_memory_buffer_manager.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/synchronization/lock.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
namespace cc {
@@ -35,6 +36,8 @@ class TestGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager {
private:
// Buffers allocated by this manager.
int last_gpu_memory_buffer_id_ = 1000;
+ // Use of |buffers_| must be protected by the lock.
+ base::Lock buffers_lock_;
std::map<int, gfx::GpuMemoryBuffer*> buffers_;
// Parent information for child managers.
« no previous file with comments | « no previous file | cc/test/test_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698