OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/proxy/interface_proxy.h" | 10 #include "ppapi/proxy/interface_proxy.h" |
11 #include "ppapi/shared_impl/function_group_base.h" | 11 #include "ppapi/shared_impl/function_group_base.h" |
12 #include "ppapi/thunk/ppb_char_set_api.h" | 12 #include "ppapi/thunk/ppb_char_set_api.h" |
13 | 13 |
14 struct PPB_CharSet_Dev; | 14 struct PPB_CharSet_Dev; |
15 struct PPB_Core; | 15 struct PPB_Core; |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 namespace proxy { | 18 namespace proxy { |
19 | 19 |
20 class SerializedVarReturnValue; | 20 class SerializedVarReturnValue; |
21 | 21 |
22 class PPB_CharSet_Proxy : public InterfaceProxy, | 22 class PPB_CharSet_Proxy : public ppapi::FunctionGroupBase, |
23 public ppapi::thunk::PPB_CharSet_FunctionAPI { | 23 public ppapi::thunk::PPB_CharSet_FunctionAPI, |
| 24 public InterfaceProxy { |
24 public: | 25 public: |
25 PPB_CharSet_Proxy(Dispatcher* dispatcher); | 26 PPB_CharSet_Proxy(Dispatcher* dispatcher, const void* target_interface); |
26 virtual ~PPB_CharSet_Proxy(); | 27 virtual ~PPB_CharSet_Proxy(); |
27 | 28 |
| 29 static const Info* GetInfo(); |
| 30 |
28 // FunctionGroupBase overrides. | 31 // FunctionGroupBase overrides. |
29 virtual ppapi::thunk::PPB_CharSet_FunctionAPI* AsPPB_CharSet_FunctionAPI() | 32 virtual ppapi::thunk::PPB_CharSet_FunctionAPI* AsPPB_CharSet_FunctionAPI() |
30 OVERRIDE; | 33 OVERRIDE; |
31 | 34 |
32 // PPB_CharSet_FunctionAPI implementation. | 35 // PPB_CharSet_FunctionAPI implementation. |
33 virtual char* UTF16ToCharSet(PP_Instance instance, | 36 virtual char* UTF16ToCharSet(PP_Instance instance, |
34 const uint16_t* utf16, uint32_t utf16_len, | 37 const uint16_t* utf16, uint32_t utf16_len, |
35 const char* output_char_set, | 38 const char* output_char_set, |
36 PP_CharSet_ConversionError on_error, | 39 PP_CharSet_ConversionError on_error, |
37 uint32_t* output_length) OVERRIDE; | 40 uint32_t* output_length) OVERRIDE; |
38 virtual uint16_t* CharSetToUTF16(PP_Instance instance, | 41 virtual uint16_t* CharSetToUTF16(PP_Instance instance, |
39 const char* input, uint32_t input_len, | 42 const char* input, uint32_t input_len, |
40 const char* input_char_set, | 43 const char* input_char_set, |
41 PP_CharSet_ConversionError on_error, | 44 PP_CharSet_ConversionError on_error, |
42 uint32_t* output_length) OVERRIDE; | 45 uint32_t* output_length) OVERRIDE; |
43 virtual PP_Var GetDefaultCharSet(PP_Instance instance) OVERRIDE; | 46 virtual PP_Var GetDefaultCharSet(PP_Instance instance) OVERRIDE; |
44 | 47 |
45 // InterfaceProxy implementation. | 48 // InterfaceProxy implementation. |
46 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 49 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
47 | 50 |
48 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_CHAR_SET; | |
49 | |
50 private: | 51 private: |
51 void OnMsgGetDefaultCharSet(PP_Instance instance, | 52 void OnMsgGetDefaultCharSet(PP_Instance instance, |
52 SerializedVarReturnValue result); | 53 SerializedVarReturnValue result); |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(PPB_CharSet_Proxy); | 55 DISALLOW_COPY_AND_ASSIGN(PPB_CharSet_Proxy); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace proxy | 58 } // namespace proxy |
58 } // namespace ppapi | 59 } // namespace ppapi |
59 | 60 |
60 #endif // PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ | 61 #endif // PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ |
OLD | NEW |