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

Unified Diff: content/common/generic_shared_memory_id_generator.cc

Issue 1280513002: Add GenericSharedMemoryId and use w/ GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trackpools
Patch Set: remove "tracing" from name Created 5 years, 4 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: content/common/generic_shared_memory_id_generator.cc
diff --git a/content/common/generic_shared_memory_id_generator.cc b/content/common/generic_shared_memory_id_generator.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c912bc26eb9e2529c245dfb6978080aff29d903e
--- /dev/null
+++ b/content/common/generic_shared_memory_id_generator.cc
@@ -0,0 +1,21 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/generic_shared_memory_id_generator.h"
+
+#include "base/atomic_sequence_num.h"
+
+namespace content {
+namespace {
+
+// Global atomic to generate gpu memory buffer unique IDs.
+base::StaticAtomicSequenceNumber g_next_generic_shared_memory_id;
+
+} // namespace
+
+gfx::GenericSharedMemoryId GetNextGenericSharedMemoryId() {
+ return gfx::GenericSharedMemoryId(g_next_generic_shared_memory_id.GetNext());
+}
+
+} // namespace content
« no previous file with comments | « content/common/generic_shared_memory_id_generator.h ('k') | content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698