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

Unified Diff: webkit/media/crypto/ppapi/cdm_allocator.h

Issue 10914028: Add CDM allocator interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: It works, and this removes a copy in Decrypt/DeliverBlock. Created 8 years, 4 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
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..61ab9a346d3a79fb445f473aa0a3b823c0535b28
--- /dev/null
+++ b/webkit/media/crypto/ppapi/cdm_allocator.h
@@ -0,0 +1,29 @@
+// 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_
+
+#include "ppapi/c/pp_stdint.h"
+
+namespace webkit_media {
+
+// Interface class intended to hide the PPAPI memory allocation implementation
+// details from CDMs (Content Decryption Modules). The class implementing the
+// interface handles allocation. The data will be freed when the last reference
+// to the shared memory is released (typically after the browser has received
+// data from the CDM wrapper).
+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
+ public:
+ CdmAllocatorInterface() {}
+ virtual ~CdmAllocatorInterface() {}
+
+ // Returns a pointer to shared memory, or NULL on failure.
+ // 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
+ 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
+};
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
+
+} // namespace webkit_media;
+
+#endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CDM_ALLOCATOR_H_

Powered by Google App Engine
This is Rietveld 408576698