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

Unified Diff: ppapi/proxy/ppb_char_set_proxy.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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_buffer_proxy.cc ('k') | ppapi/proxy/ppb_core_proxy.cc » ('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 71973)
+++ ppapi/proxy/ppb_char_set_proxy.cc (working copy)
@@ -20,9 +20,14 @@
const char* output_char_set,
PP_CharSet_ConversionError on_error,
uint32_t* output_length) {
+ *output_length = 0;
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return NULL;
+
bool output_is_success = false;
std::string result;
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCharSet_UTF16ToCharSet(
+ dispatcher->Send(new PpapiHostMsg_PPBCharSet_UTF16ToCharSet(
INTERFACE_ID_PPB_CHAR_SET, instance,
string16(reinterpret_cast<const char16*>(utf16), utf16_len),
std::string(output_char_set), static_cast<int32_t>(on_error),
@@ -41,9 +46,14 @@
const char* input_char_set,
PP_CharSet_ConversionError on_error,
uint32_t* output_length) {
+ *output_length = 0;
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return NULL;
+
bool output_is_success = false;
string16 result;
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCharSet_CharSetToUTF16(
+ dispatcher->Send(new PpapiHostMsg_PPBCharSet_CharSetToUTF16(
INTERFACE_ID_PPB_CHAR_SET, instance,
std::string(input, input_len),
std::string(input_char_set), static_cast<int32_t>(on_error),
@@ -59,10 +69,14 @@
}
PP_Var GetDefaultCharSet(PP_Instance instance) {
+ PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
+ if (!dispatcher)
+ return PP_MakeUndefined();
+
ReceiveSerializedVarReturnValue result;
- PluginDispatcher::Get()->Send(new PpapiHostMsg_PPBCharSet_GetDefaultCharSet(
+ dispatcher->Send(new PpapiHostMsg_PPBCharSet_GetDefaultCharSet(
INTERFACE_ID_PPB_CHAR_SET, instance, &result));
- return result.Return(PluginDispatcher::Get());
+ return result.Return(dispatcher);
}
const PPB_CharSet_Dev ppb_charset_interface = {
« no previous file with comments | « ppapi/proxy/ppb_buffer_proxy.cc ('k') | ppapi/proxy/ppb_core_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698