| 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/bindings/core" | 5 // Module "mojo/public/js/bindings/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 29 matching lines...) Expand all Loading... |
| 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. | 44 * MojoDeadline {number}: Used to specify deadlines (timeouts), in microseconds. |
| 45 * See core.h for more information. | 45 * See core.h for more information. |
| 46 */ | 46 */ |
| 47 var DEADLINE_INDEFINITE; | 47 var DEADLINE_INDEFINITE; |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * MojoWaitFlags: Used to specify the state of a handle to wait on (e.g., the | 50 * MojoHandleSignals: Used to specify signals that can be waited on for a handle |
| 51 * ability to read or write to it). | 51 *(and which can be triggered), e.g., the ability to read or write to |
| 52 * the handle. |
| 52 * See core.h for more information. | 53 * See core.h for more information. |
| 53 */ | 54 */ |
| 54 var WAIT_FLAG_NONE; | 55 var WAIT_FLAG_NONE; |
| 55 var WAIT_FLAG_READABLE; | 56 var WAIT_FLAG_READABLE; |
| 56 var WAIT_FLAG_WRITABLE; | 57 var WAIT_FLAG_WRITABLE; |
| 57 var WAIT_FLAG_EVERYTHING; | 58 var WAIT_FLAG_EVERYTHING; |
| 58 | 59 |
| 59 /* | 60 /* |
| 60 * MojoWriteMessageFlags: Used to specify different modes to |writeMessage()|. | 61 * MojoWriteMessageFlags: Used to specify different modes to |writeMessage()|. |
| 61 * See core.h for more information. | 62 * See core.h for more information. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 var READ_DATA_FLAG_QUERY; | 102 var READ_DATA_FLAG_QUERY; |
| 102 | 103 |
| 103 /** | 104 /** |
| 104 * Closes the given |handle|. See MojoClose for more info. | 105 * Closes the given |handle|. See MojoClose for more info. |
| 105 * @param {MojoHandle} Handle to close. | 106 * @param {MojoHandle} Handle to close. |
| 106 * @return {MojoResult} Result code. | 107 * @return {MojoResult} Result code. |
| 107 */ | 108 */ |
| 108 function close(handle) { [native code] } | 109 function close(handle) { [native code] } |
| 109 | 110 |
| 110 /** | 111 /** |
| 111 * Waits on the given handle until the state indicated by |waitFlags| is | 112 * Waits on the given handle until a signal indicated by |signals| is |
| 112 * satisfied or until |deadline| is passed. See MojoWait for more information. | 113 * satisfied or until |deadline| is passed. See MojoWait for more information. |
| 113 * | 114 * |
| 114 * @param {MojoHandle} handle Handle to wait on. | 115 * @param {MojoHandle} handle Handle to wait on. |
| 115 * @param {MojoWaitFlags} waitFlags Specifies the condition to wait for. | 116 * @param {MojoHandleSignals} signals Specifies the condition to wait for. |
| 116 * @param {MojoDeadline} deadline Stops waiting if this is reached. | 117 * @param {MojoDeadline} deadline Stops waiting if this is reached. |
| 117 * @return {MojoResult} Result code. | 118 * @return {MojoResult} Result code. |
| 118 */ | 119 */ |
| 119 function wait(handle, waitFlags, deadline) { [native code] } | 120 function wait(handle, signals, deadline) { [native code] } |
| 120 | 121 |
| 121 /** | 122 /** |
| 122 * Waits on |handles[0]|, ..., |handles[handles.length-1]| for at least one of | 123 * Waits on |handles[0]|, ..., |handles[handles.length-1]| for at least one of |
| 123 * them to satisfy the state indicated by |flags[0]|, ..., | 124 * them to satisfy the state indicated by |flags[0]|, ..., |
| 124 * |flags[handles.length-1]|, respectively, or until |deadline| has passed. | 125 * |flags[handles.length-1]|, respectively, or until |deadline| has passed. |
| 125 * See MojoWaitMany for more information. | 126 * See MojoWaitMany for more information. |
| 126 * | 127 * |
| 127 * @param {Array.MojoHandle} handles Handles to wait on. | 128 * @param {Array.MojoHandle} handles Handles to wait on. |
| 128 * @param {Array.MojoWaitFlags} waitFlags Specifies the condition to wait for, | 129 * @param {Array.MojoHandleSignals} signals Specifies the condition to wait for, |
| 129 * for each corresponding handle. Must be the same length as |handles|. | 130 * for each corresponding handle. Must be the same length as |handles|. |
| 130 * @param {MojoDeadline} deadline Stops waiting if this is reached. | 131 * @param {MojoDeadline} deadline Stops waiting if this is reached. |
| 131 * @return {MojoResult} Result code. | 132 * @return {MojoResult} Result code. |
| 132 */ | 133 */ |
| 133 function waitMany(handles, waitFlags, deadline) { [native code] } | 134 function waitMany(handles, signals, deadline) { [native code] } |
| 134 | 135 |
| 135 /** | 136 /** |
| 136 * Creates a message pipe. This function always succeeds. | 137 * Creates a message pipe. This function always succeeds. |
| 137 * See MojoCreateMessagePipe for more information on message pipes. | 138 * See MojoCreateMessagePipe for more information on message pipes. |
| 138 * | 139 * |
| 139 * @return {MessagePipe} An object of the form { | 140 * @return {MessagePipe} An object of the form { |
| 140 * handle0, | 141 * handle0, |
| 141 * handle1, | 142 * handle1, |
| 142 * } | 143 * } |
| 143 * where |handle0| and |handle1| are MojoHandles to each end of the channel. | 144 * where |handle0| and |handle1| are MojoHandles to each end of the channel. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 * return codes. | 207 * return codes. |
| 207 * | 208 * |
| 208 * @param {MojoHandle} handle A consumerHandle returned by createDataPipe. | 209 * @param {MojoHandle} handle A consumerHandle returned by createDataPipe. |
| 209 * @param {MojoReadDataFlags} flags Flags. | 210 * @param {MojoReadDataFlags} flags Flags. |
| 210 * @return {object} An object of the form { | 211 * @return {object} An object of the form { |
| 211 * result, // |RESULT_OK| on success, error code otherwise. | 212 * result, // |RESULT_OK| on success, error code otherwise. |
| 212 * buffer, // An ArrayBufferView of the data read (only on success). | 213 * buffer, // An ArrayBufferView of the data read (only on success). |
| 213 * } | 214 * } |
| 214 */ | 215 */ |
| 215 function readData(handle, flags) { [native code] } | 216 function readData(handle, flags) { [native code] } |
| OLD | NEW |