| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <!-- | 3 <!-- |
| 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
| 6 found in the LICENSE file. | 6 found in the LICENSE file. |
| 7 --> | 7 --> |
| 8 <head> | 8 <head> |
| 9 <meta http-equiv="Pragma" content="no-cache"> | 9 <meta http-equiv="Pragma" content="no-cache"> |
| 10 <meta http-equiv="Expires" content="-1"> | 10 <meta http-equiv="Expires" content="-1"> |
| 11 <title>{{title}}</title> | 11 <title>{{title}}</title> |
| 12 <script type="text/javascript" src="common.js"></script> | 12 <script type="text/javascript" src="common.js"></script> |
| 13 <script type="text/javascript" src="example.js"></script> | 13 <script type="text/javascript" src="example.js"></script> |
| 14 </head> | 14 </head> |
| 15 <body data-custom-load="true" {{attrs}}> | 15 <body data-custom-load="true" {{attrs}}> |
| 16 <h1>{{title}}</h1> | 16 <h1>{{title}}</h1> |
| 17 <h2>Status: <code id="statusField">NO-STATUS</code></h2> | 17 <h2>Status: <code id="statusField">NO-STATUS</code></h2> |
| 18 <p> | 18 <p> |
| 19 This example shows how you can use standard C library file and socket | 19 This example shows how you can use standard C library file and socket |
| 20 operation functions in Native Client using a library called nacl_io. | 20 operation functions in Native Client using a library called nacl_io. |
| 21 </p> | 21 </p> |
| 22 <p> | 22 <p> |
| 23 nacl_io provides a virtual filesystem. The filesystem can be "mounted" | 23 nacl_io provides a virtual filesystem. The filesystem can be "mounted" |
| 24 in a given directory tree. When you perform operations on files in those | 24 in a given directory tree. When you perform operations on files in those |
| 25 directories, the mount determines how those operations should be performed. | 25 directories, the mount determines how those operations should be performed. |
| 26 </p> | 26 </p> |
| 27 <p> | 27 <p> |
| 28 This example has four mounts by default. | 28 This example has five mounts by default. |
| 29 <ol> | 29 <ol> |
| 30 <li><i>/</i> the root of the filesystem. This is a memory mount, and | 30 <li><i>/</i> the root of the filesystem. This is a memory mount, and |
| 31 is non-persistent.</li> | 31 is non-persistent.</li> |
| 32 <li><i>/persistent</i> a persistent storage area. Any data written | 32 <li><i>/persistent</i> a persistent storage area. Any data written |
| 33 here can be read back after Chrome is restarted.</li> | 33 here can be read back after Chrome is restarted.</li> |
| 34 <li><i>/http</i> a mount that can read from a URL. Try reading from | 34 <li><i>/http</i> a mount that can read from a URL. Try reading from |
| 35 /http/index.html.</li> | 35 /http/index.html.</li> |
| 36 <li><i>/dev</i> a mount containing some utility files. /dev/null, | 36 <li><i>/dev</i> a mount containing some utility files. /dev/null, |
| 37 /dev/zero, etc.</li> | 37 /dev/zero, etc.</li> |
| 38 <li><i>/googledrive</i> a Google Drive mount. Before using, client ID |
| 39 and client secret, created from Google Developers Console, have to |
| 40 be filled in in example.js. When they have already been filled, |
| 41 use makefile on nacl_io_demo, and click on the sign-in button to |
| 42 expose Google Drive to nacl_io.</li> |
| 38 </ol> | 43 </ol> |
| 39 </p> | 44 </p> |
| 40 <p> | 45 <p> |
| 41 nacl_io also provides a (currently incomplete) posix socket api. Like the | 46 nacl_io also provides a (currently incomplete) posix socket api. Like the |
| 42 virtual filesystem, it is an abstraction layer on top of ppapi. To use this | 47 virtual filesystem, it is an abstraction layer on top of ppapi. To use this |
| 43 API, an app must be a packaged app with the appropriate socket permissions | 48 API, an app must be a packaged app with the appropriate socket permissions |
| 44 specified in the manifest file. | 49 specified in the manifest file. |
| 45 <hr> | 50 <hr> |
| 51 <p><b>Google account sign-in for Google Drive mount:</b></p> |
| 52 <button id="buttonsignin" onclick="buttonOnClick()">Sign in</button> |
| 53 <script> |
| 54 executeAfterGettingCode(); |
| 55 </script> |
| 56 <hr> |
| 46 <p><b>File Operations:</b></p> | 57 <p><b>File Operations:</b></p> |
| 47 <div> | 58 <div> |
| 48 <span> | 59 <span> |
| 49 <input type="radio" id="radiofopen" name="group" checked="checked">fopen | 60 <input type="radio" id="radiofopen" name="group" checked="checked">fopen |
| 50 <input type="radio" id="radiofclose" name="group">fclose | 61 <input type="radio" id="radiofclose" name="group">fclose |
| 51 <input type="radio" id="radiofread" name="group">fread | 62 <input type="radio" id="radiofread" name="group">fread |
| 52 <input type="radio" id="radiofwrite" name="group">fwrite | 63 <input type="radio" id="radiofwrite" name="group">fwrite |
| 53 <input type="radio" id="radiofseek" name="group">fseek | 64 <input type="radio" id="radiofseek" name="group">fseek |
| 54 <input type="radio" id="radiofflush" name="group">fflush | 65 <input type="radio" id="radiofflush" name="group">fflush |
| 55 <input type="radio" id="radiostat" name="group">stat | 66 <input type="radio" id="radiostat" name="group">stat |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 <input type="text" id="pipe_input_box"></p> | 264 <input type="text" id="pipe_input_box"></p> |
| 254 <p>Any output from the pipe will be printed below: <textarea id="pipe_output">
</textarea></p> | 265 <p>Any output from the pipe will be printed below: <textarea id="pipe_output">
</textarea></p> |
| 255 <hr> | 266 <hr> |
| 256 <p><b>Log:</b></p> | 267 <p><b>Log:</b></p> |
| 257 <pre id="log" style="font-weight: bold"></pre> | 268 <pre id="log" style="font-weight: bold"></pre> |
| 258 <!-- The NaCl plugin will be embedded inside the element with id "listener". | 269 <!-- The NaCl plugin will be embedded inside the element with id "listener". |
| 259 See common.js.--> | 270 See common.js.--> |
| 260 <div id="listener"></div> | 271 <div id="listener"></div> |
| 261 </body> | 272 </body> |
| 262 </html> | 273 </html> |
| OLD | NEW |