Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: mojo/public/js/bindings/core.js

Issue 392923002: Add support for MojoCreateMessagePipeOptions struct to JS bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/bindings/js/core_unittests.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 /** 49 /**
50 * MojoHandleSignals: Used to specify signals that can be waited on for a handle 50 * 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 51 *(and which can be triggered), e.g., the ability to read or write to
52 * the handle. 52 * the handle.
53 * See core.h for more information. 53 * See core.h for more information.
54 */ 54 */
55 var HANDLE_SIGNAL_NONE; 55 var HANDLE_SIGNAL_NONE;
56 var HANDLE_SIGNAL_READABLE; 56 var HANDLE_SIGNAL_READABLE;
57 var HANDLE_SIGNAL_WRITABLE; 57 var HANDLE_SIGNAL_WRITABLE;
58 58
59 /**
60 * MojoCreateDataMessageOptions: Used to specify creation parameters for a data
61 * pipe to |createDataMessage()|.
62 * See core.h for more information.
63 */
64 dictionary MojoCreateDataMessageOptions {
65 MojoCreateDataMessageOptionsFlags flags; // See below.
66 };
67
68 // MojoCreateDataMessageOptionsFlags
69 var CREATE_MESSAGE_PIPE_OPTIONS_FLAG_NONE;
70
59 /* 71 /*
60 * MojoWriteMessageFlags: Used to specify different modes to |writeMessage()|. 72 * MojoWriteMessageFlags: Used to specify different modes to |writeMessage()|.
61 * See core.h for more information. 73 * See core.h for more information.
62 */ 74 */
63 var WRITE_MESSAGE_FLAG_NONE; 75 var WRITE_MESSAGE_FLAG_NONE;
64 76
65 /** 77 /**
66 * MojoReadMessageFlags: Used to specify different modes to |readMessage()|. 78 * MojoReadMessageFlags: Used to specify different modes to |readMessage()|.
67 * See core.h for more information. 79 * See core.h for more information.
68 */ 80 */
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 * for each corresponding handle. Must be the same length as |handles|. 141 * for each corresponding handle. Must be the same length as |handles|.
130 * @param {MojoDeadline} deadline Stops waiting if this is reached. 142 * @param {MojoDeadline} deadline Stops waiting if this is reached.
131 * @return {MojoResult} Result code. 143 * @return {MojoResult} Result code.
132 */ 144 */
133 function waitMany(handles, signals, deadline) { [native code] } 145 function waitMany(handles, signals, deadline) { [native code] }
134 146
135 /** 147 /**
136 * Creates a message pipe. This function always succeeds. 148 * Creates a message pipe. This function always succeeds.
137 * See MojoCreateMessagePipe for more information on message pipes. 149 * See MojoCreateMessagePipe for more information on message pipes.
138 * 150 *
151 * @param {MojoCreateMessagePipeOptions} optionsDict Options to control the
152 * message pipe parameters. May be null.
139 * @return {MessagePipe} An object of the form { 153 * @return {MessagePipe} An object of the form {
140 * handle0, 154 * handle0,
141 * handle1, 155 * handle1,
142 * } 156 * }
143 * where |handle0| and |handle1| are MojoHandles to each end of the channel. 157 * where |handle0| and |handle1| are MojoHandles to each end of the channel.
144 */ 158 */
145 function createMessagePipe() { [native code] } 159 function createMessagePipe(optionsDict) { [native code] }
146 160
147 /** 161 /**
148 * Writes a message to the message pipe endpoint given by |handle|. See 162 * Writes a message to the message pipe endpoint given by |handle|. See
149 * MojoWriteMessage for more information, including return codes. 163 * MojoWriteMessage for more information, including return codes.
150 * 164 *
151 * @param {MojoHandle} handle The endpoint to write to. 165 * @param {MojoHandle} handle The endpoint to write to.
152 * @param {ArrayBufferView} buffer The message data. May be empty. 166 * @param {ArrayBufferView} buffer The message data. May be empty.
153 * @param {Array.MojoHandle} handlesArray Any handles to attach. Handles are 167 * @param {Array.MojoHandle} handlesArray Any handles to attach. Handles are
154 * transferred on success and will no longer be valid. May be empty. 168 * transferred on success and will no longer be valid. May be empty.
155 * @param {MojoWriteMessageFlags} flags Flags. 169 * @param {MojoWriteMessageFlags} flags Flags.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 * return codes. 220 * return codes.
207 * 221 *
208 * @param {MojoHandle} handle A consumerHandle returned by createDataPipe. 222 * @param {MojoHandle} handle A consumerHandle returned by createDataPipe.
209 * @param {MojoReadDataFlags} flags Flags. 223 * @param {MojoReadDataFlags} flags Flags.
210 * @return {object} An object of the form { 224 * @return {object} An object of the form {
211 * result, // |RESULT_OK| on success, error code otherwise. 225 * result, // |RESULT_OK| on success, error code otherwise.
212 * buffer, // An ArrayBufferView of the data read (only on success). 226 * buffer, // An ArrayBufferView of the data read (only on success).
213 * } 227 * }
214 */ 228 */
215 function readData(handle, flags) { [native code] } 229 function readData(handle, flags) { [native code] }
OLDNEW
« no previous file with comments | « mojo/bindings/js/core_unittests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698