Chromium Code Reviews| Index: webkit/media/crypto/ppapi/cdm_allocator.h |
| diff --git a/webkit/media/crypto/ppapi/cdm_allocator.h b/webkit/media/crypto/ppapi/cdm_allocator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..21126d42564406b562eab796c64e983329faf7da |
| --- /dev/null |
| +++ b/webkit/media/crypto/ppapi/cdm_allocator.h |
| @@ -0,0 +1,34 @@ |
| +// Copyright (c) 2012 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. |
| + |
| +#ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_ |
| +#define WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_ |
| + |
| +#if defined(_MSC_VER) |
| +typedef unsigned char uint8_t; |
| +typedef int int32_t; |
| +#else |
| +#include <stdint.h> |
| +#endif |
| + |
| +namespace webkit_media { |
| + |
| +// Interface class intended to hide the PPAPI memory allocation implementation |
|
ddorwin
2012/09/04 09:53:15
Shouldn't mention PPAPI. It really addresses the c
Tom Finegan
2012/09/07 00:46:36
Done.
|
| +// details from CDMs (Content Decryption Modules). The class implementing the |
| +// interface handles allocation. The data will be freed when the last reference |
|
ddorwin
2012/09/04 09:53:15
"The CDM wrapper takes ownership of the allocated
Tom Finegan
2012/09/07 00:46:36
Done.
|
| +// to the shared memory is released (typically after the browser has received |
| +// data from the CDM wrapper). |
| +class CdmAllocator { |
|
ddorwin
2012/09/04 09:53:15
Should this just be in CDM.h or is there a good re
Tom Finegan
2012/09/07 00:46:36
Deleted cdm_allocator.h, and moved CdmAllocator to
|
| + public: |
| + CdmAllocator() {} |
| + virtual ~CdmAllocator() {} |
| + |
| + // Returns a pointer to shared memory, or NULL on failure. |
| + // Note: The memory returned is already mapped. |
| + virtual uint8_t* Allocate(int32_t size, int32_t* id) = 0; |
|
ddorwin
2012/09/04 09:53:15
To further abstract things and ensure that things
Tom Finegan
2012/09/07 00:46:36
Added CdmBuffer to CDM.h.
|
| +}; |
| + |
| +} // namespace webkit_media; |
| + |
| +#endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_ |