OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="technical-overview"> | 3 <section id="technical-overview"> |
4 <span id="overview"></span><h1 id="technical-overview"><span id="overview"></spa
n>Technical Overview</h1> | 4 <span id="overview"></span><h1 id="technical-overview"><span id="overview"></spa
n>Technical Overview</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><a class="reference internal" href="#introduction" id="id2">Introduction</a>
</li> | 7 <li><a class="reference internal" href="#why-use-native-client" id="id9">Why use
Native Client?</a></li> |
8 <li><a class="reference internal" href="#why-use-native-client" id="id3">Why use
Native Client?</a></li> | 8 <li><a class="reference internal" href="#benefits-of-native-client" id="id10">Be
nefits of Native Client</a></li> |
9 <li><a class="reference internal" href="#common-use-cases" id="id4">Common use c
ases</a></li> | 9 <li><a class="reference internal" href="#common-use-cases" id="id11">Common use
cases</a></li> |
10 <li><p class="first"><a class="reference internal" href="#how-native-client-work
s" id="id5">How Native Client works</a></p> | 10 <li><p class="first"><a class="reference internal" href="#how-native-client-work
s" id="id12">How Native Client works</a></p> |
11 <ul class="small-gap"> | 11 <ul class="small-gap"> |
12 <li><a class="reference internal" href="#security" id="id6">Security</a></li> | 12 <li><a class="reference internal" href="#toolchains" id="id13">Toolchains</a></l
i> |
13 <li><a class="reference internal" href="#portability" id="id7">Portability</a></
li> | 13 <li><a class="reference internal" href="#security" id="id14">Security</a></li> |
14 <li><a class="reference internal" href="#toolchains" id="id8">Toolchains</a></li
> | 14 <li><a class="reference internal" href="#portability" id="id15">Portability</a><
/li> |
15 </ul> | 15 </ul> |
16 </li> | 16 </li> |
17 <li><p class="first"><a class="reference internal" href="#native-client-in-a-web
-application" id="id9">Native Client in a web application</a></p> | 17 <li><p class="first"><a class="reference internal" href="#structure-of-a-web-app
lication" id="id16">Structure of a web application</a></p> |
18 <ul class="small-gap"> | 18 <ul class="small-gap"> |
19 <li><a class="reference internal" href="#pepper-plugin-api" id="id10">Pepper Plu
gin API</a></li> | 19 <li><a class="reference internal" href="#pepper-plug-in-api" id="id17">Pepper pl
ug-in API</a></li> |
20 </ul> | 20 </ul> |
21 </li> | 21 </li> |
22 <li><a class="reference internal" href="#versioning" id="id11">Versioning</a></l
i> | 22 <li><a class="reference internal" href="#versioning" id="id18">Versioning</a></l
i> |
23 <li><a class="reference internal" href="#where-to-start" id="id12">Where to star
t</a></li> | 23 <li><a class="reference internal" href="#where-to-start" id="id19">Where to star
t</a></li> |
24 </ul> | 24 </ul> |
25 | 25 |
26 </div><h2 id="introduction">Introduction</h2> | 26 </div><p><strong>Native Client</strong> (NaCl) is an open-source technology for
running native |
27 <p><strong>Native Client</strong> (NaCl) is an open-source technology for runnin
g native | |
28 compiled code in the browser, with the goal of maintaining the portability | 27 compiled code in the browser, with the goal of maintaining the portability |
29 and safety that users expect from web applications. Native Client expands web | 28 and safety that users expect from web applications. Native Client expands web |
30 programming beyond JavaScript, enabling developers to enhance their web | 29 programming beyond JavaScript, enabling you to enhance your web applications |
31 applications using their preferred language. This document describes some of | 30 using your preferred language. This document describes some of the key benefits |
32 the key benefits and common use cases of Native Client.</p> | 31 and common use cases of Native Client.</p> |
33 <p>Google has implemented the open-source <a class="reference external" href="ht
tp://www.chromium.org/nativeclient">Native Client project</a> in the Chrome brow
ser on Windows, Mac, | 32 <p>Google has implemented the open-source <a class="reference external" href="ht
tp://www.chromium.org/nativeclient">Native Client project</a> in the Chrome brow
ser on Windows, Mac, |
34 Linux, and Chrome OS. The <a class="reference internal" href="/native-client/sdk
/download.html"><em>Native Client Software Development Kit (SDK)</em></a>, itsel
f an open-source project, lets developers create web | 33 Linux, and Chrome OS. The <a class="reference internal" href="/native-client/sdk
/download.html"><em>Native Client Software Development Kit (SDK)</em></a>, itsel
f an open-source project, lets you create web applications |
35 applications that use NaCl and run in Chrome across multiple platforms.</p> | 34 that use NaCl and run in Chrome across multiple platforms.</p> |
36 <p>A web application that uses Native Client generally consists of a combination
of | 35 <p>A Native Client web application consists of JavaScript, HTML, CSS, and a NaCl |
37 JavaScript, HTML, CSS, and a NaCl module that is written in a language supported | 36 module written in a language supported by the SDK. The NaCl SDK currently |
38 by the SDK. The NaCl SDK currently supports C and C++; as compilers for | 37 supports C and C++; as compilers for additional languages are developed, the SDK |
39 additional languages are developed, the SDK will be updated to support those | 38 will be updated.</p> |
40 languages as well.</p> | 39 <div class="figure"> |
41 <img alt="/native-client/images/web-app-with-nacl.png" src="/native-client/image
s/web-app-with-nacl.png" /> | 40 <img alt="A web application with and without Native Client" src="/native-client/
images/web-app-with-nacl.png" /> |
42 <h2 id="why-use-native-client">Why use Native Client?</h2> | 41 <p class="caption">A web application with and without Native Client</p> |
| 42 </div> |
| 43 <p>Native Client comes in two flavors: traditional (NaCl) and portable (PNaCl). |
| 44 Traditional, which must be distributed through the Chrome Web Store lets you |
| 45 target a specific hardware platform. Portable can run on the open web. A |
| 46 bitcode file that can be loaded from any web server is downloaded to a client |
| 47 machine and converted to hardware-specific code before any execution. For |
| 48 details, see <a class="reference internal" href="/native-client/nacl-and-pnacl.h
tml"><em>NaCl and PNaCl</em></a>.</p> |
| 49 <h2 id="why-use-native-client"><span id="id1"></span>Why use Native Client?</h2> |
43 <p>Native Client open-source technology is designed to run compiled code | 50 <p>Native Client open-source technology is designed to run compiled code |
44 securely inside a browser at near-native speeds. Native Client puts web | 51 securely inside a browser at near-native speeds. Native Client gives web |
45 applications on the same playing field as desktop software—it provides the | 52 applications some advantages of desktop software. Specifically, it provides the |
46 means to fully harness the client’s computational resources for applicatio
ns | 53 means to fully harness the client’s computational resources for applicatio
ns |
47 such as 3D games, multimedia editors, CAD modeling, | 54 such as:</p> |
48 client-side data analytics, and interactive simulations. | 55 <ul class="small-gap"> |
49 Native Client also aims to give C and C++ (and eventually other languages) the | 56 <li>3D games</li> |
50 same level of portability and safety that JavaScript provides on the web today.<
/p> | 57 <li>multimedia editors</li> |
51 <p>Important benefits of Native Client include:</p> | 58 <li>CAD modeling</li> |
| 59 <li>client-side data analytics</li> |
| 60 <li>interactive simulations.</li> |
| 61 </ul> |
| 62 <p>Native Client gives C and C++ (and other languages targeting it) the same lev
el |
| 63 of portability and safety as JavaScript.</p> |
| 64 <h2 id="benefits-of-native-client"><span id="id2"></span>Benefits of Native Clie
nt</h2> |
| 65 <p>Benefits of Native Client include:</p> |
52 <ul class="small-gap"> | 66 <ul class="small-gap"> |
53 <li><strong>Graphics, audio, and much more:</strong> Running native code modules
that render 2D | 67 <li><strong>Graphics, audio, and much more:</strong> Running native code modules
that render 2D |
54 and 3D graphics, play audio, respond to mouse and keyboard events, run on | 68 and 3D graphics, play audio, respond to mouse and keyboard events, run on |
55 multiple threads, and access memory directly—all without requiring | 69 multiple threads, and access memory directly—all without requiring the use
r |
56 the user to install a plugin.</li> | 70 to install a plug-in.</li> |
57 <li><strong>Portability:</strong> Writing your applications once and running the
m on operating | 71 <li><strong>Portability:</strong> Writing your applications once and running the
m on multiple |
58 systems (Windows, Linux, Mac, and Chrome OS) and CPU architectures (x86 and | 72 operating systems (Windows, Linux, Mac, and Chrome OS) and CPU architectures |
59 ARM).</li> | 73 (x86 and ARM).</li> |
60 <li><strong>Easy migration path to the web:</strong> Leveraging years of work in
existing | 74 <li><strong>Easy migration path to the web:</strong> Leveraging years of work in
existing |
61 desktop applications. Native Client makes the transition from the desktop to a | 75 desktop applications. Native Client makes the transition from the desktop to |
62 web application significantly easier because it supports C and C++.</li> | 76 a web application significantly easier because it supports C and C++.</li> |
63 <li><strong>Security:</strong> Protecting the user’s system from malicious
or buggy | 77 <li><strong>Security:</strong> Protecting the user’s system from malicious
or buggy |
64 applications through Native Client’s double sandbox model. This model offe
rs | 78 applications through Native Client’s double sandbox model. This model offe
rs |
65 the safety of traditional web applications without sacrificing performance and | 79 the safety of traditional web applications without sacrificing performance |
66 without requiring users to install a plugin.</li> | 80 and without requiring users to install a plug-in.</li> |
67 <li><strong>Performance:</strong> Running at speeds comparable to desktop applic
ations (within | 81 <li><strong>Performance:</strong> Running at speeds within 5% to 15% of a native
desktop |
68 5-15% of native speed). Native Client also allows applications to harness all | 82 application. Native Client also allows applications to harness all available |
69 available CPU cores via a threading API; this enables demanding applications | 83 CPU cores via a threading API. This enables demanding applications such as |
70 such as console-quality games to run inside the browser.</li> | 84 console-quality games to run inside the browser.</li> |
71 </ul> | 85 </ul> |
72 <h2 id="common-use-cases">Common use cases</h2> | 86 <h2 id="common-use-cases"><span id="id3"></span>Common use cases</h2> |
73 <p>Typical use cases for Native Client include the following:</p> | 87 <p>Typical use cases for Native Client include the following:</p> |
74 <ul class="small-gap"> | 88 <ul class="small-gap"> |
75 <li><strong>Existing software components:</strong> With support for C and C++, N
ative | 89 <li><strong>Existing software components:</strong> Native Client lets you repurp
ose existing |
76 Client lets you to reuse existing software modules in web applications. You | 90 C and C++ software in web applications. You don’t need to rewrite and debu
g |
77 don’t need to rewrite and debug code that already works.</li> | 91 code that already works. It also lets your application take advantage of |
| 92 things the browser does well such as handling user interaction and processing |
| 93 events. You can also take advantage of the latest developments in HTML5.</li> |
78 <li><strong>Legacy desktop applications:</strong> Native Client provides a smoot
h migration | 94 <li><strong>Legacy desktop applications:</strong> Native Client provides a smoot
h migration |
79 path from desktop applications to the web. You can port and recompile existing | 95 path from desktop applications to the web. You can port and recompile existing |
80 code for the computation engine of your application directly to Native Client, | 96 code for the computation engine of your application directly to Native Client, |
81 and need rebuild only the user interface and event handling portions for the | 97 and need rebuild only the user interface and event handling portions for the |
82 browser.</li> | 98 browser.</li> |
83 <li><strong>Heavy computation in enterprise applications:</strong> Native Client
can handle the | 99 <li><strong>Heavy computation in enterprise applications:</strong> Native Client
can handle the |
84 number crunching required by large-scale enterprise applications. To ensure | 100 number crunching required by large-scale enterprise applications. To ensure |
85 protection of user data, Native Client enables you to build complex | 101 protection of user data, Native Client lets you run complex cryptographic |
86 cryptographic algorithms directly into the browser so that unencrypted data | 102 algorithms directly in the browser so that unencrypted data never goes out |
87 never goes out over the network.</li> | 103 over the network.</li> |
88 <li><strong>Multimedia applications:</strong> Codecs for processing sounds, imag
es, and movies | 104 <li><strong>Multimedia applications:</strong> Codecs for processing sounds, imag
es, and movies |
89 can be added to the browser in a Native Client module.</li> | 105 can be added to the browser in a Native Client module.</li> |
90 <li><strong>Games:</strong> Native Client lets web applications run at close to
native | 106 <li><strong>Games:</strong> Native Client lets web applications run at close to
native |
91 speed, reuse existing multithreaded/multicore C/C++ code bases, and | 107 speed, reuse existing multithreaded/multicore C/C++ code bases, and |
92 access low-latency audio, networking APIs, and OpenGL ES with programmable | 108 access low-latency audio, networking APIs, and OpenGL ES with programmable |
93 shaders. Native Client is a natural fit for running a physics engine or | 109 shaders. Native Client is a natural fit for running a physics engine or |
94 artificial intelligence module that powers a sophisticated web game. | 110 artificial intelligence module that powers a sophisticated web game. |
95 Native Client also enables applications to run unchanged across | 111 Native Client also enables applications to run unchanged across |
96 many platforms.</li> | 112 many platforms.</li> |
97 <li><strong>Any application that requires acceleration</strong>: Native Client f
its seamlessly | 113 <li><strong>Any application that requires acceleration:</strong> Native Client f
its seamlessly |
98 into web applications—it’s up to you to decide to what extent to use
it. | 114 into web applications. It’s up to you to decide to what extent to use it. |
99 Use of Native Client covers the full spectrum from complete applications to | 115 Use of Native Client covers the full spectrum from complete applications to |
100 small optimized routines that accelerate vital parts of web applications.</li> | 116 small optimized routines that accelerate vital parts of web applications.</li> |
101 </ul> | 117 </ul> |
102 <h2 id="how-native-client-works"><span id="link-how-nacl-works"></span>How Nativ
e Client works</h2> | 118 <h2 id="how-native-client-works"><span id="link-how-nacl-works"></span>How Nativ
e Client works</h2> |
103 <p>Native Client is an umbrella name for a set of related software components th
at | 119 <p>Native Client is an umbrella name for a set of related software components fo
r |
104 provide a way to develop C/C++ applications and run them securely on the web.</p
> | 120 developing C/C++ applications and running them securely on the web. At a high |
105 <p>At a high level, Native Client consists of:</p> | 121 level, Native Client consists of:</p> |
106 <ul class="small-gap"> | 122 <ul class="small-gap"> |
107 <li><strong>Toolchains</strong>: Collections of development tools (compilers, li
nkers, etc.) | 123 <li><strong>Toolchains:</strong> collections of development tools (compilers, li
nkers, etc.) |
108 that transform C/C++ code to Native Client modules.</li> | 124 that transform C/C++ code to Portable Native Client modules or Native Client |
109 <li><strong>Runtime components</strong>: components embedded in the browser or o
ther | 125 modules.</li> |
110 host platforms that allow execution of Native Client modules | 126 <li><strong>Runtime components:</strong> components embedded in the browser or o
ther host |
111 securely and efficiently.</li> | 127 platforms that allow execution of Native Client modules securely and |
| 128 efficiently.</li> |
112 </ul> | 129 </ul> |
113 <p>The following diagram shows how these components interact:</p> | 130 <p>The following diagram shows how these components interact:</p> |
114 <img alt="/native-client/images/nacl-pnacl-component-diagram.png" src="/native-c
lient/images/nacl-pnacl-component-diagram.png" /> | 131 <div class="figure"> |
115 <p>The left side of the diagram shows how to use Portable Native Client | 132 <img alt="The Native Client toolchains and their outputs" src="/native-client/im
ages/nacl-pnacl-component-diagram.png" /> |
116 (PNaCl, pronounced “pinnacle”). Developers use the PNaCl toolchain | 133 <p class="caption">The Native Client toolchains and their outputs</p> |
117 to produce a single, portable (<strong>pexe</strong>) module. At runtime, a tran
slator | 134 </div> |
118 built into the browser translates the pexe into native code for the | 135 <h3 id="toolchains"><span id="id4"></span>Toolchains</h3> |
119 relevant client architecture. Translation occurs before any code is executed.</p
> | 136 <p>A Native Client toolchain consists of a compiler, a linker, an assembler and |
120 <p>The right side of the diagram shows how to use (non-portable) Native Client. | 137 other tools that are used to convert C/C++ source code into a module that is |
121 Developers use a nacl-gcc based toolchain to produce multiple | 138 loadable by a browser.</p> |
122 architecture-dependent (<strong>nexe</strong>) modules, which are packaged into
an | 139 <p>The Native Client SDK provides two toolchains:</p> |
123 application. At runtime, the browser decides which nexe to load based | 140 <ul class="small-gap"> |
124 on the architecture of the client machine.</p> | 141 <li>The left side of the diagram shows <strong>Portable Native Client</strong> (
PNaCl, |
125 <h3 id="security">Security</h3> | 142 pronounced “pinnacle”). An LLVM based toolchain produces a single, p
ortable |
| 143 (<strong>pexe</strong>) module. At runtime an ahead-of-time (AOT) translator, bu
ilt into |
| 144 the browser, translates the pexe into native code for the relevant client |
| 145 architecture.</li> |
| 146 <li>The right side of the diagram shows <strong>(non-portable) Native Client</st
rong>. A GCC |
| 147 based toolchain produces multiple architecture-dependent (<strong>nexe</strong>)
modules, |
| 148 which are packaged into an application. At runtime the browser determines |
| 149 which nexe to load based on the architecture of the client machine.</li> |
| 150 </ul> |
| 151 <p>The PNaCl toolchain is recommended for most applications. The NaCl-GCC |
| 152 toolchain should only be used for applications that won’t be distributed o
n the |
| 153 open web.</p> |
| 154 <h3 id="security"><span id="id5"></span>Security</h3> |
126 <p>Since Native Client permits the execution of native code on client machines, | 155 <p>Since Native Client permits the execution of native code on client machines, |
127 special security measures have to be implemented:</p> | 156 special security measures have to be implemented:</p> |
128 <ul class="small-gap"> | 157 <ul class="small-gap"> |
129 <li>The NaCl sandbox ensures that code accesses system resources only through | 158 <li>The NaCl sandbox ensures that code accesses system resources only through |
130 safe, whitelisted APIs, and operates within its limits without attempting to | 159 safe, whitelisted APIs, and operates within its limits without attempting to |
131 interfere with other code running either within the browser or outside it.</li> | 160 interfere with other code running either within the browser or outside it.</li> |
132 <li>The NaCl validator statically analyzes code prior to running it | 161 <li>The NaCl validator statically analyzes code before running it to make sure i
t |
133 to make sure it only uses code and data patterns that are permitted and safe.</l
i> | 162 only uses code and data patterns that are permitted and safe.</li> |
134 </ul> | 163 </ul> |
135 <p>The above security measures are in addition to the existing sandbox in the | 164 <p>These security measures are in addition to the existing sandbox in the |
136 Chrome browser—the Native Client module always executes in a process with | 165 Chrome browser. The Native Client module always executes in a process with |
137 restricted permissions. The only interaction between this process and the | 166 restricted permissions. The only interaction between this process and the |
138 outside world is through sanctioned browser interfaces. Because of the | 167 outside world is through defined browser interfaces. Because of the |
139 combination of the NaCl sandbox and the Chrome sandbox, we say that | 168 combination of the NaCl sandbox and the Chrome sandbox, we say that |
140 Native Client employs a double sandbox design.</p> | 169 Native Client employs a <strong>double sandbox</strong> design.</p> |
141 <h3 id="portability">Portability</h3> | 170 <h3 id="portability"><span id="id6"></span>Portability</h3> |
142 <p>Portable Native Client (PNaCl, prounounced “pinnacle”) employs st
ate-of-the-art | 171 <p>Portable Native Client (PNaCl, prounounced “pinnacle”) employs st
ate-of-the-art |
143 compiler technology to compile C/C++ source code to a portable bitcode | 172 compiler technology to compile C/C++ source code to a portable bitcode |
144 executable (<strong>pexe</strong>). PNaCl bitcode is an OS- and architecture-ind
ependent | 173 executable (<strong>pexe</strong>). PNaCl bitcode is an OS- and architecture-ind
ependent |
145 format that can be freely distributed on the web and <a class="reference interna
l" href="#link-nacl-in-web-apps"><em>embedded in web | 174 format that can be freely distributed on the web and <a class="reference interna
l" href="#link-nacl-in-web-apps"><em>embedded in web |
146 applications</em></a>.</p> | 175 applications</em></a>.</p> |
147 <p>The PNaCl translator is a component embedded in the Chrome browser; its task
is | 176 <p>The PNaCl translator is a component embedded in the Chrome browser; its task
is |
148 to run pexe modules. Internally, the translator compiles a pexe to a nexe | 177 to run pexe modules. Internally, the translator compiles a pexe to a nexe |
149 (a native executable for the client platform’s architecture), and then exe
cutes | 178 (described above), and then executes the nexe within the Native Client sandbox |
150 the nexe within the Native Client sandbox as described above. It also uses | 179 as described above. The translator uses intelligent caching to avoid |
151 intelligent caching to avoid re-compiling the pexe if it was previously compiled | 180 re-compiling the pexe if it was previously compiled on the client’s browse
r.</p> |
152 on the client’s browser.</p> | |
153 <p>Native Client also supports the execution of nexe modules directly in the | 181 <p>Native Client also supports the execution of nexe modules directly in the |
154 browser. However, since nexes contain architecture-specific machine code, | 182 browser. However, since nexes contain architecture-specific machine code, they |
155 they are not allowed to be distributed on the open web—they can only be | 183 are not allowed to be distributed on the open web. They can only be used as part |
156 used as part of applications and extensions that are installed from the | 184 of applications and extensions that are installed from the Chrome Web Store.</p> |
157 Chrome Web Store.</p> | |
158 <p>For more details on the difference between NaCl and PNaCl, see | 185 <p>For more details on the difference between NaCl and PNaCl, see |
159 <a class="reference internal" href="/native-client/nacl-and-pnacl.html"><em>NaCl
and PNaCl</em></a>.</p> | 186 <a class="reference internal" href="/native-client/nacl-and-pnacl.html"><em>NaCl
and PNaCl</em></a>.</p> |
160 <h3 id="toolchains"><span id="id1"></span>Toolchains</h3> | 187 <h2 id="structure-of-a-web-application"><span id="link-nacl-in-web-apps"></span>
Structure of a web application</h2> |
161 <p>A toolchain is a set of tools used to create an application from a set of | |
162 source files. In the case of Native Client, a toolchain consists of a compiler, | |
163 linker, assembler and other tools that are used to convert an | |
164 application written in C/C++ into a module that is loadable by the browser.</p> | |
165 <p>The Native Client SDK provides two toolchains:</p> | |
166 <ul class="small-gap"> | |
167 <li>a <strong>PNaCl toolchain</strong> for generating portable NaCl modules (pex
e files)</li> | |
168 <li>a <strong>gcc-based toolchain (nacl-gcc)</strong> for generating non-portabl
e NaCl modules | |
169 (nexe files)</li> | |
170 </ul> | |
171 <p>The PNaCl toolchain is recommended for most applications. The nacl-gcc | |
172 toolchain should only be used for applications that will not be distributed | |
173 on the open web.</p> | |
174 <h2 id="native-client-in-a-web-application"><span id="link-nacl-in-web-apps"></s
pan>Native Client in a web application</h2> | |
175 <p id="application-files">A Native Client application consists of a set of files
:</p> | 188 <p id="application-files">A Native Client application consists of a set of files
:</p> |
176 <ul class="small-gap"> | 189 <ul class="small-gap"> |
177 <li><strong>HTML</strong>, <strong>CSS</strong>, and <strong>JavaScript</strong>
files, as in any modern web | 190 <li><p class="first"><strong>HTML and CSS:</strong> The HTML file tells the brow
ser where to find the manifest |
178 application. The JavaScript code is responsible for communicating with the | 191 (nmf file) through the embed tag.</p> |
179 NaCl module.</li> | 192 <pre class="prettyprint"> |
180 <li>A <strong>pexe</strong> (portable NaCl) file. This module uses the <a class=
"reference internal" href="#link-pepper"><em>Pepper</em></a> API, which provides
the bridge to JavaScript and | 193 <embed name="mygame" src="mygame.nmf" type="applicat
ion/x-pnacl" /> |
181 browser resources.</li> | 194 </pre> |
182 <li>A Native Client <strong>manifest</strong> file that specifies the pexe to lo
ad, along with | 195 </li> |
183 some loading options. This manifest file is embedded into the HTML page | 196 <li><p class="first"><strong>Manifest:</strong> The manifest identifies the modu
le to load and specifies |
184 through an <code><embed></code> tag, as shown in the figure below.</li> | 197 options. For example, “mygame.nmf” might look like this:</p> |
| 198 <pre class="prettyprint"> |
| 199 {... |
| 200 ... |
| 201 "url": "mygame.pexe", |
| 202 } |
| 203 </pre> |
| 204 </li> |
| 205 <li><strong>pexe (portable NaCl file):</strong> A compiled Native Client module.
It uses the |
| 206 <a class="reference internal" href="#link-pepper"><em>Pepper API</em></a>, which
provides a bridge to JavaScript and |
| 207 other browser resources.</li> |
185 </ul> | 208 </ul> |
186 <img alt="/native-client/images/nacl-in-a-web-app.png" src="/native-client/image
s/nacl-in-a-web-app.png" /> | 209 <div class="figure"> |
| 210 <img alt="Structure of a web application" src="/native-client/images/nacl-in-a-w
eb-app.png" /> |
| 211 <p class="caption">Structure of a web application</p> |
| 212 </div> |
187 <p>For more details, see <a class="reference internal" href="/native-client/devg
uide/coding/application-structure.html"><em>Application Structure</em></a>.</p> | 213 <p>For more details, see <a class="reference internal" href="/native-client/devg
uide/coding/application-structure.html"><em>Application Structure</em></a>.</p> |
188 <h3 id="pepper-plugin-api"><span id="link-pepper"></span>Pepper Plugin API</h3> | 214 <h3 id="pepper-plug-in-api"><span id="link-pepper"></span>Pepper plug-in API</h3
> |
189 <p>The Pepper Plugin API (PPAPI), called <strong>Pepper</strong> for convenience
, is an | 215 <p>The Pepper plug-in API (PPAPI), called <strong>Pepper</strong> for convenienc
e, is an |
190 open-source, cross-platform C/C++ API for web browser plugins. From the point | 216 open-source, cross-platform C/C++ API for web browser plug-ins. Pepper allows a |
191 of view of Native Client, Pepper allows a C/C++ module to communicate with | 217 C/C++ module to communicate with the hosting browser and to access system-level |
192 the hosting browser and get access to system-level functions in a safe and | 218 functions in a safe and portable way. One of the security constraints in Native |
193 portable way. One of the security constraints in Native Client is that modules | 219 Client is that modules cannot make OS-level calls. Pepper provides analogous |
194 cannot make any OS-level calls directly. Pepper provides analogous APIs that | 220 APIs that modules can use instead.</p> |
195 modules can target instead.</p> | |
196 <p>You can use the Pepper APIs to gain access to the full array of browser | 221 <p>You can use the Pepper APIs to gain access to the full array of browser |
197 capabilities, including:</p> | 222 capabilities, including:</p> |
198 <ul class="small-gap"> | 223 <ul class="small-gap"> |
199 <li><a class="reference internal" href="/native-client/devguide/coding/message-s
ystem.html"><em>Talking to the JavaScript code in your application</em></a> from
the C++ code in your NaCl module.</li> | 224 <li><a class="reference internal" href="/native-client/devguide/coding/message-s
ystem.html"><em>Talking to the JavaScript code in your application</em></a> from
the C++ code in your NaCl module.</li> |
200 <li><a class="reference internal" href="/native-client/devguide/coding/file-io.h
tml"><em>Doing file I/O</em></a>.</li> | 225 <li><a class="reference internal" href="/native-client/devguide/coding/file-io.h
tml"><em>Doing file I/O</em></a>.</li> |
201 <li><a class="reference internal" href="/native-client/devguide/coding/audio.htm
l"><em>Playing audio</em></a>.</li> | 226 <li><a class="reference internal" href="/native-client/devguide/coding/audio.htm
l"><em>Playing audio</em></a>.</li> |
202 <li><a class="reference internal" href="/native-client/devguide/coding/3D-graphi
cs.html"><em>Rendering 3D graphics</em></a>.</li> | 227 <li><a class="reference internal" href="/native-client/devguide/coding/3D-graphi
cs.html"><em>Rendering 3D graphics</em></a>.</li> |
203 </ul> | 228 </ul> |
204 <p>Pepper includes both a C API and a C++ API. The C++ API is a set of bindings | 229 <p>Pepper includes both a <a class="reference internal" href="/native-client/c-a
pi.html"><em>C API</em></a> and a <a class="reference internal" href="/native-cl
ient/cpp-api.html"><em>C++ API</em></a>. |
205 written on top of the C API. For additional information about Pepper, see | 230 The C++ API is a set of bindings written on top of the C API. For additional |
206 <a class="reference external" href="http://code.google.com/p/ppapi/wiki/Concepts
">Pepper Concepts</a>.</p> | 231 information about Pepper, see <a class="reference external" href="http://code.go
ogle.com/p/ppapi/wiki/Concepts">Pepper Concepts</a>.</p> |
207 <h2 id="versioning">Versioning</h2> | 232 <h2 id="versioning"><span id="id7"></span>Versioning</h2> |
208 <p>Chrome is released on a six week cycle, and developer versions of Chrome are | 233 <p>Chrome is released on a six week cycle, and developer versions of Chrome are |
209 pushed to the public beta channel three weeks before each release. As with any | 234 pushed to the public beta channel three weeks before each release. As with any |
210 software, each release of Chrome may include changes to Native Client and the | 235 software, each release of Chrome may include changes to Native Client and the |
211 Pepper interfaces that may require modification to existing applications. | 236 Pepper interfaces that may require modification to existing applications. |
212 However, modules compiled for one version of Pepper/Chrome should work with | 237 However, modules compiled for one version of Pepper/Chrome should work with |
213 subsequent versions of Pepper/Chrome. The SDK includes multiple versions of the | 238 subsequent versions of Pepper/Chrome. The SDK includes multiple versions of the |
214 Pepper APIs to help developers make adjustments to API changes and take | 239 Pepper APIs to help you make adjustments to API changes and take |
215 advantage of new features: <a class="reference external" href="/native-client/pe
pper_stable">stable</a>, <a class="reference external" href="/native-client/pepp
er_beta">beta</a> and <a class="reference external" href="/native-client/pepper_
dev">dev</a>.</p> | 240 advantage of new features: <a class="reference external" href="/native-client/pe
pper_stable">stable</a>, <a class="reference external" href="/native-client/pepp
er_beta">beta</a> and <a class="reference external" href="/native-client/pepper_
dev">dev</a>.</p> |
216 <h2 id="where-to-start">Where to start</h2> | 241 <h2 id="where-to-start"><span id="id8"></span>Where to start</h2> |
217 <p>The <a class="reference internal" href="/native-client/quick-start.html"><em>
Quick Start</em></a> document provides links to downloads and | 242 <p>The <a class="reference internal" href="/native-client/quick-start.html"><em>
Quick Start</em></a> document provides links to downloads and |
218 documentation that should help you get started with developing and distributing | 243 documentation to help you get started with developing and distributing Native |
219 Native Client applications.</p> | 244 Client applications.</p> |
220 </section> | 245 </section> |
221 | 246 |
222 {{/partials.standard_nacl_article}} | 247 {{/partials.standard_nacl_article}} |
OLD | NEW |