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/c/private/ppb_content_decryptor_private.h" | |
9 #include "ppapi/c/private/ppp_content_decryptor_private.h" | |
10 | |
11 #include "ppapi/cpp/dev/buffer_dev.h" | |
12 #include "ppapi/cpp/instance_handle.h" | |
13 #include "ppapi/cpp/var.h" | |
14 #include "ppapi/cpp/var_array_buffer.h" | |
15 | |
16 namespace pp { | |
17 | |
18 class Instance; | |
19 | |
20 class ContentDecryptor_Private { | |
21 public: | |
22 explicit ContentDecryptor_Private(Instance* instance); | |
23 virtual ~ContentDecryptor_Private(); | |
24 | |
25 // PPP_ContentDecryptor_Private functions exposed as virtual functions | |
26 // for you to override. | |
27 // TODO(tomfinegan): Optimization; just pass pp::Var instead of strings, | |
28 // that way the same var can be reused when replying to the browser. | |
dmichael (off chromium)
2012/08/16 18:51:00
You can leave out this TODO. If you want to keep i
Tom Finegan
2012/08/16 19:08:05
Done; reworded it-- it'll be nice to have the remi
| |
29 virtual bool GenerateKeyRequest(const std::string& key_system, | |
30 pp::VarArrayBuffer init_data) = 0; | |
31 virtual bool AddKey(const std::string& session_id, | |
32 pp::VarArrayBuffer key) = 0; | |
33 virtual bool CancelKeyRequest(const std::string& session_id) = 0; | |
34 virtual bool Decrypt(pp::Buffer_Dev encrypted_buffer, | |
35 int32_t request_id) = 0; | |
36 virtual bool DecryptAndDecode(pp::Buffer_Dev encrypted_buffer, | |
37 int32_t request_id) = 0; | |
38 | |
39 // PPB_ContentDecryptor_Private methods for passing data from the decryptor | |
40 // to the browser. | |
41 void NeedKey(const std::string& key_system, | |
42 const std::string& session_id, | |
43 pp::VarArrayBuffer init_data); | |
44 void KeyAdded(const std::string& key_system, | |
45 const std::string& session_id); | |
46 void KeyMessage(const std::string& key_system, | |
47 const std::string& session_id, | |
48 pp::Buffer_Dev message, | |
49 const std::string& default_url); | |
50 void KeyError(const std::string& key_system, | |
51 const std::string& session_id, | |
52 int32_t media_error, | |
53 int32_t system_code); | |
54 void DeliverBlock(pp::Buffer_Dev decrypted_block, | |
55 int32_t request_id); | |
56 void DeliverFrame(pp::Buffer_Dev decrypted_frame, | |
57 int32_t request_id); | |
58 void DeliverSamples(pp::Buffer_Dev decrypted_samples, | |
59 int32_t request_id); | |
60 | |
61 private: | |
62 InstanceHandle associated_instance_; | |
63 }; | |
64 | |
65 } // namespace pp | |
66 | |
67 #endif // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | |
OLD | NEW |