Chromium Code Reviews| 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..4133456480a0f76acb4b47a29837b080ac281245 |
| --- /dev/null |
| +++ b/ppapi/cpp/dev/content_decryptor_dev.h |
| @@ -0,0 +1,71 @@ |
| +// 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" |
| + |
| +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/07/31 03:36:31
Why not pp::Var instead of PP_Var?
Tom Finegan
2012/08/01 04:19:22
For the PPP methods I thought I had to use the C i
dmichael (off chromium)
2012/08/08 03:38:10
We convert the params to appropriate C++ types whe
|
| + PP_Resource init_data) = 0; // PPB_Buffer. |
|
dmichael (off chromium)
2012/07/31 03:36:31
pp::Buffer_Dev?
(unless you go with ArrayBuffer, w
Tom Finegan
2012/08/01 04:19:22
Using PP_Var now.
|
| + |
| + virtual bool AddKey(PP_Var session_id, // String. |
| + PP_Resource key) = 0; // PPB_Buffer. |
| + |
| + virtual bool CancelKeyRequest(PP_Var session_id) = 0; // String. |
| + |
| + virtual bool Decrypt(PP_Resource encrypted_block, // PPB_Buffer. |
| + PP_CompletionCallback callback) = 0; |
|
dmichael (off chromium)
2012/07/31 03:36:31
Maybe pp::CompletionCallback, depending on what th
Tom Finegan
2012/08/01 04:19:22
Same as first comment response in this file.
|
| + |
| + virtual bool DecryptAndDecode(PP_Resource encrypted_block, // PPB_Buffer. |
| + PP_CompletionCallback callback) = 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_Resource init_data); // PPB_Buffer. |
| + |
| + 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, // PPB_Buffer. |
| + PP_Var default_url); // String. |
| + |
| + void KeyError(PP_Var key_system, // String. |
| + PP_Var session_id, // String. |
| + uint16_t media_error, |
| + uint16_t system_error); |
| + |
| + void DeliverBlock(PP_Resource decrypted_block, // PPB_Buffer. |
| + PP_CompletionCallback callback); |
| + |
| + void DeliverFrame(PP_Resource decrypted_frame, // PPB_Buffer. |
| + PP_CompletionCallback callback); |
| + |
| + void DeliverSamples(PP_Resource decrypted_samples, // PPB_Buffer. |
| + PP_CompletionCallback callback); |
| + |
| + private: |
| + InstanceHandle associated_instance_; |
| +}; |
| + |
| +} // namespace pp |
| + |
| +#endif // PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_ |