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 /* From dev/ppb_message_loop_dev.idl modified Thu Jan 19 20:02:41 2012. */ | 6 /* From dev/ppb_message_loop_dev.idl modified Wed Aug 29 12:22:26 2012. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_MESSAGE_LOOP_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_MESSAGE_LOOP_DEV_H_ |
9 #define PPAPI_C_DEV_PPB_MESSAGE_LOOP_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_MESSAGE_LOOP_DEV_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 * | 117 * |
118 * - You quit the message loop via PostQuit with should_destroy set to | 118 * - You quit the message loop via PostQuit with should_destroy set to |
119 * PP_FALSE. In this case, the system will assume the message loop will be | 119 * PP_FALSE. In this case, the system will assume the message loop will be |
120 * run again later and keep your tasks. | 120 * run again later and keep your tasks. |
121 * | 121 * |
122 * To do proper shutdown, call PostQuit with should_destroy = PP_TRUE. This | 122 * To do proper shutdown, call PostQuit with should_destroy = PP_TRUE. This |
123 * will prohibit future work from being posted, and will allow the message loop | 123 * will prohibit future work from being posted, and will allow the message loop |
124 * to run until all pending tasks are run. | 124 * to run until all pending tasks are run. |
125 * | 125 * |
126 * If you post a callback to a message loop that's been destroyed, or to an | 126 * If you post a callback to a message loop that's been destroyed, or to an |
127 * invalid message loop, PostTask will return an error and will not run the | 127 * invalid message loop, PostWork will return an error and will not run the |
128 * callback. This is true even for callbacks with the "required" flag set, | 128 * callback. This is true even for callbacks with the "required" flag set, |
129 * since the system may not even know what thread to issue the error callback | 129 * since the system may not even know what thread to issue the error callback |
130 * on. | 130 * on. |
131 * | 131 * |
132 * Therefore, you should check for errors from PostWork and destroy any | 132 * Therefore, you should check for errors from PostWork and destroy any |
133 * associated memory to avoid leaks. If you're using the C++ | 133 * associated memory to avoid leaks. If you're using the C++ |
134 * CompletionCallbackFactory, use the following pattern: | 134 * CompletionCallbackFactory, use the following pattern: |
135 * | 135 * |
136 * pp::CompletionCallback callback = factory_.NewOptionalCallback(...); | 136 * pp::CompletionCallback callback = factory_.NewOptionalCallback(...); |
137 * int32_t result = message_loop.PostWork(callback); | 137 * int32_t result = message_loop.PostWork(callback); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 int32_t (*PostQuit)(PP_Resource message_loop, PP_Bool should_destroy); | 279 int32_t (*PostQuit)(PP_Resource message_loop, PP_Bool should_destroy); |
280 }; | 280 }; |
281 | 281 |
282 typedef struct PPB_MessageLoop_Dev_0_1 PPB_MessageLoop_Dev; | 282 typedef struct PPB_MessageLoop_Dev_0_1 PPB_MessageLoop_Dev; |
283 /** | 283 /** |
284 * @} | 284 * @} |
285 */ | 285 */ |
286 | 286 |
287 #endif /* PPAPI_C_DEV_PPB_MESSAGE_LOOP_DEV_H_ */ | 287 #endif /* PPAPI_C_DEV_PPB_MESSAGE_LOOP_DEV_H_ */ |
288 | 288 |
OLD | NEW |