Skip to content

Commit

Permalink
Add data-path restriction to tutorial, part 2.
Browse files Browse the repository at this point in the history
BUG=none
R= jf@chromium.org
TEST=none
NOTRY=true
(documentation only change)

Review URL: https://codereview.chromium.org/531183002

Cr-Commit-Position: refs/heads/master@{#293302}
  • Loading branch information
jmedley authored and Commit bot committed Sep 4, 2014
1 parent 2b25dac commit 445060e
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,17 @@ <h2 id="step-7-implement-a-message-handler-in-the-native-client-module">Step 7:
and <a class="reference external" href="/native-client/pepper_stable/cpp/classpp_1_1_instance.html#a67e888a4e4e23effe7a09625e73ecae9">pp::Instance.PostMessage</a>
member functions.</p>
<h2 id="step-8-compile-the-native-client-module-and-run-the-application-again">Step 8: Compile the Native Client module and run the application again</h2>
<p>Compile the Native Client module by running the <code>make</code> command again.</p>
<p>Re-run the application by reloading <code>http://localhost:5103/part1</code> in Chrome.</p>
<p>After Chrome loads the Native Client module, you should see an alert panel
appear with the message sent from the module.</p>
<ol class="arabic">
<li><p class="first">Compile the Native Client module by running the <code>make</code> command again.</p>
</li>
<li><p class="first">Start the SDK web server by running <code>make server</code>.</p>
</li>
<li><p class="first">Re-run the application by reloading <code>http://localhost:5103/part1</code> in
Chrome.</p>
<p>After Chrome loads the Native Client module, you should see the message sent
from the module.</p>
</li>
</ol>
<h2 id="troubleshooting"><span id="tutorial-troubleshooting"></span>Troubleshooting</h2>
<p>If your application doesn&#8217;t run, see <a class="reference internal" href="#tutorial-step-3"><em>Step 3</em></a> above to
verify that you&#8217;ve set up your environment correctly, including both the Chrome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</ul>
</li>
<li><a class="reference internal" href="#example-specific-behavior-with-example-js" id="id13">Example-specific behavior with example.js</a></li>
<li><a class="reference internal" href="#compile-the-native-client-module-and-run-the-application-again" id="id14">Compile the Native Client module and run the application again</a></li>
</ul>

</div><h2 id="overview">Overview</h2>
Expand Down Expand Up @@ -252,7 +253,9 @@ <h3 id="making-index-html-support-different-toolchains-and-configurations">Makin
<p><code>common.js</code> will read these data attributes to allow you to load the same
example with different toolchains by changing the URL&#8217;s <a class="reference external" href="http://en.wikipedia.org/wiki/Query_string">query string</a>. For example, you can load the
glibc Debug version of this example by navigating to
<code>index.html?tc=glibc&amp;config=Debug</code>.</p>
<code>index.html?tc=glibc&amp;config=Debug</code>. Path URI&#8217;s such as <code>../</code>, for example
do not work for either the data-path parameter or its corresponding query
string.</p>
<p>Next, we remove the <code>embed</code> element that is described in HTML. This will be
automatically added for us by <code>common.js</code>, based on the current
toolchain/configuration combination:</p>
Expand Down Expand Up @@ -423,6 +426,18 @@ <h2 id="example-specific-behavior-with-example-js">Example-specific behavior wit
logEl.textContent += message.data;
}
</pre>
<h2 id="compile-the-native-client-module-and-run-the-application-again">Compile the Native Client module and run the application again</h2>
<ol class="arabic">
<li><p class="first">Compile the Native Client module by running the <code>make</code> command again.</p>
</li>
<li><p class="first">Start the SDK web server by running <code>make server</code>.</p>
</li>
<li><p class="first">Re-run the application by reloading <code>http://localhost:5103/part2</code> in
Chrome.</p>
<p>After Chrome loads the Native Client module, you should see the message sent
from the module.</p>
</li>
</ol>
</section>

{{/partials.standard_nacl_article}}
1 change: 1 addition & 0 deletions native_client_sdk/doc_generated/sitemap.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ <h1 id="native-client-documentation-sitemap">Native Client Documentation Sitemap
<li class="toctree-l2"><a class="reference internal" href="/native-client/devguide/tutorial/tutorial-part2.html#making-index-html-work-for-chrome-apps">Making index.html work for Chrome Apps</a></li>
<li class="toctree-l2"><a class="reference internal" href="/native-client/devguide/tutorial/tutorial-part2.html#sharing-common-code-with-common-js">Sharing common code with common.js</a></li>
<li class="toctree-l2"><a class="reference internal" href="/native-client/devguide/tutorial/tutorial-part2.html#example-specific-behavior-with-example-js">Example-specific behavior with example.js</a></li>
<li class="toctree-l2"><a class="reference internal" href="/native-client/devguide/tutorial/tutorial-part2.html#compile-the-native-client-module-and-run-the-application-again">Compile the Native Client module and run the application again</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="/native-client/devguide/devcycle/index.html">Development Cycle</a></li>
Expand Down
13 changes: 7 additions & 6 deletions native_client_sdk/src/doc/devguide/tutorial/tutorial-part1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,13 @@ member functions.
Step 8: Compile the Native Client module and run the application again
======================================================================

Compile the Native Client module by running the ``make`` command again.

Re-run the application by reloading ``http://localhost:5103/part1`` in Chrome.

After Chrome loads the Native Client module, you should see an alert panel
appear with the message sent from the module.
#. Compile the Native Client module by running the ``make`` command again.
#. Start the SDK web server by running ``make server``.
#. Re-run the application by reloading ``http://localhost:5103/part1`` in
Chrome.

After Chrome loads the Native Client module, you should see the message sent
from the module.

.. _tutorial_troubleshooting:

Expand Down
15 changes: 14 additions & 1 deletion native_client_sdk/src/doc/devguide/tutorial/tutorial-part2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ configurations, and path to the ``.nmf`` file:
example with different toolchains by changing the URL's `query string
<http://en.wikipedia.org/wiki/Query_string>`_. For example, you can load the
glibc Debug version of this example by navigating to
``index.html?tc=glibc&config=Debug``.
``index.html?tc=glibc&config=Debug``. Path URI's such as ``../``, for example
do not work for either the data-path parameter or its corresponding query
string.

Next, we remove the ``embed`` element that is described in HTML. This will be
automatically added for us by ``common.js``, based on the current
Expand Down Expand Up @@ -496,3 +498,14 @@ during the module loading process. This example only needs to respond to two:
var logEl = document.getElementById('log');
logEl.textContent += message.data;
}

Compile the Native Client module and run the application again
==============================================================

#. Compile the Native Client module by running the ``make`` command again.
#. Start the SDK web server by running ``make server``.
#. Re-run the application by reloading ``http://localhost:5103/part2`` in
Chrome.

After Chrome loads the Native Client module, you should see the message sent
from the module.

0 comments on commit 445060e

Please sign in to comment.