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

Unified Diff: native_client_sdk/src/tools/create_html.py

Issue 341893005: [NaCl SDK] create_html.py now adds PS_TTY_PREFIX attribute to NaCl embed. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/create_html.py
diff --git a/native_client_sdk/src/tools/create_html.py b/native_client_sdk/src/tools/create_html.py
index 6b8a2df9e62630eb27b413d170cc0bf1b902f8e8..64f6d89afdaea0247f1832d540494dd9e36f1b84 100755
--- a/native_client_sdk/src/tools/create_html.py
+++ b/native_client_sdk/src/tools/create_html.py
@@ -27,11 +27,11 @@ HTML_TEMPLATE = '''\
Sample html container for embedded NaCl module. This file was auto-generated
by the create_html tool which is part of the NaCl SDK.
-The embed tag is setup with ps_stdout and ps_stderr attributes which, for
-applications linked with ppapi_simple, will cause stdout and stderr to be sent
-to javascript via postMessage. Also, the postMessage listener assumes that
-all messages sent via postMessage are strings to be displayed in the output
-textarea.
+The embed tag is setup with PS_STDOUT, PS_STDERR and PS_TTY_PREFIX attributes
+which, for applications linked with ppapi_simple, will cause stdout and stderr
+to be sent to javascript via postMessage. Also, the postMessage listener
+assumes that all messages sent via postMessage are strings to be displayed in
+the output textarea.
-->
<html>
<head>
@@ -46,8 +46,10 @@ textarea.
<div id="listener">
<embed id="nacl_module" name="%(module_name)s" src="%(nmf)s"
- type="application/x-nacl" ps_stdout="/dev/tty" ps_stderr="/dev/tty"
- width=640 height=480 />
+ type="application/x-nacl" width=640 height=480
+ PS_TTY_PREFIX="tty:"
+ PS_STDOUT="/dev/tty"
+ PS_STDERR="/dev/tty" >/
</div>
<p>Standard output/error:</p>
@@ -69,7 +71,11 @@ function addToStdout(message) {
}
function handleMessage(message) {
- addToStdout(message.data)
+ var payload = message.data;
+ var prefix = "tty:";
binji 2014/06/18 20:43:32 I'd like to remove this message format as well (st
Sam Clegg 2014/06/18 20:48:38 Agreed.
+ if (typeof(payload) == 'string' && payload.indexOf(prefix) == 0) {
+ addToStdout(payload.slice(prefix.length));
+ }
}
function handleCrash(event) {
« 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