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

Side by Side 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: Changes in response to dmichael's comments/xhwang's testing. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_DEV_CONTENT_DECRYPTOR_DEV_H_
6 #define PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_
7
8 #include "ppapi/c/dev/ppb_content_decryptor_dev.h"
9 #include "ppapi/c/dev/ppp_content_decryptor_dev.h"
10 #include "ppapi/cpp/instance_handle.h"
11 #include "ppapi/cpp/var.h"
12 #include "ppapi/cpp/dev/buffer_dev.h"
13
14 namespace pp {
15
16 class Instance;
17
18 class ContentDecryptor_Dev {
19 public:
20 explicit ContentDecryptor_Dev(Instance* instance);
21 virtual ~ContentDecryptor_Dev();
22
23 // PPP_ContentDecryptor_Dev functions exposed as virtual functions
24 // for you to override.
25 virtual bool GenerateKeyRequest(PP_Var key_system, // String.
26 PP_Var init_data) = 0; // ArrayBuffer.
27
28 virtual bool AddKey(PP_Var session_id, // String.
29 PP_Var key) = 0; // ArrayBuffer.
30
31 virtual bool CancelKeyRequest(PP_Var session_id) = 0; // String.
32
33 virtual bool Decrypt(PP_Resource encrypted_block,
34 PP_CompletionCallback callback) = 0;
35
36 virtual bool DecryptAndDecode(PP_Resource encrypted_block,
37 PP_CompletionCallback callback) = 0;
38
39 // PPB_ContentDecryptor_Dev methods for passing data from the decryptor to the
40 // browser.
41 void NeedKey(PP_Var key_system, // String.
42 PP_Var session_id, // String.
43 PP_Var init_data); // ArrayBuffer.
44
45 void KeyAdded(PP_Var key_system, // String.
46 PP_Var session_id); // String.
47
48 void KeyMessage(PP_Var key_system, // String.
49 PP_Var session_id, // String.
50 PP_Resource message,
51 PP_Var default_url); // String.
52
53 void KeyError(PP_Var key_system, // String.
54 PP_Var session_id, // String.
55 int32_t media_error,
56 int32_t system_error);
57
58 void DeliverBlock(PP_Resource decrypted_block, // PPB_Buffer.
59 PP_CompletionCallback callback);
60
61 void DeliverFrame(PP_Resource decrypted_frame, // PPB_Buffer.
62 PP_CompletionCallback callback);
63
64 void DeliverSamples(PP_Resource decrypted_samples, // PPB_Buffer.
65 PP_CompletionCallback callback);
66
67 private:
68 InstanceHandle associated_instance_;
69 };
70
71 } // namespace pp
72
73 #endif // PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698