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

Unified Diff: native_client_sdk/src/doc/devguide/devcycle/debugging.rst

Issue 530173003: Remove 'Redirecting output to the JavaScript console'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/doc_generated/devguide/devcycle/debugging.html ('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/doc/devguide/devcycle/debugging.rst
diff --git a/native_client_sdk/src/doc/devguide/devcycle/debugging.rst b/native_client_sdk/src/doc/devguide/devcycle/debugging.rst
index 326ac22b6f379652e7634222c1c67d138a937e59..d68fede2d8020e715f25b3ac2814bfb6b66c0cff 100644
--- a/native_client_sdk/src/doc/devguide/devcycle/debugging.rst
+++ b/native_client_sdk/src/doc/devguide/devcycle/debugging.rst
@@ -114,61 +114,6 @@ variable as follows:
the ``--no-sandbox`` flag. You must also be careful that each variable points
to a different file.
-Redirecting output to the JavaScript console
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You can also cause output from printf statements in your C/C++ code to be
-relayed to the JavaScript side of your application through the Pepper messaging
-system, where you can then write the output to the JavaScript console. Follow
-these steps:
-
-#. Set the ``NACL_EXE_STDOUT`` and ``NACL_EXE_STDERR`` environment variables as
- follows:
-
- * ``NACL_EXE_STDOUT=DEBUG_ONLY:dev://postmessage``
- * ``NACL_EXE_STDERR=DEBUG_ONLY:dev://postmessage``
-
- These settings tell Native Client to use ``PostMessage()`` to send output
- that your Native Client module writes to stdout and stderr to the JavaScript
- side of your application.
-
-#. Register a JavaScript handler to receive messages from your Native Client
- module:
-
- .. naclcode::
-
- <div id="nacl_container">
- <script type="text/javascript">
- var container = document.getElementById('nacl_container');
- container.addEventListener('message', handleMessage, true);
- </script>
- <embed id="nacl_module"
- src="my_application.nmf"
- type="application/x-nacl" />
- </div>
-
-#. Implement a simple JavaScript handler that logs the messages it receives to
- the JavaScript console:
-
- .. naclcode::
-
- function handleMessage(message_event) {
- console.log(message_event.data);
- }
-
- This handler works in the simple case where the only messages your Native
- Client module sends to JavaScript are messages with the output from stdout
- and stderr. If your Native Client module also sends other messages to
- JavaScript, your handler will need to be more complex.
-
- Once you've implemented a message handler and set up the environment
- variables as described above, you can check the JavaScript console to see
- output that your Native Client module prints to stdout and stderr. Keep in
- mind that your module makes a call to ``PostMessage()`` every time it flushes
- stdout or stderr. Your application's performance will degrade considerably
- if your module prints and flushes frequently, or if it makes frequent Pepper
- calls to begin with (e.g., to render).
-
Logging calls to Pepper interfaces
----------------------------------
« no previous file with comments | « native_client_sdk/doc_generated/devguide/devcycle/debugging.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698