OLD | NEW |
1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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 #ifndef PPAPI_C_PPB_CORE_H_ | 5 #ifndef PPAPI_C_PPB_CORE_H_ |
6 #define PPAPI_C_PPB_CORE_H_ | 6 #define PPAPI_C_PPB_CORE_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 /** | 97 /** |
98 * CallOnMainThread is a pointer to a function that schedules work to be | 98 * CallOnMainThread is a pointer to a function that schedules work to be |
99 * executed on the main module thread after the specified delay. The delay | 99 * executed on the main module thread after the specified delay. The delay |
100 * may be 0 to specify a call back as soon as possible. | 100 * may be 0 to specify a call back as soon as possible. |
101 * | 101 * |
102 * The |result| parameter will just be passed as the second argument to the | 102 * The |result| parameter will just be passed as the second argument to the |
103 * callback. Many applications won't need this, but it allows a plugin to | 103 * callback. Many applications won't need this, but it allows a plugin to |
104 * emulate calls of some callbacks which do use this value. | 104 * emulate calls of some callbacks which do use this value. |
105 * | 105 * |
| 106 * NOTE: CallOnMainThread, even when used from the main thread with a delay |
| 107 * of 0 milliseconds, will never directly invoke the callback. Even in this |
| 108 * case, the callback will be scheduled asynchronously. |
| 109 * |
106 * NOTE: If the browser is shutting down or if the plugin has no instances, | 110 * NOTE: If the browser is shutting down or if the plugin has no instances, |
107 * then the callback function may not be called. | 111 * then the callback function may not be called. |
108 * | 112 * |
109 * @param[in] delay_in_milliseconds An int32_t delay in milliseconds. | 113 * @param[in] delay_in_milliseconds An int32_t delay in milliseconds. |
110 * @param[in] callback A PP_CompletionCallback callback function that the | 114 * @param[in] callback A PP_CompletionCallback callback function that the |
111 * browser will call after the specified delay. | 115 * browser will call after the specified delay. |
112 * @param[in] result An int32_t that the browser will pass to the given | 116 * @param[in] result An int32_t that the browser will pass to the given |
113 * PP_CompletionCallback. | 117 * PP_CompletionCallback. |
114 */ | 118 */ |
115 void (*CallOnMainThread)(int32_t delay_in_milliseconds, | 119 void (*CallOnMainThread)(int32_t delay_in_milliseconds, |
(...skipping 12 matching lines...) Expand all Loading... |
128 */ | 132 */ |
129 PP_Bool (*IsMainThread)(); | 133 PP_Bool (*IsMainThread)(); |
130 }; | 134 }; |
131 /** | 135 /** |
132 * @} | 136 * @} |
133 */ | 137 */ |
134 | 138 |
135 | 139 |
136 #endif /* PPAPI_C_DEV_PPB_CORE_DEV_H_ */ | 140 #endif /* PPAPI_C_DEV_PPB_CORE_DEV_H_ */ |
137 | 141 |
OLD | NEW |