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 PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | |
| 6 #define PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | |
| 7 | |
| 8 #include "ppapi/cpp/instance_handle.h" | |
| 9 #include "ppapi/cpp/var.h" | |
| 10 #include "ppapi/cpp/var_array_buffer.h" | |
| 11 #include "ppapi/cpp/dev/buffer_dev.h" | |
| 12 #include "ppapi/c/private/ppb_content_decryptor_private.h" | |
| 13 #include "ppapi/c/private/ppp_content_decryptor_private.h" | |
|
dmichael (off chromium)
2012/08/15 17:44:37
nit: include order. The /c/ stuff should come firs
Tom Finegan
2012/08/16 03:10:48
Done.
| |
| 14 | |
| 15 namespace pp { | |
| 16 | |
| 17 class Instance; | |
| 18 | |
| 19 class ContentDecryptor_Private { | |
| 20 public: | |
| 21 explicit ContentDecryptor_Private(Instance* instance); | |
| 22 virtual ~ContentDecryptor_Private(); | |
| 23 | |
| 24 // PPP_ContentDecryptor_Private functions exposed as virtual functions | |
| 25 // for you to override. | |
| 26 virtual bool GenerateKeyRequest(const std::string& key_system, | |
|
dmichael (off chromium)
2012/08/15 17:44:37
Re-thinking it, if you just have to turn around an
Tom Finegan
2012/08/16 03:10:48
It's going to require extraction to a string withi
dmichael (off chromium)
2012/08/16 17:02:28
My point was that some of these strings will *also
Tom Finegan
2012/08/16 18:10:58
Added a TODO re this being an optimization.
| |
| 27 pp::VarArrayBuffer init_data) = 0; | |
| 28 virtual bool AddKey(const std::string& session_id, | |
| 29 pp::VarArrayBuffer key) = 0; | |
| 30 virtual bool CancelKeyRequest(const std::string& session_id) = 0; | |
| 31 virtual bool Decrypt(pp::Buffer_Dev encrypted_buffer, | |
| 32 int32_t request_id) = 0; | |
| 33 virtual bool DecryptAndDecode(pp::Buffer_Dev encrypted_buffer, | |
| 34 int32_t request_id) = 0; | |
| 35 | |
| 36 // PPB_ContentDecryptor_Private methods for passing data from the decryptor | |
| 37 // to the browser. | |
| 38 void NeedKey(const std::string& key_system, | |
| 39 const std::string& session_id, | |
| 40 const std::string& init_data); | |
| 41 void KeyAdded(const std::string& key_system, | |
| 42 const std::string& session_id); | |
| 43 void KeyMessage(const std::string& key_system, | |
| 44 const std::string& session_id, | |
| 45 pp::Buffer_Dev message, | |
| 46 const std::string& default_url); | |
| 47 void KeyError(const std::string& key_system, | |
| 48 const std::string& session_id, | |
| 49 int32_t media_error, | |
| 50 int32_t system_code); | |
| 51 void DeliverBlock(pp::Buffer_Dev decrypted_block, | |
| 52 int32_t request_id); | |
| 53 void DeliverFrame(pp::Buffer_Dev decrypted_frame, | |
| 54 int32_t request_id); | |
| 55 void DeliverSamples(pp::Buffer_Dev decrypted_samples, | |
| 56 int32_t request_id); | |
| 57 | |
| 58 private: | |
| 59 InstanceHandle associated_instance_; | |
| 60 }; | |
| 61 | |
| 62 } // namespace pp | |
| 63 | |
| 64 #endif // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | |
| OLD | NEW |