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

Side by Side Diff: services/media/framework/allocator.h

Issue 1577953002: Motown in-proc streaming framework used to implement media services. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: removed build/util/LASTCHANGE 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_MEDIA_FRAMEWORK_ALLOCATOR_H_
6 #define SERVICES_MEDIA_FRAMEWORK_ALLOCATOR_H_
7
8 #include <cstdint>
9
10 namespace mojo {
11 namespace media {
12
13 // Abstract base class for objects that allocate buffers for packets.
14 class Allocator {
15 public:
16 // Gets the default allocator, which allocates vanilla memory from the heap.
17 static Allocator* GetDefault();
18
19 // Allocates and returns a buffer of the indicated size or returns nullptr
20 // if the allocation fails.
21 virtual void* AllocatePayloadBuffer(uint64_t size) = 0;
johngro 2016/01/20 00:25:32 <nit> for in-proc non-mojom'ed stuff, we should us
johngro 2016/01/27 22:35:22 Checking in; any thoughts on using size_t instead
dalesat 2016/01/28 18:49:15 Added a TODO.
22
23 // Releases a buffer previously allocated via AllocatePayloadBuffer.
24 virtual void ReleasePayloadBuffer(uint64_t size, void* buffer) = 0;
25 };
26
27 } // namespace media
28 } // namespace mojo
29
30 #endif // SERVICES_MEDIA_FRAMEWORK_ALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698