- add sources.
[platform/framework/web/crosswalk.git] / src / ppapi / proxy / ppp_content_decryptor_private_proxy.h
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_PROXY_PPP_CONTENT_DECRYPTOR_PRIVATE_PROXY_H_
6 #define PPAPI_PROXY_PPP_CONTENT_DECRYPTOR_PRIVATE_PROXY_H_
7
8 #include <string>
9
10 #include "ppapi/c/pp_instance.h"
11 #include "ppapi/c/private/ppp_content_decryptor_private.h"
12 #include "ppapi/proxy/interface_proxy.h"
13 #include "ppapi/proxy/serialized_structs.h"
14 #include "ppapi/shared_impl/host_resource.h"
15
16 namespace ppapi {
17 namespace proxy {
18
19 class SerializedVarReceiveInput;
20
21 class PPP_ContentDecryptor_Private_Proxy : public InterfaceProxy {
22  public:
23   explicit PPP_ContentDecryptor_Private_Proxy(Dispatcher* dispatcher);
24   virtual ~PPP_ContentDecryptor_Private_Proxy();
25
26   static const PPP_ContentDecryptor_Private* GetProxyInterface();
27
28  private:
29   // InterfaceProxy implementation.
30   virtual bool OnMessageReceived(const IPC::Message& msg);
31
32   // Message handlers.
33   void OnMsgInitialize(PP_Instance instance,
34                        SerializedVarReceiveInput key_system,
35                        bool can_challenge_platform);
36   void OnMsgGenerateKeyRequest(PP_Instance instance,
37                                SerializedVarReceiveInput type,
38                                SerializedVarReceiveInput init_data);
39   void OnMsgAddKey(PP_Instance instance,
40                    SerializedVarReceiveInput session_id,
41                    SerializedVarReceiveInput key,
42                    SerializedVarReceiveInput init_data);
43   void OnMsgCancelKeyRequest(PP_Instance instance,
44                              SerializedVarReceiveInput session_id);
45   void OnMsgDecrypt(PP_Instance instance,
46                     const PPPDecryptor_Buffer& encrypted_buffer,
47                     const std::string& serialized_encrypted_block_info);
48   void OnMsgInitializeAudioDecoder(
49       PP_Instance instance,
50       const std::string& decoder_config,
51       const PPPDecryptor_Buffer& extra_data_buffer);
52   void OnMsgInitializeVideoDecoder(
53       PP_Instance instance,
54       const std::string& decoder_config,
55       const PPPDecryptor_Buffer& extra_data_buffer);
56   void OnMsgDeinitializeDecoder(PP_Instance instance,
57                                 PP_DecryptorStreamType decoder_type,
58                                 uint32_t request_id);
59   void OnMsgResetDecoder(PP_Instance instance,
60                          PP_DecryptorStreamType decoder_type,
61                          uint32_t request_id);
62   void OnMsgDecryptAndDecode(
63       PP_Instance instance,
64       PP_DecryptorStreamType decoder_type,
65       const PPPDecryptor_Buffer& encrypted_buffer,
66       const std::string& serialized_encrypted_block_info);
67
68   const PPP_ContentDecryptor_Private* ppp_decryptor_impl_;
69
70   DISALLOW_COPY_AND_ASSIGN(PPP_ContentDecryptor_Private_Proxy);
71 };
72
73 }  // namespace proxy
74 }  // namespace ppapi
75
76 #endif  // PPAPI_PROXY_PPP_CONTENT_DECRYPTOR_PRIVATE_PROXY_H_