Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 ########################## | 1 ########################## |
| 2 Frequently Asked Questions | 2 Frequently Asked Questions |
| 3 ########################## | 3 ########################## |
| 4 | 4 |
| 5 .. contents:: | 5 .. contents:: |
| 6 :local: | 6 :local: |
| 7 :backlinks: none | 7 :backlinks: none |
| 8 :depth: 2 | 8 :depth: 2 |
| 9 | 9 |
| 10 This document answers some frequently asked questions about Native | 10 This document answers some frequently asked questions about Native |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 In most cases you won't have to rewrite much, if any, code. The Native | 486 In most cases you won't have to rewrite much, if any, code. The Native |
| 487 Client-specific tools, such as ``pnacl-clang++`` or ``x86_64-nacl-g++``, | 487 Client-specific tools, such as ``pnacl-clang++`` or ``x86_64-nacl-g++``, |
| 488 take care of most of the necessary changes. You may need to make some | 488 take care of most of the necessary changes. You may need to make some |
| 489 changes to your operating system calls and interactions with external | 489 changes to your operating system calls and interactions with external |
| 490 devices to work with the web. Porting existing Linux libraries is | 490 devices to work with the web. Porting existing Linux libraries is |
| 491 generally straightforward, with large libraries often requiring no | 491 generally straightforward, with large libraries often requiring no |
| 492 source change. | 492 source change. |
| 493 | 493 |
| 494 The following kinds of code may be more challenging to port: | 494 The following kinds of code may be more challenging to port: |
| 495 | 495 |
| 496 * Code that does direct TCP/IP or UDP networking. For security reasons | 496 * Code that does direct `TCP <pepper_stable/cpp/classpp_1_1_u_d_p_socket>`_ or |
| 497 these APIs are only available to packaged applications, not on the | 497 `UDP <pepper_stable/cpp/classpp_1_1_u_d_p_socket>`_ networking. For security |
| 498 open web, after asking for the appropriate permissions. Native Client | 498 reasons these APIs are only available to `packaged applications |
|
binji
2015/02/09 18:13:42
I believe these are just called Chrome Apps now. I
| |
| 499 is otherwise restricted to the networking APIs available in the | 499 </apps/about_apps>`_ after asking for the appropriate permissions, not on the |
| 500 browser. | 500 open web. Native Client is otherwise restricted to the networking APIs |
| 501 * Code that creates processes, including UNIX forks. Creating processes | 501 available in the browser. You may want to use to `nacl_io library <nacl_io>`_ |
| 502 is not supported for security reasons. However, threads are supported. | 502 to use POSIX-like sockets. |
| 503 * Code that needs to do local file I/O. Native Client is restricted to | 503 * Code that creates processes, including UNIX ``fork``, won't function |
| 504 accessing URLs and to local storage in the browser (the Pepper file I/O API | 504 as-is. However, threads are supported. You can nonetheless create new |
| 505 has access to the same per-application storage that JavaScript has via Local | 505 ``<embed>`` tags in your HTML page to launch new PNaCl processes, even using |
| 506 Storage). HTML5 File System can be used, among others. For POSIX compatabiliy | 506 new ``.pexe`` files that your existing ``.pexe`` saved in a local |
|
binji
2015/02/09 18:13:42
This sentence is clumsy. Split it into two sentenc
| |
| 507 the Native Client SDK includes a library called nacl_io which allows the | 507 filesystem. This is somewhat akin to ``execve``, but the process management |
| 508 application to interact with all these types of files via standard POSIX I/O | 508 has to go through ``postMessage`` to JavaScript in order to create the new |
| 509 functions (e.g. open/fopen/read/write/...). See :doc:`Using NaCl I/O | 509 ``<embed>``. |
| 510 <devguide/coding/nacl_io>` for more details. | 510 * Code that needs to do local file I/O. Native Client is restricted to accessing |
| 511 URLs and to local storage in the browser (the Pepper :doc:`File IO API | |
| 512 <devguide/coding/file-io>` has access to the same per-application storage that | |
| 513 JavaScript has via Local Storage). HTML5 File System can be used, among | |
| 514 others. For POSIX compatabiliy the Native Client SDK includes a library called | |
| 515 nacl_io which allows the application to interact with all these types of files | |
| 516 via standard POSIX I/O functions (e.g. ``open`` / ``fopen`` / ``read`` / | |
| 517 ``write`` / ...). See :doc:`Using NaCl I/O <devguide/coding/nacl_io>` for more | |
| 518 details. | |
| 511 | 519 |
| 512 .. _faq_troubleshooting: | 520 .. _faq_troubleshooting: |
| 513 | 521 |
| 514 Troubleshooting | 522 Troubleshooting |
| 515 =============== | 523 =============== |
| 516 | 524 |
| 517 My ``.pexe`` isn't loading, help! | 525 My ``.pexe`` isn't loading, help! |
| 518 --------------------------------- | 526 --------------------------------- |
| 519 | 527 |
| 520 * You must use Google Chrome version 31 or greater for Portable Native | 528 * You must use Google Chrome version 31 or greater for Portable Native |
| 521 Client. Please `upgrade now <http://www.google.com/chrome/>`_ if you are | 529 Client. Find your version of chrome by opening ``about:chrome``, and `update |
| 522 not. If you're already using a recent version, open ``about:components`` and | 530 Chrome <http://www.google.com/chrome/>`_ if you are on an older version. If |
| 523 "Check for update" for PNaCl. Find your version of chrome by openning | 531 you're already using a recent version, open ``about:components`` and "Check |
| 524 ``about:chrome``. | 532 for update" for PNaCl. Note that on ChromeOS PNaCl is always up to date, |
| 533 whereas on other operating systems it updates shortly after Chrome updates. | |
| 525 * A PNaCl ``.pexe`` must be compiled with pepper_31 SDK or higher. :ref:`Update | 534 * A PNaCl ``.pexe`` must be compiled with pepper_31 SDK or higher. :ref:`Update |
| 526 your bundles <updating-bundles>` and make sure you're using a version of | 535 your bundles <updating-bundles>` and make sure you're using a version of |
| 527 Chrome that matches the SDK version. | 536 Chrome that matches the SDK version. |
| 528 * Your application can verify that Portable Native Client is supported | 537 * Your application can verify that Portable Native Client is supported |
| 529 in JavaScript with ``navigator.mimeTypes['application/x-pnacl'] !== | 538 in JavaScript with ``navigator.mimeTypes['application/x-pnacl'] !== |
| 530 undefined``. This is preferred over checking the Chrome version. | 539 undefined``. This is preferred over checking the Chrome version. |
| 531 | 540 |
| 532 My ``.nexe`` files never finish loading. What gives? | 541 My ``.nexe`` files never finish loading. What gives? |
| 533 ---------------------------------------------------- | 542 ---------------------------------------------------- |
| 534 | 543 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 .. _Rust: http://www.rust-lang.org/ | 588 .. _Rust: http://www.rust-lang.org/ |
| 580 .. _Go: https://golang.org | 589 .. _Go: https://golang.org |
| 581 .. _native-client-discuss: https://groups.google.com/group/native-client-discuss | 590 .. _native-client-discuss: https://groups.google.com/group/native-client-discuss |
| 582 .. _deprecated in Chrome: http://blog.chromium.org/2013/09/saying-goodbye-to-our -old-friend-npapi.html | 591 .. _deprecated in Chrome: http://blog.chromium.org/2013/09/saying-goodbye-to-our -old-friend-npapi.html |
| 583 .. _OpenGL ES 2.0: https://www.khronos.org/opengles/ | 592 .. _OpenGL ES 2.0: https://www.khronos.org/opengles/ |
| 584 .. _GLES2 file: https://code.google.com/p/chromium/codesearch#chromium/src/ppapi /lib/gl/gles2/gles2.c | 593 .. _GLES2 file: https://code.google.com/p/chromium/codesearch#chromium/src/ppapi /lib/gl/gles2/gles2.c |
| 585 .. _Google Chrome privacy policy: https://www.google.com/chrome/intl/en/privacy. html | 594 .. _Google Chrome privacy policy: https://www.google.com/chrome/intl/en/privacy. html |
| 586 .. _Google Chrome Terms of Service: https://www.google.com/chrome/intl/en/eula_t ext.html | 595 .. _Google Chrome Terms of Service: https://www.google.com/chrome/intl/en/eula_t ext.html |
| 587 .. _naclports: https://code.google.com/p/naclports | 596 .. _naclports: https://code.google.com/p/naclports |
| 588 .. _CORS: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing | 597 .. _CORS: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing |
| OLD | NEW |