OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 /* |
| 8 * Subclass of NaClDesc which passes write output data to the |
| 9 * JavaScript console using the reverse channel. |
| 10 */ |
| 11 |
| 12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_DESC_JSCONSOLE_H_ |
| 13 #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_NACL_DESC_JSCONSOLE_H_ |
| 14 |
| 15 #include "native_client/src/include/nacl_base.h" |
| 16 #include "native_client/src/include/portability.h" |
| 17 |
| 18 #include "native_client/src/trusted/desc/nacl_desc_base.h" |
| 19 |
| 20 EXTERN_C_BEGIN |
| 21 |
| 22 struct NaClDescEffector; |
| 23 struct NaClDescXferState; |
| 24 struct NaClMessageHeader; |
| 25 |
| 26 /* |
| 27 * A NaClDesc subclass that passes Write data to the browser via |
| 28 * postmessage. Objects of this class should be instantiated only if |
| 29 * the NaClApp object's reverse channel is available. |
| 30 * |
| 31 * This is a DEBUG interface to make it easier to determine the state |
| 32 * of a NaCl application. The interface is enabled only when a debug |
| 33 * environment variable is set. |
| 34 */ |
| 35 struct NaClDescPostMessage { |
| 36 struct NaClDesc base NACL_IS_REFCOUNT_SUBCLASS; |
| 37 |
| 38 /* |
| 39 * There is not much state associated with sending a write buffer to |
| 40 * the plugin via RPC -- just behavior changes in the virtual Write |
| 41 * function; all state is in the NaClApp object. it is assumed that |
| 42 * the lifetime of the pointed-to NaClApp object is at least that of |
| 43 * this NaClDescPostMessage object. |
| 44 */ |
| 45 struct NaClApp *nap; |
| 46 ssize_t error; |
| 47 }; |
| 48 |
| 49 int NaClDescPostMessageCtor(struct NaClDescPostMessage *self, |
| 50 struct NaClApp *nap); |
| 51 |
| 52 |
| 53 |
| 54 EXTERN_C_END |
| 55 |
| 56 #endif |
OLD | NEW |