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

Unified Diff: mojo/services/media/common/cpp/shared_media_buffer_allocator.cc

Issue 1460693004: Add helper classes to for managing shared buffers. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sync 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 | « mojo/services/media/common/cpp/shared_media_buffer_allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/media/common/cpp/shared_media_buffer_allocator.cc
diff --git a/mojo/services/media/common/cpp/shared_media_buffer_allocator.cc b/mojo/services/media/common/cpp/shared_media_buffer_allocator.cc
new file mode 100644
index 0000000000000000000000000000000000000000..075420391979368c5bba9bc0d53a368981ad9898
--- /dev/null
+++ b/mojo/services/media/common/cpp/shared_media_buffer_allocator.cc
@@ -0,0 +1,20 @@
+// 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 "mojo/services/media/common/cpp/shared_media_buffer_allocator.h"
+
+namespace mojo {
+namespace media {
+
+SharedMediaBufferAllocator::~SharedMediaBufferAllocator() {
+ std::lock_guard<std::mutex> lock(lock_);
+}
+
+void SharedMediaBufferAllocator::OnInit() {
+ std::lock_guard<std::mutex> lock(lock_);
+ fifo_allocator_.Reset(size());
+}
+
+} // namespace media
+} // namespace mojo
« no previous file with comments | « mojo/services/media/common/cpp/shared_media_buffer_allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698