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

Unified Diff: extensions/browser/api/copresence_socket/copresence_socket_api.cc

Issue 698153005: Fix socket send. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/copresence_socket/copresence_socket_api.cc
diff --git a/extensions/browser/api/copresence_socket/copresence_socket_api.cc b/extensions/browser/api/copresence_socket/copresence_socket_api.cc
index b7be2b5e978e496f9ebe83ae6abc0b197cf51026..a55faec9216203abcb10cd14ad9ef5c777d74fa0 100644
--- a/extensions/browser/api/copresence_socket/copresence_socket_api.cc
+++ b/extensions/browser/api/copresence_socket/copresence_socket_api.cc
@@ -269,8 +269,14 @@ ExtensionFunction::ResponseAction CopresenceSocketSendFunction::Execute() {
core_api::copresence_socket::SOCKET_STATUS_INVALID_SOCKET)));
}
- socket->socket()->Send(new net::StringIOBuffer(CreateMessage(params->data)),
- params->data.size());
+ const std::string& message = CreateMessage(params->data);
+ VLOG(3) << "Sending message to socket_id = " << params->socket_id
+ << " with data[0] = " << static_cast<int>(message[0])
+ << ", data[1] = " << static_cast<int>(message[1]) << ", data[2:] = "
+ << std::string((message.c_str() + 2), message.size() - 2);
+
+ socket->socket()->Send(new net::StringIOBuffer(message), message.size());
+
return RespondNow(
ArgumentList(core_api::copresence_socket::Send::Results::Create(
core_api::copresence_socket::SOCKET_STATUS_NO_ERROR)));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698