| OLD | NEW |
| 1 .. _message-system: | 1 .. _message-system: |
| 2 | 2 |
| 3 ################ | 3 ################ |
| 4 Messaging System | 4 Messaging System |
| 5 ################ | 5 ################ |
| 6 | 6 |
| 7 .. contents:: | 7 .. contents:: |
| 8 :local: | 8 :local: |
| 9 :backlinks: none | 9 :backlinks: none |
| 10 :depth: 2 | 10 :depth: 2 |
| 11 | 11 |
| 12 This chapter describes the messaging system used to communicate between the | 12 This section describes the messaging system used to communicate between the |
| 13 JavaScript code and the Native Client module's C or C++ code in a | 13 JavaScript code and the Native Client module's C or C++ code in a |
| 14 Native Client application. It introduces the concept of asynchronous | 14 Native Client application. It introduces the concept of asynchronous |
| 15 programming and the basic steps required to set up a Native Client module | 15 programming and the basic steps required to set up a Native Client module |
| 16 that sends messages to and receive messages from JavaScript. This chapter | 16 that sends messages to and receive messages from JavaScript. This section |
| 17 assumes you are familiar with the material presented in the | 17 assumes you are familiar with the material presented in the |
| 18 :doc:`Application Structure <application-structure>` chapter. | 18 :doc:`Application Structure <application-structure>` section. |
| 19 | 19 |
| 20 .. Note:: | 20 .. Note:: |
| 21 :class: note | 21 :class: note |
| 22 | 22 |
| 23 The "Hello, World" example for getting started with NaCl is used here to | 23 The "Hello, World" example for getting started with NaCl is used here to |
| 24 illustrate basic programming techniques. You can find this code in | 24 illustrate basic programming techniques. You can find this code in |
| 25 the ``/getting_started/part2`` directory in the Native Client SDK download. | 25 the ``/getting_started/part2`` directory in the Native Client SDK download. |
| 26 | 26 |
| 27 Reference information | 27 Reference information |
| 28 ===================== | 28 ===================== |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 virtual void HandleMessage(const pp::Var& var) { | 404 virtual void HandleMessage(const pp::Var& var) { |
| 405 if (var.is_dictionary()) { | 405 if (var.is_dictionary()) { |
| 406 pp::VarDictionary dictionary(var); | 406 pp::VarDictionary dictionary(var); |
| 407 // Use the dictionary | 407 // Use the dictionary |
| 408 pp::VarArray keys = dictionary.GetKeys(); | 408 pp::VarArray keys = dictionary.GetKeys(); |
| 409 // ... | 409 // ... |
| 410 } else { | 410 } else { |
| 411 // ... | 411 // ... |
| 412 } | 412 } |
| 413 } | 413 } |
| OLD | NEW |