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

Unified Diff: native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc

Issue 318153004: [NaCl SDK] nacl_io: fix TTY warning messages when using naclterm/hterm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « native_client_sdk/src/libraries/nacl_io/log.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc
diff --git a/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc b/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc
index 53b44236bf5bc820cd5071b4f4ad0911be2a49a2..bee1ed1fe2ba5faa6d3a1ae8efa3aa49a5bc872f 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc
+++ b/native_client_sdk/src/libraries/ppapi_simple/ps_instance.cc
@@ -409,12 +409,8 @@ void PSInstance::MessageHandlerInput(const pp::Var& key,
const pp::Var& message) {
std::string key_string = key.AsString();
- // Legacy support for passing TTY data as a string, rather than a array
- // buffer. TODO(sbc): remove this in a future release.
if (message.is_string() && key_string == tty_prefix_) {
std::string buffer = message.AsString();
- Warn("Passing TTY input as a string is deprected. Please use a "
- "JavaScript ArrayBuffer instead");
// Since our message may contain null characters, we can't send it as a
// naked C string, so we package it up in this struct before sending it
@@ -422,11 +418,11 @@ void PSInstance::MessageHandlerInput(const pp::Var& key,
struct tioc_nacl_input_string ioctl_message;
ioctl_message.length = buffer.size();
ioctl_message.buffer = buffer.c_str();
- int ret =
- ioctl(tty_fd_, TIOCNACLINPUT, &ioctl_message);
+ int ret = ioctl(tty_fd_, TIOCNACLINPUT, &ioctl_message);
if (ret != 0 && errno != ENOTTY) {
Error("ioctl returned unexpected error: %d.\n", ret);
}
+ return;
}
if (!message.is_array_buffer()) {
@@ -532,12 +528,12 @@ void PSInstance::PostEvent(PSEventType type, const PP_Var& var) {
// Legacy support for passing TTY input as a string <prefix>:<payload>
// TODO(sbc): remove this in a future release.
if (tty_fd_ >= 0 && event.is_string()) {
- Warn("passing TTY data using a string prefix is deprected."
- " Use a JavaScript dictionary instead.");
std::string message = event.AsString();
size_t prefix_len = strlen(tty_prefix_);
if (message.size() > prefix_len) {
if (!strncmp(message.c_str(), tty_prefix_, prefix_len)) {
+ LOG_WARN("Passing TTY data using a string prefix is deprecated. "
+ "Use a JavaScript dictionary instead.");
MessageHandlerInput(pp::Var(message.substr(0, prefix_len)),
pp::Var(message.substr(prefix_len)));
return;
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/log.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698