| 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 23 matching lines...) Expand all Loading... |
| 34 var RESULT_ABORTED; | 34 var RESULT_ABORTED; |
| 35 var RESULT_OUT_OF_RANGE; | 35 var RESULT_OUT_OF_RANGE; |
| 36 var RESULT_UNIMPLEMENTED; | 36 var RESULT_UNIMPLEMENTED; |
| 37 var RESULT_INTERNAL; | 37 var RESULT_INTERNAL; |
| 38 var RESULT_UNAVAILABLE; | 38 var RESULT_UNAVAILABLE; |
| 39 var RESULT_DATA_LOSS; | 39 var RESULT_DATA_LOSS; |
| 40 var RESULT_BUSY; | 40 var RESULT_BUSY; |
| 41 var RESULT_SHOULD_WAIT; | 41 var RESULT_SHOULD_WAIT; |
| 42 | 42 |
| 43 /** | 43 /** |
| 44 * MojoDeadline {number}: Used to specify deadlines (timeouts), in microseconds. | |
| 45 * See core.h for more information. | |
| 46 */ | |
| 47 var DEADLINE_INDEFINITE; | |
| 48 | |
| 49 /** | |
| 50 * MojoHandleSignals: Used to specify signals that can be waited on for a handle | 44 * MojoHandleSignals: Used to specify signals that can be waited on for a handle |
| 51 *(and which can be triggered), e.g., the ability to read or write to | 45 *(and which can be triggered), e.g., the ability to read or write to |
| 52 * the handle. | 46 * the handle. |
| 53 * See core.h for more information. | 47 * See core.h for more information. |
| 54 */ | 48 */ |
| 55 var HANDLE_SIGNAL_NONE; | 49 var HANDLE_SIGNAL_NONE; |
| 56 var HANDLE_SIGNAL_READABLE; | 50 var HANDLE_SIGNAL_READABLE; |
| 57 var HANDLE_SIGNAL_WRITABLE; | 51 var HANDLE_SIGNAL_WRITABLE; |
| 58 var HANDLE_SIGNAL_PEER_CLOSED; | 52 var HANDLE_SIGNAL_PEER_CLOSED; |
| 59 | 53 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 * @return {object} An object of the form { | 142 * @return {object} An object of the form { |
| 149 * result, // MOJO_RESULT_OK or MOJO_RESULT_INVALID_ARGUMENT | 143 * result, // MOJO_RESULT_OK or MOJO_RESULT_INVALID_ARGUMENT |
| 150 * satisfiedSignals, // MojoHandleSignals (see above) | 144 * satisfiedSignals, // MojoHandleSignals (see above) |
| 151 * satisfiableSignals, // MojoHandleSignals | 145 * satisfiableSignals, // MojoHandleSignals |
| 152 * } | 146 * } |
| 153 */ | 147 */ |
| 154 function queryHandleSignalsState(handle) { [native code] } | 148 function queryHandleSignalsState(handle) { [native code] } |
| 155 | 149 |
| 156 /** | 150 /** |
| 157 * Waits on the given handle until a signal indicated by |signals| is | 151 * Waits on the given handle until a signal indicated by |signals| is |
| 158 * satisfied or until |deadline| is passed. See MojoWait for more information. | 152 * satisfied or an error occurs. |
| 159 * | 153 * |
| 160 * @param {MojoHandle} handle Handle to wait on. | 154 * @param {MojoHandle} handle Handle to wait on. |
| 161 * @param {MojoHandleSignals} signals Specifies the condition to wait for. | 155 * @param {MojoHandleSignals} signals Specifies the condition to wait for. |
| 162 * @param {MojoDeadline} deadline Stops waiting if this is reached. | |
| 163 * @return {MojoResult} Result code. | 156 * @return {MojoResult} Result code. |
| 164 */ | 157 */ |
| 165 function wait(handle, signals, deadline) { [native code] } | 158 function wait(handle, signals) { [native code] } |
| 166 | |
| 167 /** | |
| 168 * Waits on |handles[0]|, ..., |handles[handles.length-1]| for at least one of | |
| 169 * them to satisfy the state indicated by |flags[0]|, ..., | |
| 170 * |flags[handles.length-1]|, respectively, or until |deadline| has passed. | |
| 171 * See MojoWaitMany for more information. | |
| 172 * | |
| 173 * @param {Array.MojoHandle} handles Handles to wait on. | |
| 174 * @param {Array.MojoHandleSignals} signals Specifies the condition to wait for, | |
| 175 * for each corresponding handle. Must be the same length as |handles|. | |
| 176 * @param {MojoDeadline} deadline Stops waiting if this is reached. | |
| 177 * @return {MojoResult} Result code. | |
| 178 */ | |
| 179 function waitMany(handles, signals, deadline) { [native code] } | |
| 180 | 159 |
| 181 /** | 160 /** |
| 182 * Creates a message pipe. This function always succeeds. | 161 * Creates a message pipe. This function always succeeds. |
| 183 * See MojoCreateMessagePipe for more information on message pipes. | 162 * See MojoCreateMessagePipe for more information on message pipes. |
| 184 * | 163 * |
| 185 * @param {MojoCreateMessagePipeOptions} optionsDict Options to control the | 164 * @param {MojoCreateMessagePipeOptions} optionsDict Options to control the |
| 186 * message pipe parameters. May be null. | 165 * message pipe parameters. May be null. |
| 187 * @return {MessagePipe} An object of the form { | 166 * @return {MessagePipe} An object of the form { |
| 188 * handle0, | 167 * handle0, |
| 189 * handle1, | 168 * handle1, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 function mapBuffer(buffer_handle, offset, num_bytes, flags) { [native code] } | 295 function mapBuffer(buffer_handle, offset, num_bytes, flags) { [native code] } |
| 317 | 296 |
| 318 /** | 297 /** |
| 319 * Unmaps buffer that was mapped using mapBuffer. | 298 * Unmaps buffer that was mapped using mapBuffer. |
| 320 * See MojoUnmapBuffer for more information including error codes. | 299 * See MojoUnmapBuffer for more information including error codes. |
| 321 * | 300 * |
| 322 * @param {ArrayBuffer} buffer ArrayBuffer. | 301 * @param {ArrayBuffer} buffer ArrayBuffer. |
| 323 * @return {MojoResult} Result code. | 302 * @return {MojoResult} Result code. |
| 324 */ | 303 */ |
| 325 function unmapBuffer(buffer) { [native code] } | 304 function unmapBuffer(buffer) { [native code] } |
| OLD | NEW |