Index: ppapi/proxy/ppb_char_set_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_char_set_proxy.cc (revision 100753) |
+++ ppapi/proxy/ppb_char_set_proxy.cc (working copy) |
@@ -9,7 +9,6 @@ |
#include "ppapi/c/dev/ppb_memory_dev.h" |
#include "ppapi/proxy/plugin_dispatcher.h" |
#include "ppapi/proxy/ppapi_messages.h" |
-#include "ppapi/proxy/ppb_memory_proxy.h" |
#include "ppapi/proxy/serialized_var.h" |
#include "ppapi/shared_impl/char_set_impl.h" |
#include "ppapi/thunk/enter.h" |
@@ -18,13 +17,40 @@ |
namespace ppapi { |
namespace proxy { |
-PPB_CharSet_Proxy::PPB_CharSet_Proxy(Dispatcher* dispatcher) |
- : InterfaceProxy(dispatcher) { |
+namespace { |
+ |
+const PPB_Memory_Dev* GetMemoryDevInterface() { |
+ return static_cast<const PPB_Memory_Dev*>( |
+ PluginDispatcher::GetInterfaceFromDispatcher(PPB_MEMORY_DEV_INTERFACE)); |
} |
+InterfaceProxy* CreateCharSetProxy(Dispatcher* dispatcher, |
+ const void* target_interface) { |
+ return new PPB_CharSet_Proxy(dispatcher, target_interface); |
+} |
+ |
+} // namespace |
+ |
+PPB_CharSet_Proxy::PPB_CharSet_Proxy(Dispatcher* dispatcher, |
+ const void* target_interface) |
+ : InterfaceProxy(dispatcher, target_interface) { |
+} |
+ |
PPB_CharSet_Proxy::~PPB_CharSet_Proxy() { |
} |
+// static |
+const InterfaceProxy::Info* PPB_CharSet_Proxy::GetInfo() { |
+ static const Info info = { |
+ ppapi::thunk::GetPPB_CharSet_Thunk(), |
+ PPB_CHAR_SET_DEV_INTERFACE, |
+ INTERFACE_ID_PPB_CHAR_SET, |
+ false, |
+ &CreateCharSetProxy, |
+ }; |
+ return &info; |
+} |
+ |
ppapi::thunk::PPB_CharSet_FunctionAPI* |
PPB_CharSet_Proxy::AsPPB_CharSet_FunctionAPI() { |
return this; |
@@ -37,8 +63,8 @@ |
PP_CharSet_ConversionError on_error, |
uint32_t* output_length) { |
return ppapi::CharSetImpl::UTF16ToCharSet( |
- GetPPB_Memory_Interface(), utf16, utf16_len, |
- output_char_set, on_error, output_length); |
+ GetMemoryDevInterface(), utf16, utf16_len, output_char_set, on_error, |
+ output_length); |
} |
uint16_t* PPB_CharSet_Proxy::CharSetToUTF16( |
@@ -48,8 +74,8 @@ |
PP_CharSet_ConversionError on_error, |
uint32_t* output_length) { |
return ppapi::CharSetImpl::CharSetToUTF16( |
- GetPPB_Memory_Interface(), input, input_len, |
- input_char_set, on_error, output_length); |
+ GetMemoryDevInterface(), input, input_len, input_char_set, on_error, |
+ output_length); |
} |
PP_Var PPB_CharSet_Proxy::GetDefaultCharSet(PP_Instance instance) { |