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

Unified Diff: native_client_sdk/src/examples/websocket/websocket.cc

Issue 13488007: [NaCl SDK] Make the SDK examples buildable as a packaged app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix license headers Created 7 years, 8 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
Index: native_client_sdk/src/examples/websocket/websocket.cc
diff --git a/native_client_sdk/src/examples/websocket/websocket.cc b/native_client_sdk/src/examples/websocket/websocket.cc
index fc1f0ed73d5c26978b67e01198216cc07af0aeb0..fd42934e5e8dce368e73af78d246d72af3ace40c 100644
--- a/native_client_sdk/src/examples/websocket/websocket.cc
+++ b/native_client_sdk/src/examples/websocket/websocket.cc
@@ -77,7 +77,7 @@ void WebSocketInstance::Open(const std::string& url) {
if (!websocket_)
return;
websocket_->Connect(pp::Var(url), NULL, 0, callback);
- PostMessage(pp::Var("log:connecting..."));
+ PostMessage(pp::Var("connecting..."));
}
void WebSocketInstance::Close() {
@@ -92,7 +92,7 @@ void WebSocketInstance::Send(const std::string& message) {
if (!IsConnected())
return;
websocket_->SendMessage(pp::Var(message));
- PostMessage(pp::Var(std::string("log:send: ") + message));
+ PostMessage(pp::Var(std::string("send: ") + message));
}
void WebSocketInstance::Receive() {
@@ -104,25 +104,25 @@ void WebSocketInstance::Receive() {
void WebSocketInstance::OnConnectCompletion(int32_t result) {
if (result != PP_OK) {
- PostMessage(pp::Var("alert:connection failed"));
+ PostMessage(pp::Var("connection failed"));
return;
}
- PostMessage(pp::Var("log:connected"));
+ PostMessage(pp::Var("connected"));
Receive();
}
void WebSocketInstance::OnCloseCompletion(int32_t result) {
PostMessage(pp::Var(PP_OK == result ?
- "log:closed" :
- "alert:abnormally closed"));
+ "closed" :
+ "abnormally closed"));
}
void WebSocketInstance::OnReceiveCompletion(int32_t result) {
if (result == PP_OK) {
if (receive_var_.is_array_buffer())
- PostMessage(pp::Var("log: receive: binary data"));
+ PostMessage(pp::Var("receive: binary data"));
else
- PostMessage(pp::Var(std::string("log:receive: ") +
+ PostMessage(pp::Var(std::string("receive: ") +
receive_var_.AsString()));
}
Receive();
« no previous file with comments | « native_client_sdk/src/examples/websocket/index.html ('k') | native_client_sdk/src/libraries/nacl_io/mount_http.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698