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 #include "ppapi/c/pp_stdint.h" | |
| 9 | |
| 10 namespace webkit_media { | |
| 11 | |
| 12 // Interface class intended to hide the PPAPI memory allocation implementation | |
| 13 // details from CDMs (Content Decryption Modules). The class implementing the | |
| 14 // interface handles allocation. The data will be freed when the last reference | |
| 15 // to the shared memory is released (typically after the browser has received | |
| 16 // data from the CDM wrapper). | |
| 17 class CdmAllocatorInterface { | |
|
xhwang
2012/09/01 13:49:09
We don't usually use "Interface" suffix for interf
Tom Finegan
2012/09/01 21:32:49
Done, using CdmAllocator.
ddorwin
2012/09/04 09:53:15
This class should know nothing about PPAPi or how
| |
| 18 public: | |
| 19 CdmAllocatorInterface() {} | |
| 20 virtual ~CdmAllocatorInterface() {} | |
| 21 | |
| 22 // Returns a pointer to shared memory, or NULL on failure. | |
| 23 // Note: The memory returned is already mapped. | |
|
xhwang
2012/09/01 13:49:09
ditto, remove implementation details, e.g. memoey
Tom Finegan
2012/09/01 21:32:49
Deferring this until open question above is resolv
ddorwin
2012/09/04 09:53:15
Agreed, the interface should not have implementati
| |
| 24 virtual uint8_t* Allocate(int32_t size, int32_t* id) = 0; | |
|
xhwang
2012/09/01 13:49:09
Return void* ? We may not need to do that since we
ddorwin
2012/09/04 09:53:15
See comment in Patch Set 3 - it may help with this
| |
| 25 }; | |
|
xhwang
2012/09/01 13:49:09
We also need to add a void Deallocate(uint8_t*, in
Tom Finegan
2012/09/01 21:32:49
I don't think this interface should have a public
ddorwin
2012/09/04 09:53:15
See comment in Patch Set 3 - If you have an object
| |
| 26 | |
| 27 } // namespace webkit_media; | |
| 28 | |
| 29 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_ | |
| OLD | NEW |