Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_ | |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_ | |
| 7 | |
| 8 #if defined(_MSC_VER) | |
| 9 typedef unsigned char uint8_t; | |
| 10 typedef int int32_t; | |
| 11 #else | |
| 12 #include <stdint.h> | |
| 13 #endif | |
| 14 | |
| 15 namespace webkit_media { | |
| 16 | |
| 17 // 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.
| |
| 18 // details from CDMs (Content Decryption Modules). The class implementing the | |
| 19 // 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.
| |
| 20 // to the shared memory is released (typically after the browser has received | |
| 21 // data from the CDM wrapper). | |
| 22 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
| |
| 23 public: | |
| 24 CdmAllocator() {} | |
| 25 virtual ~CdmAllocator() {} | |
| 26 | |
| 27 // Returns a pointer to shared memory, or NULL on failure. | |
| 28 // Note: The memory returned is already mapped. | |
| 29 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.
| |
| 30 }; | |
| 31 | |
| 32 } // namespace webkit_media; | |
| 33 | |
| 34 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_ | |
| OLD | NEW |