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

Side by Side Diff: ppapi/cpp/private/content_decryptor_private.h

Issue 10827280: Add PPAPI decryptor implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed NeedKey, addressed all comments (excluding one of dmichael's). 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_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 virtual bool GenerateKeyRequest(const std::string& key_system,
28 pp::VarArrayBuffer init_data) = 0;
29 virtual bool AddKey(const std::string& session_id,
30 pp::VarArrayBuffer key) = 0;
31 virtual bool CancelKeyRequest(const std::string& session_id) = 0;
32 virtual bool Decrypt(pp::Buffer_Dev encrypted_buffer,
33 int32_t request_id) = 0;
34 virtual bool DecryptAndDecode(pp::Buffer_Dev encrypted_buffer,
35 int32_t request_id) = 0;
36
37 // PPB_ContentDecryptor_Private methods for passing data from the decryptor
38 // to the browser.
39 void NeedKey(const std::string& key_system,
40 const std::string& session_id,
41 pp::VarArrayBuffer init_data);
42 void KeyAdded(const std::string& key_system,
43 const std::string& session_id);
44 void KeyMessage(const std::string& key_system,
45 const std::string& session_id,
46 pp::Buffer_Dev message,
47 const std::string& default_url);
48 void KeyError(const std::string& key_system,
49 const std::string& session_id,
50 int32_t media_error,
51 int32_t system_code);
52 void DeliverBlock(pp::Buffer_Dev decrypted_block,
53 int32_t request_id);
54 void DeliverFrame(pp::Buffer_Dev decrypted_frame,
55 int32_t request_id);
56 void DeliverSamples(pp::Buffer_Dev decrypted_samples,
57 int32_t request_id);
58
59 private:
60 InstanceHandle associated_instance_;
61 };
62
63 } // namespace pp
64
65 #endif // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_
OLDNEW
« no previous file with comments | « no previous file | ppapi/cpp/private/content_decryptor_private.cc » ('j') | ppapi/proxy/ppp_content_decryptor_private_proxy.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698