Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: ppapi/proxy/ppb_char_set_proxy.cc

Issue 7844018: Revert 100748 - This patch tries to remove most of the manual registration for Pepper interfaces,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppb_char_set_proxy.h ('k') | ppapi/proxy/ppb_console_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ppapi/proxy/ppb_char_set_proxy.h ('k') | ppapi/proxy/ppb_console_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698