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

Unified Diff: ppapi/proxy/websocket_resource.cc

Issue 11106019: PluginResource: Avoid having two sets of similar methods for talking with browser and renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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/printing_resource.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/websocket_resource.cc
diff --git a/ppapi/proxy/websocket_resource.cc b/ppapi/proxy/websocket_resource.cc
index de9ee2b5074bda8cc58d1bf9c1e813e328016fd6..1f93c8ba612c25630873baec06bdc90b798b511a 100644
--- a/ppapi/proxy/websocket_resource.cc
+++ b/ppapi/proxy/websocket_resource.cc
@@ -116,9 +116,9 @@ int32_t WebSocketResource::Connect(
// Create remote host in the renderer, then request to check the URL and
// establish the connection.
state_ = PP_WEBSOCKETREADYSTATE_CONNECTING;
- SendCreateToRenderer(PpapiHostMsg_WebSocket_Create());
+ SendCreate(RENDERER, PpapiHostMsg_WebSocket_Create());
PpapiHostMsg_WebSocket_Connect msg(url_->value(), protocol_strings);
- CallRenderer<PpapiPluginMsg_WebSocket_ConnectReply>(msg,
+ Call<PpapiPluginMsg_WebSocket_ConnectReply>(RENDERER, msg,
base::Bind(&WebSocketResource::OnPluginMsgConnectReply, this));
return PP_OK_COMPLETIONPENDING;
@@ -178,7 +178,7 @@ int32_t WebSocketResource::Close(uint16_t code,
// Need to do a "Post" to avoid reentering the plugin.
connect_callback_->PostAbort();
connect_callback_ = NULL;
- PostToRenderer(PpapiHostMsg_WebSocket_Fail(
+ Post(RENDERER, PpapiHostMsg_WebSocket_Fail(
"WebSocket was closed before the connection was established."));
return PP_OK_COMPLETIONPENDING;
}
@@ -195,7 +195,7 @@ int32_t WebSocketResource::Close(uint16_t code,
state_ = PP_WEBSOCKETREADYSTATE_CLOSING;
PpapiHostMsg_WebSocket_Close msg(static_cast<int32_t>(event_code),
reason_string);
- CallRenderer<PpapiPluginMsg_WebSocket_CloseReply>(msg,
+ Call<PpapiPluginMsg_WebSocket_CloseReply>(RENDERER, msg,
base::Bind(&WebSocketResource::OnPluginMsgCloseReply, this));
return PP_OK_COMPLETIONPENDING;
}
@@ -269,7 +269,7 @@ int32_t WebSocketResource::SendMessage(const PP_Var& message) {
scoped_refptr<StringVar> message_string = StringVar::FromPPVar(message);
if (!message_string)
return PP_ERROR_BADARGUMENT;
- PostToRenderer(PpapiHostMsg_WebSocket_SendText(message_string->value()));
+ Post(RENDERER, PpapiHostMsg_WebSocket_SendText(message_string->value()));
} else if (message.type == PP_VARTYPE_ARRAY_BUFFER) {
// Convert message to std::vector<uint8_t>, then send it.
scoped_refptr<ArrayBufferVar> message_arraybuffer =
@@ -280,7 +280,7 @@ int32_t WebSocketResource::SendMessage(const PP_Var& message) {
uint32 message_length = message_arraybuffer->ByteLength();
std::vector<uint8_t> message_vector(message_data,
message_data + message_length);
- PostToRenderer(PpapiHostMsg_WebSocket_SendBinary(message_vector));
+ Post(RENDERER, PpapiHostMsg_WebSocket_SendBinary(message_vector));
} else {
// TODO(toyoshim): Support Blob.
return PP_ERROR_NOTSUPPORTED;
« no previous file with comments | « ppapi/proxy/printing_resource.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698