OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
6 /** | 6 /** |
7 * Defines the PPB_MessageLoop_Dev interface. | 7 * Defines the PPB_MessageLoop interface. |
8 */ | 8 */ |
9 label Chrome { | 9 label Chrome { |
10 M18 = 0.1 | 10 M25 = 1.0 |
11 }; | 11 }; |
12 | 12 |
13 /** | 13 /** |
14 * A message loop allows PPAPI calls to be issued on a thread. You may not | 14 * A message loop allows PPAPI calls to be issued on a thread. You may not |
15 * issue any API calls on a thread without creating a message loop. It also | 15 * issue any API calls on a thread without creating a message loop. It also |
16 * allows you to post work to the message loop for a thread. | 16 * allows you to post work to the message loop for a thread. |
17 * | 17 * |
18 * To process work posted to the message loop, as well as completion callbacks | 18 * To process work posted to the message loop, as well as completion callbacks |
19 * for asynchronous operations, you must run the message loop via Run(). | 19 * for asynchronous operations, you must run the message loop via Run(). |
20 * | 20 * |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 * | 117 * |
118 * pp::CompletionCallback callback = factory_.NewOptionalCallback(...); | 118 * pp::CompletionCallback callback = factory_.NewOptionalCallback(...); |
119 * int32_t result = message_loop.PostWork(callback); | 119 * int32_t result = message_loop.PostWork(callback); |
120 * if (result != PP_OK_COMPLETIONPENDING) | 120 * if (result != PP_OK_COMPLETIONPENDING) |
121 * callback.Run(result); | 121 * callback.Run(result); |
122 * | 122 * |
123 * This will run the callback with an error value, and assumes that the | 123 * This will run the callback with an error value, and assumes that the |
124 * implementation of your callback checks the "result" argument and returns | 124 * implementation of your callback checks the "result" argument and returns |
125 * immediately on error. | 125 * immediately on error. |
126 */ | 126 */ |
127 interface PPB_MessageLoop_Dev { | 127 interface PPB_MessageLoop { |
128 /** | 128 /** |
129 * Creates a message loop resource. | 129 * Creates a message loop resource. |
130 * | 130 * |
131 * This may be called from any thread. After your thread starts but before | 131 * This may be called from any thread. After your thread starts but before |
132 * issuing any other PPAPI calls on it, you must associate it with a message | 132 * issuing any other PPAPI calls on it, you must associate it with a message |
133 * loop by calling AttachToCurrentThread. | 133 * loop by calling AttachToCurrentThread. |
134 */ | 134 */ |
135 PP_Resource Create(PP_Instance instance); | 135 PP_Resource Create(PP_Instance instance); |
136 | 136 |
137 /** | 137 /** |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 */ | 241 */ |
242 int32_t PostWork([in] PP_Resource message_loop, | 242 int32_t PostWork([in] PP_Resource message_loop, |
243 [in] PP_CompletionCallback callback, | 243 [in] PP_CompletionCallback callback, |
244 [in] int64_t delay_ms); | 244 [in] int64_t delay_ms); |
245 | 245 |
246 /** | 246 /** |
247 * Posts a quit message to the given message loop's work queue. Work posted | 247 * Posts a quit message to the given message loop's work queue. Work posted |
248 * before that point will be processed before quitting. | 248 * before that point will be processed before quitting. |
249 * | 249 * |
250 * This may be called on the message loop registered for the current thread, | 250 * This may be called on the message loop registered for the current thread, |
251 * or it may be called on the message loop registered for another thread. | 251 * or it may be called on the message loop registered for another thread. It |
| 252 * is an error to attempt to PostQuit() the main thread loop. |
252 * | 253 * |
253 * @param should_destroy Marks the message loop as being in a destroyed state | 254 * @param should_destroy Marks the message loop as being in a destroyed state |
254 * and prevents further posting of messages. | 255 * and prevents further posting of messages. |
255 * | 256 * |
256 * If you quit a message loop without setting should_destroy, it will still | 257 * If you quit a message loop without setting should_destroy, it will still |
257 * be attached to the thread and you can still run it again by calling Run() | 258 * be attached to the thread and you can still run it again by calling Run() |
258 * again. If you destroy it, it will be detached from the current thread. | 259 * again. If you destroy it, it will be detached from the current thread. |
259 * | 260 * |
260 * @return | 261 * @return |
261 * - PP_OK: The request to quit was successfully posted. | 262 * - PP_OK: The request to quit was successfully posted. |
262 * - PP_ERROR_BADRESOURCE: The message loop was invalid. | 263 * - PP_ERROR_BADRESOURCE: The message loop was invalid. |
263 * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. | 264 * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. |
264 * The main thread's message loop is managed by the system and can't be | 265 * The main thread's message loop is managed by the system and can't be |
265 * quit. | 266 * quit. |
266 */ | 267 */ |
267 int32_t PostQuit([in] PP_Resource message_loop, PP_Bool should_destroy); | 268 int32_t PostQuit([in] PP_Resource message_loop, PP_Bool should_destroy); |
268 }; | 269 }; |
OLD | NEW |