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

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: Comments and tweaks. 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..35ab0d53e92359e733ddaef5cb53dc58631d62fa
--- /dev/null
+++ b/content/common/generic_shared_memory_id_generator.cc
@@ -0,0 +1,22 @@
+// 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 {
+
reveman 2015/08/06 04:25:06 nit: you can remove this blank line if you like
ericrk 2015/08/06 18:28:08 Done.
+namespace {
+
+// Global atomic to generate gpu memory buffer unique IDs.
+base::StaticAtomicSequenceNumber g_next_generic_shared_memory_id;
+
+} // namespace
+
+base::memory::GenericSharedMemoryId GetNextGenericSharedMemoryId() {
+ return g_next_generic_shared_memory_id.GetNext();
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698