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 #include "webkit/plugins/ppapi/ppb_char_set_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_char_set_impl.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_char_set_dev.h" | 7 #include "ppapi/c/dev/ppb_char_set_dev.h" |
8 #include "ppapi/shared_impl/char_set_impl.h" | 8 #include "ppapi/shared_impl/char_set_impl.h" |
9 #include "webkit/plugins/ppapi/plugin_delegate.h" | 9 #include "webkit/plugins/ppapi/plugin_delegate.h" |
10 #include "webkit/plugins/ppapi/plugin_module.h" | 10 #include "webkit/plugins/ppapi/plugin_module.h" |
11 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 11 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
12 #include "webkit/plugins/ppapi/resource_tracker.h" | 12 #include "webkit/plugins/ppapi/resource_tracker.h" |
13 #include "webkit/plugins/ppapi/var.h" | 13 #include "webkit/plugins/ppapi/var.h" |
14 | 14 |
15 using ::ppapi::thunk::PPB_CharSet_FunctionAPI; | 15 using ::ppapi::thunk::PPB_CharSet_FunctionAPI; |
16 | 16 |
17 namespace webkit { | 17 namespace webkit { |
18 namespace ppapi { | 18 namespace ppapi { |
19 | 19 |
20 PPB_CharSet_Impl::PPB_CharSet_Impl(PluginInstance* instance) | 20 PPB_CharSet_Impl::PPB_CharSet_Impl(PluginInstance* instance) |
21 : instance_(instance) { | 21 : instance_(instance) { |
22 } | 22 } |
23 | 23 |
24 PPB_CharSet_Impl::~PPB_CharSet_Impl() { | 24 PPB_CharSet_Impl::~PPB_CharSet_Impl() { |
25 } | 25 } |
26 | 26 |
27 PPB_CharSet_FunctionAPI* PPB_CharSet_Impl::AsCharSet_FunctionAPI() { | 27 PPB_CharSet_FunctionAPI* PPB_CharSet_Impl::AsPPB_CharSet_FunctionAPI() { |
28 return this; | 28 return this; |
29 } | 29 } |
30 | 30 |
31 char* PPB_CharSet_Impl::UTF16ToCharSet(PP_Instance instance, | 31 char* PPB_CharSet_Impl::UTF16ToCharSet(PP_Instance instance, |
32 const uint16_t* utf16, | 32 const uint16_t* utf16, |
33 uint32_t utf16_len, | 33 uint32_t utf16_len, |
34 const char* output_char_set, | 34 const char* output_char_set, |
35 PP_CharSet_ConversionError on_error, | 35 PP_CharSet_ConversionError on_error, |
36 uint32_t* output_length) { | 36 uint32_t* output_length) { |
37 return ::ppapi::CharSetImpl::UTF16ToCharSet( | 37 return ::ppapi::CharSetImpl::UTF16ToCharSet( |
(...skipping 12 matching lines...) Expand all Loading... |
50 output_length); | 50 output_length); |
51 } | 51 } |
52 | 52 |
53 PP_Var PPB_CharSet_Impl::GetDefaultCharSet(PP_Instance instance) { | 53 PP_Var PPB_CharSet_Impl::GetDefaultCharSet(PP_Instance instance) { |
54 std::string encoding = instance_->delegate()->GetDefaultEncoding(); | 54 std::string encoding = instance_->delegate()->GetDefaultEncoding(); |
55 return StringVar::StringToPPVar(instance_->module(), encoding); | 55 return StringVar::StringToPPVar(instance_->module(), encoding); |
56 } | 56 } |
57 | 57 |
58 } // namespace ppapi | 58 } // namespace ppapi |
59 } // namespace webkit | 59 } // namespace webkit |
OLD | NEW |