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

Side by Side Diff: native_client_sdk/doc_generated/faq.html

Issue 886163005: NaCl documentation: update FAQ and examples (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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
OLDNEW
1 {{+bindTo:partials.standard_nacl_article}} 1 {{+bindTo:partials.standard_nacl_article}}
2 2
3 <section id="frequently-asked-questions"> 3 <section id="frequently-asked-questions">
4 <h1 id="frequently-asked-questions">Frequently Asked Questions</h1> 4 <h1 id="frequently-asked-questions">Frequently Asked Questions</h1>
5 <div class="contents local" id="contents" style="display: none"> 5 <div class="contents local" id="contents" style="display: none">
6 <ul class="small-gap"> 6 <ul class="small-gap">
7 <li><p class="first"><a class="reference internal" href="#what-is-native-client- good-for" id="id1">What is Native Client Good For?</a></p> 7 <li><p class="first"><a class="reference internal" href="#what-is-native-client- good-for" id="id1">What is Native Client Good For?</a></p>
8 <ul class="small-gap"> 8 <ul class="small-gap">
9 <li><a class="reference internal" href="#why-did-google-build-native-client" id= "id2">Why did Google build Native Client?</a></li> 9 <li><a class="reference internal" href="#why-did-google-build-native-client" id= "id2">Why did Google build Native Client?</a></li>
10 <li><a class="reference internal" href="#when-should-i-use-portable-native-clien t-instead-of-native-client" id="id3">When should I use Portable Native Client in stead of Native Client?</a></li> 10 <li><a class="reference internal" href="#when-should-i-use-portable-native-clien t-instead-of-native-client" id="id3">When should I use Portable Native Client in stead of Native Client?</a></li>
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 <h3 id="how-easy-is-it-to-port-my-existing-native-code-to-native-client">How eas y is it to port my existing native code to Native Client?</h3> 412 <h3 id="how-easy-is-it-to-port-my-existing-native-code-to-native-client">How eas y is it to port my existing native code to Native Client?</h3>
413 <p>In most cases you won&#8217;t have to rewrite much, if any, code. The Native 413 <p>In most cases you won&#8217;t have to rewrite much, if any, code. The Native
414 Client-specific tools, such as <code>pnacl-clang++</code> or <code>x86_64-nacl-g ++</code>, 414 Client-specific tools, such as <code>pnacl-clang++</code> or <code>x86_64-nacl-g ++</code>,
415 take care of most of the necessary changes. You may need to make some 415 take care of most of the necessary changes. You may need to make some
416 changes to your operating system calls and interactions with external 416 changes to your operating system calls and interactions with external
417 devices to work with the web. Porting existing Linux libraries is 417 devices to work with the web. Porting existing Linux libraries is
418 generally straightforward, with large libraries often requiring no 418 generally straightforward, with large libraries often requiring no
419 source change.</p> 419 source change.</p>
420 <p>The following kinds of code may be more challenging to port:</p> 420 <p>The following kinds of code may be more challenging to port:</p>
421 <ul class="small-gap"> 421 <ul class="small-gap">
422 <li>Code that does direct TCP/IP or UDP networking. For security reasons 422 <li>Code that does direct <a class="reference external" href="pepper_stable/cpp/ classpp_1_1_u_d_p_socket">TCP</a> or
423 these APIs are only available to packaged applications, not on the 423 <a class="reference external" href="pepper_stable/cpp/classpp_1_1_u_d_p_socket"> UDP</a> networking. For security
424 open web, after asking for the appropriate permissions. Native Client 424 reasons these APIs are only available to <a class="reference external" href="/ap ps/about_apps">packaged applications</a> after asking for the appropriate permis sions, not on the
425 is otherwise restricted to the networking APIs available in the 425 open web. Native Client is otherwise restricted to the networking APIs
426 browser.</li> 426 available in the browser. You may want to use to <a class="reference external" h ref="nacl_io">nacl_io library</a>
427 <li>Code that creates processes, including UNIX forks. Creating processes 427 to use POSIX-like sockets.</li>
428 is not supported for security reasons. However, threads are supported.</li> 428 <li>Code that creates processes, including UNIX <code>fork</code>, won&#8217;t f unction
429 <li>Code that needs to do local file I/O. Native Client is restricted to 429 as-is. However, threads are supported. You can nonetheless create new
430 accessing URLs and to local storage in the browser (the Pepper file I/O API 430 <code>&lt;embed&gt;</code> tags in your HTML page to launch new PNaCl processes, even using
431 has access to the same per-application storage that JavaScript has via Local 431 new <code>.pexe</code> files that your existing <code>.pexe</code> saved in a lo cal
432 Storage). HTML5 File System can be used, among others. For POSIX compatabiliy 432 filesystem. This is somewhat akin to <code>execve</code>, but the process manage ment
433 the Native Client SDK includes a library called nacl_io which allows the 433 has to go through <code>postMessage</code> to JavaScript in order to create the new
434 application to interact with all these types of files via standard POSIX I/O 434 <code>&lt;embed&gt;</code>.</li>
435 functions (e.g. open/fopen/read/write/...). See <a class="reference internal" hr ef="/native-client/devguide/coding/nacl_io.html"><em>Using NaCl I/O</em></a> for more details.</li> 435 <li>Code that needs to do local file I/O. Native Client is restricted to accessi ng
436 URLs and to local storage in the browser (the Pepper <a class="reference interna l" href="/native-client/devguide/coding/file-io.html"><em>File IO API</em></a> h as access to the same per-application storage that
437 JavaScript has via Local Storage). HTML5 File System can be used, among
438 others. For POSIX compatabiliy the Native Client SDK includes a library called
439 nacl_io which allows the application to interact with all these types of files
440 via standard POSIX I/O functions (e.g. <code>open</code> / <code>fopen</code> / <code>read</code> /
441 <code>write</code> / ...). See <a class="reference internal" href="/native-clien t/devguide/coding/nacl_io.html"><em>Using NaCl I/O</em></a> for more
442 details.</li>
436 </ul> 443 </ul>
437 <h2 id="troubleshooting"><span id="faq-troubleshooting"></span>Troubleshooting</ h2> 444 <h2 id="troubleshooting"><span id="faq-troubleshooting"></span>Troubleshooting</ h2>
438 <h3 id="my-pexe-isn-t-loading-help">My <code>.pexe</code> isn&#8217;t loading, h elp!</h3> 445 <h3 id="my-pexe-isn-t-loading-help">My <code>.pexe</code> isn&#8217;t loading, h elp!</h3>
439 <ul class="small-gap"> 446 <ul class="small-gap">
440 <li>You must use Google Chrome version 31 or greater for Portable Native 447 <li>You must use Google Chrome version 31 or greater for Portable Native
441 Client. Please <a class="reference external" href="http://www.google.com/chrome/ ">upgrade now</a> if you are 448 Client. Find your version of chrome by opening <code>about:chrome</code>, and <a class="reference external" href="http://www.google.com/chrome/">update
442 not. If you&#8217;re already using a recent version, open <code>about:component s</code> and 449 Chrome</a> if you are on an older version. If
443 &#8220;Check for update&#8221; for PNaCl. Find your version of chrome by opennin g 450 you&#8217;re already using a recent version, open <code>about:components</code> and &#8220;Check
444 <code>about:chrome</code>.</li> 451 for update&#8221; for PNaCl. Note that on ChromeOS PNaCl is always up to date,
452 whereas on other operating systems it updates shortly after Chrome updates.</li>
445 <li>A PNaCl <code>.pexe</code> must be compiled with pepper_31 SDK or higher. <a class="reference internal" href="/native-client/sdk/download.html#updating-bund les"><em>Update 453 <li>A PNaCl <code>.pexe</code> must be compiled with pepper_31 SDK or higher. <a class="reference internal" href="/native-client/sdk/download.html#updating-bund les"><em>Update
446 your bundles</em></a> and make sure you&#8217;re using a version of 454 your bundles</em></a> and make sure you&#8217;re using a version of
447 Chrome that matches the SDK version.</li> 455 Chrome that matches the SDK version.</li>
448 <li>Your application can verify that Portable Native Client is supported 456 <li>Your application can verify that Portable Native Client is supported
449 in JavaScript with <code>navigator.mimeTypes['application/x-pnacl'] !== 457 in JavaScript with <code>navigator.mimeTypes['application/x-pnacl'] !==
450 undefined</code>. This is preferred over checking the Chrome version.</li> 458 undefined</code>. This is preferred over checking the Chrome version.</li>
451 </ul> 459 </ul>
452 <h3 id="my-nexe-files-never-finish-loading-what-gives">My <code>.nexe</code> fil es never finish loading. What gives?</h3> 460 <h3 id="my-nexe-files-never-finish-loading-what-gives">My <code>.nexe</code> fil es never finish loading. What gives?</h3>
453 <p>Here are ways to resolve some common problems that can prevent loading:</p> 461 <p>Here are ways to resolve some common problems that can prevent loading:</p>
454 <ul class="small-gap"> 462 <ul class="small-gap">
(...skipping 22 matching lines...) Expand all
477 you&#8217;re loading the correct <code>.nexe</code> file by building a separate 485 you&#8217;re loading the correct <code>.nexe</code> file by building a separate
478 <code>.nexe</code> for each architecture, and using a <code>.nmf</code> manifest file to 486 <code>.nexe</code> for each architecture, and using a <code>.nmf</code> manifest file to
479 let the browser select the correct <code>.nexe</code> file. Note: the need to 487 let the browser select the correct <code>.nexe</code> file. Note: the need to
480 select a processor-specific <code>.nexe</code> goes away with Portable Native 488 select a processor-specific <code>.nexe</code> goes away with Portable Native
481 Client.</li> 489 Client.</li>
482 <li>If things still aren&#8217;t working, <a class="reference internal" href="/n ative-client/help.html"><em>ask for help</em></a>!</li> 490 <li>If things still aren&#8217;t working, <a class="reference internal" href="/n ative-client/help.html"><em>ask for help</em></a>!</li>
483 </ul> 491 </ul>
484 </section> 492 </section>
485 493
486 {{/partials.standard_nacl_article}} 494 {{/partials.standard_nacl_article}}
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/doc_generated/sdk/examples.html » ('j') | native_client_sdk/src/doc/faq.rst » ('J')

Powered by Google App Engine
This is Rietveld 408576698