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_Dev interface. |
8 */ | 8 */ |
9 label Chrome { | 9 label Chrome { |
10 M18 = 0.1 | 10 M18 = 0.1 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 * | 99 * |
100 * - You quit the message loop via PostQuit with should_destroy set to | 100 * - You quit the message loop via PostQuit with should_destroy set to |
101 * PP_FALSE. In this case, the system will assume the message loop will be | 101 * PP_FALSE. In this case, the system will assume the message loop will be |
102 * run again later and keep your tasks. | 102 * run again later and keep your tasks. |
103 * | 103 * |
104 * To do proper shutdown, call PostQuit with should_destroy = PP_TRUE. This | 104 * To do proper shutdown, call PostQuit with should_destroy = PP_TRUE. This |
105 * will prohibit future work from being posted, and will allow the message loop | 105 * will prohibit future work from being posted, and will allow the message loop |
106 * to run until all pending tasks are run. | 106 * to run until all pending tasks are run. |
107 * | 107 * |
108 * If you post a callback to a message loop that's been destroyed, or to an | 108 * If you post a callback to a message loop that's been destroyed, or to an |
109 * invalid message loop, PostTask will return an error and will not run the | 109 * invalid message loop, PostWork will return an error and will not run the |
110 * callback. This is true even for callbacks with the "required" flag set, | 110 * callback. This is true even for callbacks with the "required" flag set, |
111 * since the system may not even know what thread to issue the error callback | 111 * since the system may not even know what thread to issue the error callback |
112 * on. | 112 * on. |
113 * | 113 * |
114 * Therefore, you should check for errors from PostWork and destroy any | 114 * Therefore, you should check for errors from PostWork and destroy any |
115 * associated memory to avoid leaks. If you're using the C++ | 115 * associated memory to avoid leaks. If you're using the C++ |
116 * CompletionCallbackFactory, use the following pattern: | 116 * CompletionCallbackFactory, use the following pattern: |
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); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 * | 259 * |
260 * @return | 260 * @return |
261 * - PP_OK: The request to quit was successfully posted. | 261 * - PP_OK: The request to quit was successfully posted. |
262 * - PP_ERROR_BADRESOURCE: The message loop was invalid. | 262 * - PP_ERROR_BADRESOURCE: The message loop was invalid. |
263 * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. | 263 * - 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 | 264 * The main thread's message loop is managed by the system and can't be |
265 * quit. | 265 * quit. |
266 */ | 266 */ |
267 int32_t PostQuit([in] PP_Resource message_loop, PP_Bool should_destroy); | 267 int32_t PostQuit([in] PP_Resource message_loop, PP_Bool should_destroy); |
268 }; | 268 }; |
OLD | NEW |