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

Unified Diff: ppapi/cpp/dev/content_decryptor_dev.h

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PP_Resource/HostResource usage (hopefully), and update comments. 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: ppapi/cpp/dev/content_decryptor_dev.h
diff --git a/ppapi/cpp/dev/content_decryptor_dev.h b/ppapi/cpp/dev/content_decryptor_dev.h
new file mode 100644
index 0000000000000000000000000000000000000000..7dacbcca1f58e9515cdd403cdce0c0ca0e1b8188
--- /dev/null
+++ b/ppapi/cpp/dev/content_decryptor_dev.h
@@ -0,0 +1,73 @@
+// 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 PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_
+#define PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_
+
+#include "ppapi/c/dev/ppb_content_decryptor_dev.h"
+#include "ppapi/c/dev/ppp_content_decryptor_dev.h"
+#include "ppapi/cpp/instance_handle.h"
+#include "ppapi/cpp/var.h"
+#include "ppapi/cpp/dev/buffer_dev.h"
+
+namespace pp {
+
+class Instance;
+
+class ContentDecryptor_Dev {
+ public:
+ explicit ContentDecryptor_Dev(Instance* instance);
+ virtual ~ContentDecryptor_Dev();
+
+ // PPP_ContentDecryptor_Dev functions exposed as virtual functions
+ // for you to override.
+ virtual bool GenerateKeyRequest(PP_Var key_system, // String.
dmichael (off chromium) 2012/08/08 22:24:02 As noted before, you should use a C++ version of a
Tom Finegan 2012/08/09 22:45:17 Done.
+ PP_Var init_data) = 0; // ArrayBuffer.
+
+ virtual bool AddKey(PP_Var session_id, // String.
+ PP_Var key) = 0; // ArrayBuffer.
+
+ virtual bool CancelKeyRequest(PP_Var session_id) = 0; // String.
+
+ virtual bool Decrypt(PP_Resource encrypted_block,
+ uint64_t request_id) = 0;
+
+ virtual bool DecryptAndDecode(PP_Resource encrypted_block,
+ uint64_t request_id) = 0;
+
+ // PPB_ContentDecryptor_Dev methods for passing data from the decryptor to the
+ // browser.
+ void NeedKey(PP_Var key_system, // String.
+ PP_Var session_id, // String.
+ PP_Var init_data); // ArrayBuffer.
+
+ void KeyAdded(PP_Var key_system, // String.
+ PP_Var session_id); // String.
+
+ void KeyMessage(PP_Var key_system, // String.
+ PP_Var session_id, // String.
+ PP_Resource message,
+ PP_Var default_url); // String.
+
+ void KeyError(PP_Var key_system, // String.
+ PP_Var session_id, // String.
+ int32_t media_error,
+ int32_t system_error);
+
+ void DeliverBlock(PP_Resource decrypted_block, // PPB_Buffer.
+ uint64_t request_id);
+
+ void DeliverFrame(PP_Resource decrypted_frame, // PPB_Buffer.
+ uint64_t request_id);
+
+ void DeliverSamples(PP_Resource decrypted_samples, // PPB_Buffer.
+ uint64_t request_id);
+
+ private:
+ InstanceHandle associated_instance_;
+};
+
+} // namespace pp
+
+#endif // PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_

Powered by Google App Engine
This is Rietveld 408576698