OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="native-client-modules"> | 3 <section id="native-client-modules"> |
4 <span id="devcycle-native-client-modules"></span><h1 id="native-client-modules">
<span id="devcycle-native-client-modules"></span>Native Client Modules</h1> | 4 <span id="devcycle-native-client-modules"></span><h1 id="native-client-modules">
<span id="devcycle-native-client-modules"></span>Native Client Modules</h1> |
5 <p>This document describes the classes and functions that you need to implement
in | 5 <p>This document describes the classes and functions that you need to implement
in |
6 a Native Client module in order for Chrome to load, initialize, and run it. The | 6 a Native Client module in order for Chrome to load, initialize, and run it. The |
7 requirements are the same regardless of whether or not the module uses PNaCl, | 7 requirements are the same regardless of whether or not the module uses PNaCl, |
8 but depend on whether the module is written in C or C++.</p> | 8 but depend on whether the module is written in C or C++.</p> |
9 <div class="contents local topic" id="contents"> | 9 <div class="contents local" id="contents" style="display: none"> |
10 <ul class="small-gap"> | 10 <ul class="small-gap"> |
11 <li><a class="reference internal" href="#introduction" id="id2">Introduction</a>
</li> | 11 <li><a class="reference internal" href="#introduction" id="id2">Introduction</a>
</li> |
12 <li><a class="reference internal" href="#writing-modules-in-c" id="id3">Writing
modules in C</a></li> | 12 <li><a class="reference internal" href="#writing-modules-in-c" id="id3">Writing
modules in C</a></li> |
13 <li><a class="reference internal" href="#id1" id="id4">Writing modules in C++</a
></li> | 13 <li><a class="reference internal" href="#id1" id="id4">Writing modules in C++</a
></li> |
14 </ul> | 14 </ul> |
15 </div> | 15 |
16 <section id="introduction"> | 16 </div><section id="introduction"> |
17 <h2 id="introduction">Introduction</h2> | 17 <h2 id="introduction">Introduction</h2> |
18 <p>Native Client modules do not have a <code>main()</code> function. When a modu
le loads, | 18 <p>Native Client modules do not have a <code>main()</code> function. When a modu
le loads, |
19 the Native Client runtime calls the code in the module to create an instance and | 19 the Native Client runtime calls the code in the module to create an instance and |
20 initialize the interfaces for the APIs the module uses. This initialization | 20 initialize the interfaces for the APIs the module uses. This initialization |
21 sequence depends on whether the module is written in C or C++ and requires that | 21 sequence depends on whether the module is written in C or C++ and requires that |
22 you implement specific functions in each case.</p> | 22 you implement specific functions in each case.</p> |
23 </section><section id="writing-modules-in-c"> | 23 </section><section id="writing-modules-in-c"> |
24 <h2 id="writing-modules-in-c">Writing modules in C</h2> | 24 <h2 id="writing-modules-in-c">Writing modules in C</h2> |
25 <p>The C API uses a prefix convention to show whether an interface is implemente
d | 25 <p>The C API uses a prefix convention to show whether an interface is implemente
d |
26 in the browser or in a module. Interfaces starting with <code>PPB_</code> (which
can be | 26 in the browser or in a module. Interfaces starting with <code>PPB_</code> (which
can be |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 <a class="reference internal" href="/native-client/devguide/coding/message-syste
m.html"><em>Native Client messaging system</em></a> for more information about | 169 <a class="reference internal" href="/native-client/devguide/coding/message-syste
m.html"><em>Native Client messaging system</em></a> for more information about |
170 how to send messages between JavaScript code and Native Client modules.</p> | 170 how to send messages between JavaScript code and Native Client modules.</p> |
171 <p>While the <code>CreateModule()</code> factory function, the <code>Module</cod
e> class, and the | 171 <p>While the <code>CreateModule()</code> factory function, the <code>Module</cod
e> class, and the |
172 <code>Instance</code> class are required for a Native Client application, the co
de | 172 <code>Instance</code> class are required for a Native Client application, the co
de |
173 samples shown above don’t actually do anything. Subsequent documents in th
e | 173 samples shown above don’t actually do anything. Subsequent documents in th
e |
174 Developer’s Guide build on these code samples and add more interesting | 174 Developer’s Guide build on these code samples and add more interesting |
175 functionality.</p> | 175 functionality.</p> |
176 </section></section> | 176 </section></section> |
177 | 177 |
178 {{/partials.standard_nacl_article}} | 178 {{/partials.standard_nacl_article}} |
OLD | NEW |