OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Module "mojo/public/js/core" | 5 // Module "mojo/public/js/core" |
6 // | 6 // |
7 // Note: This file is for documentation purposes only. The code here is not | 7 // Note: This file is for documentation purposes only. The code here is not |
8 // actually executed. The real module is implemented natively in Mojo. | 8 // actually executed. The real module is implemented natively in Mojo. |
9 // | 9 // |
10 // This module provides the JavaScript bindings for mojo/public/c/system/core.h. | 10 // This module provides the JavaScript bindings for mojo/public/c/system/core.h. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 * MojoReadDataFlags: Used to specify different modes to |readData()|. | 107 * MojoReadDataFlags: Used to specify different modes to |readData()|. |
108 * See core.h for more information. | 108 * See core.h for more information. |
109 */ | 109 */ |
110 var READ_DATA_FLAG_NONE; | 110 var READ_DATA_FLAG_NONE; |
111 var READ_DATA_FLAG_ALL_OR_NONE; | 111 var READ_DATA_FLAG_ALL_OR_NONE; |
112 var READ_DATA_FLAG_DISCARD; | 112 var READ_DATA_FLAG_DISCARD; |
113 var READ_DATA_FLAG_QUERY; | 113 var READ_DATA_FLAG_QUERY; |
114 var READ_DATA_FLAG_PEEK; | 114 var READ_DATA_FLAG_PEEK; |
115 | 115 |
116 /** | 116 /** |
| 117 * MojoCreateSharedBufferOptionsFlags: Used to specify options to |
| 118 * |createSharedBuffer()|. |
| 119 * See core.h for more information. |
| 120 */ |
| 121 var CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE; |
| 122 |
| 123 /** |
| 124 * MojoDuplicateBufferHandleOptionsFlags: Used to specify options to |
| 125 * |duplicateBufferHandle()|. |
| 126 * See core.h for more information. |
| 127 */ |
| 128 var DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE; |
| 129 var DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY; |
| 130 |
| 131 /** |
| 132 * MojoMapBufferFlags: Used to specify options to |mapBuffer()|. |
| 133 * See core.h for more information. |
| 134 */ |
| 135 var MAP_BUFFER_FLAG_NONE; |
| 136 |
| 137 /** |
117 * Closes the given |handle|. See MojoClose for more info. | 138 * Closes the given |handle|. See MojoClose for more info. |
118 * @param {MojoHandle} Handle to close. | 139 * @param {MojoHandle} Handle to close. |
119 * @return {MojoResult} Result code. | 140 * @return {MojoResult} Result code. |
120 */ | 141 */ |
121 function close(handle) { [native code] } | 142 function close(handle) { [native code] } |
122 | 143 |
123 /** | 144 /** |
124 * Waits on the given handle until a signal indicated by |signals| is | 145 * Waits on the given handle until a signal indicated by |signals| is |
125 * satisfied or until |deadline| is passed. See MojoWait for more information. | 146 * satisfied or until |deadline| is passed. See MojoWait for more information. |
126 * | 147 * |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 */ | 250 */ |
230 function readData(handle, flags) { [native code] } | 251 function readData(handle, flags) { [native code] } |
231 | 252 |
232 /** | 253 /** |
233 * True if the argument is a message or data pipe handle. | 254 * True if the argument is a message or data pipe handle. |
234 * | 255 * |
235 * @param {value} an arbitrary JS value. | 256 * @param {value} an arbitrary JS value. |
236 * @return true or false | 257 * @return true or false |
237 */ | 258 */ |
238 function isHandle(value) { [native code] } | 259 function isHandle(value) { [native code] } |
| 260 |
| 261 /** |
| 262 * Creates shared buffer of specified size |num_bytes|. |
| 263 * See MojoCreateSharedBuffer for more information including error codes. |
| 264 * |
| 265 * @param {number} num_bytes Size of the memory to be allocated for shared |
| 266 * @param {MojoCreateSharedBufferOptionsFlags} flags Flags. |
| 267 * buffer. |
| 268 * @return {object} An object of the form { |
| 269 * result, // |RESULT_OK| on success, error code otherwise. |
| 270 * handle, // An MojoHandle for shared buffer (only on success). |
| 271 * } |
| 272 */ |
| 273 function createSharedBuffer(num_bytes, flags) { [native code] } |
| 274 |
| 275 /** |
| 276 * Duplicates the |buffer_handle| to a shared buffer. Duplicated handle can be |
| 277 * sent to another process over message pipe. See MojoDuplicateBufferHandle for |
| 278 * more information including error codes. |
| 279 * |
| 280 * @param {MojoHandle} buffer_handle MojoHandle. |
| 281 * @param {MojoCreateSharedBufferOptionsFlags} flags Flags. |
| 282 * @return {object} An object of the form { |
| 283 * result, // |RESULT_OK| on success, error code otherwise. |
| 284 * handle, // A duplicated MojoHandle for shared buffer (only on success). |
| 285 * } |
| 286 */ |
| 287 function duplicateBufferHandle(buffer_handle, flags) { [native code] } |
| 288 |
| 289 /** |
| 290 * Maps the part (at offset |offset| of length |num_bytes|) of the buffer given |
| 291 * by |buffer_handle| into ArrayBuffer memory |buffer|, with options specified |
| 292 * by |flags|. See MojoMapBuffer for more information including error codes. |
| 293 * |
| 294 * @param {MojoHandle} buffer_handle A sharedBufferHandle returned by |
| 295 * createSharedBuffer. |
| 296 * @param {number} offset Offset. |
| 297 * @param {number} num_bytes Size of the memory to be mapped. |
| 298 * @param {MojoMapBufferFlags} flags Flags. |
| 299 * @return {object} An object of the form { |
| 300 * result, // |RESULT_OK| on success, error code otherwise. |
| 301 * buffer, // An ArrayBuffer (only on success). |
| 302 * } |
| 303 */ |
| 304 function mapBuffer(buffer_handle, offset, num_bytes, flags) { [native code] } |
| 305 |
| 306 /** |
| 307 * Unmaps buffer that was mapped using mapBuffer. |
| 308 * See MojoUnmapBuffer for more information including error codes. |
| 309 * |
| 310 * @param {ArrayBuffer} buffer ArrayBuffer. |
| 311 * @return {MojoResult} Result code. |
| 312 */ |
| 313 function unmapBuffer(buffer) { [native code] } |
OLD | NEW |