OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_PLUGINS_PPAPI_PPB_CHAR_SET_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_CHAR_SET_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_CHAR_SET_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_CHAR_SET_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ppapi/shared_impl/function_group_base.h" | 10 #include "ppapi/shared_impl/function_group_base.h" |
11 #include "ppapi/thunk/ppb_char_set_api.h" | 11 #include "ppapi/thunk/ppb_char_set_api.h" |
12 | 12 |
13 namespace webkit { | 13 namespace webkit { |
14 namespace ppapi { | 14 namespace ppapi { |
15 | 15 |
16 class PluginInstance; | 16 class PluginInstance; |
17 | 17 |
18 class PPB_CharSet_Impl : public ::ppapi::FunctionGroupBase, | 18 class PPB_CharSet_Impl : public ::ppapi::FunctionGroupBase, |
19 public ::ppapi::thunk::PPB_CharSet_FunctionAPI { | 19 public ::ppapi::thunk::PPB_CharSet_FunctionAPI { |
20 public: | 20 public: |
21 PPB_CharSet_Impl(PluginInstance* instance); | 21 PPB_CharSet_Impl(PluginInstance* instance); |
22 ~PPB_CharSet_Impl(); | 22 ~PPB_CharSet_Impl(); |
23 | 23 |
24 // FunctionGroupBase overrides. | 24 // FunctionGroupBase overrides. |
25 virtual ::ppapi::thunk::PPB_CharSet_FunctionAPI* AsCharSet_FunctionAPI(); | 25 virtual ::ppapi::thunk::PPB_CharSet_FunctionAPI* AsPPB_CharSet_FunctionAPI(); |
26 | 26 |
27 // PPB_CharSet_FunctionAPI implementation. | 27 // PPB_CharSet_FunctionAPI implementation. |
28 virtual char* UTF16ToCharSet(PP_Instance instance, | 28 virtual char* UTF16ToCharSet(PP_Instance instance, |
29 const uint16_t* utf16, uint32_t utf16_len, | 29 const uint16_t* utf16, uint32_t utf16_len, |
30 const char* output_char_set, | 30 const char* output_char_set, |
31 PP_CharSet_ConversionError on_error, | 31 PP_CharSet_ConversionError on_error, |
32 uint32_t* output_length) OVERRIDE; | 32 uint32_t* output_length) OVERRIDE; |
33 virtual uint16_t* CharSetToUTF16(PP_Instance instance, | 33 virtual uint16_t* CharSetToUTF16(PP_Instance instance, |
34 const char* input, uint32_t input_len, | 34 const char* input, uint32_t input_len, |
35 const char* input_char_set, | 35 const char* input_char_set, |
36 PP_CharSet_ConversionError on_error, | 36 PP_CharSet_ConversionError on_error, |
37 uint32_t* output_length) OVERRIDE; | 37 uint32_t* output_length) OVERRIDE; |
38 virtual PP_Var GetDefaultCharSet(PP_Instance instance) OVERRIDE; | 38 virtual PP_Var GetDefaultCharSet(PP_Instance instance) OVERRIDE; |
39 | 39 |
40 private: | 40 private: |
41 PluginInstance* instance_; | 41 PluginInstance* instance_; |
42 | 42 |
43 DISALLOW_COPY_AND_ASSIGN(PPB_CharSet_Impl); | 43 DISALLOW_COPY_AND_ASSIGN(PPB_CharSet_Impl); |
44 }; | 44 }; |
45 | 45 |
46 } // namespace ppapi | 46 } // namespace ppapi |
47 } // namespace webkit | 47 } // namespace webkit |
48 | 48 |
49 #endif // WEBKIT_PLUGINS_PPAPI_PPB_CHAR_SET_IMPL_H_ | 49 #endif // WEBKIT_PLUGINS_PPAPI_PPB_CHAR_SET_IMPL_H_ |
OLD | NEW |