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

Side by Side Diff: native_client_sdk/src/examples/tutorial/using_ppapi_simple/example.js

Issue 262803014: Fix typo, "recieve" -> "receive", in NaCl/SDK code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Once we load, hide the plugin 5 // Once we load, hide the plugin
6 function moduleDidLoad() { 6 function moduleDidLoad() {
7 common.hideModule(); 7 common.hideModule();
8 } 8 }
9 9
10 // Called by the common.js module. 10 // Called by the common.js module.
11 // nacl_io/ppapi_simple generates two different types of messages: 11 // nacl_io/ppapi_simple generates two different types of messages:
12 // - messages from /dev/tty (prefixed with PS_TTY_PREFIX) 12 // - messages from /dev/tty (prefixed with PS_TTY_PREFIX)
13 // - exit message (prefixed with PS_EXIT_MESSAGE) 13 // - exit message (prefixed with PS_EXIT_MESSAGE)
14 function handleMessage(message) { 14 function handleMessage(message) {
15 if (message.data.indexOf("exit:") == 0) { 15 if (message.data.indexOf("exit:") == 0) {
16 // When we recieve the exit message we post an empty reply back to 16 // When we receive the exit message we post an empty reply back to
17 // confirm, at which point the module will exit. 17 // confirm, at which point the module will exit.
18 message.srcElement.postMessage({"exit" : ""}); 18 message.srcElement.postMessage({"exit" : ""});
19 } else if (message.data.indexOf("tty:") == 0) { 19 } else if (message.data.indexOf("tty:") == 0) {
20 common.logMessage(message.data.slice("tty:".length)); 20 common.logMessage(message.data.slice("tty:".length));
21 } else { 21 } else {
22 console.log("Unhandled message: " + message.data); 22 console.log("Unhandled message: " + message.data);
23 } 23 }
24 } 24 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/examples/api/socket/index.html ('k') | native_client_sdk/src/tests/nacl_io_test/tty_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698