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

Side by Side Diff: ppapi/api/ppb_message_loop.idl

Issue 13238002: [PPAPI] Documentation fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge yet again Created 7 years, 8 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 | « ppapi/api/ppb_input_event.idl ('k') | ppapi/api/private/ppb_content_decryptor_private.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 interface. 7 * Defines the PPB_MessageLoop interface.
8 */ 8 */
9 label Chrome { 9 label Chrome {
10 M25 = 1.0 10 M25 = 1.0
(...skipping 19 matching lines...) Expand all
30 * - Create the thread yourself (using pthreads). 30 * - Create the thread yourself (using pthreads).
31 * - Create the message loop resource. 31 * - Create the message loop resource.
32 * - Pass the message loop resource to your thread's main function. 32 * - Pass the message loop resource to your thread's main function.
33 * - Call PostWork() on the message loop to run functions on the thread. 33 * - Call PostWork() on the message loop to run functions on the thread.
34 * 34 *
35 * From the background thread's main function: 35 * From the background thread's main function:
36 * - Call AttachToCurrentThread() with the message loop resource. 36 * - Call AttachToCurrentThread() with the message loop resource.
37 * - Call Run() with the message loop resource. 37 * - Call Run() with the message loop resource.
38 * 38 *
39 * Your callbacks should look like this: 39 * Your callbacks should look like this:
40 * @code
40 * void DoMyWork(void* user_data, int32_t status) { 41 * void DoMyWork(void* user_data, int32_t status) {
41 * if (status != PP_OK) { 42 * if (status != PP_OK) {
42 * Cleanup(); // e.g. free user_data. 43 * Cleanup(); // e.g. free user_data.
43 * return; 44 * return;
44 * } 45 * }
45 * ... do your work... 46 * ... do your work...
46 * } 47 * }
48 * @endcode
47 * For a C++ example, see ppapi/utility/threading/simple_thread.h 49 * For a C++ example, see ppapi/utility/threading/simple_thread.h
48 * 50 *
49 * (You can also create the message loop resource on the background thread, 51 * (You can also create the message loop resource on the background thread,
50 * but then the main thread will have no reference to it should you want to 52 * but then the main thread will have no reference to it should you want to
51 * call PostWork()). 53 * call PostWork()).
52 * 54 *
53 * 55 *
54 * THREAD HANDLING 56 * THREAD HANDLING
55 * 57 *
56 * The main thread has an implicitly created message loop. The main thread is 58 * The main thread has an implicitly created message loop. The main thread is
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 * 262 *
261 * @return 263 * @return
262 * - PP_OK: The request to quit was successfully posted. 264 * - PP_OK: The request to quit was successfully posted.
263 * - PP_ERROR_BADRESOURCE: The message loop was invalid. 265 * - PP_ERROR_BADRESOURCE: The message loop was invalid.
264 * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. 266 * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread.
265 * The main thread's message loop is managed by the system and can't be 267 * The main thread's message loop is managed by the system and can't be
266 * quit. 268 * quit.
267 */ 269 */
268 int32_t PostQuit([in] PP_Resource message_loop, PP_Bool should_destroy); 270 int32_t PostQuit([in] PP_Resource message_loop, PP_Bool should_destroy);
269 }; 271 };
OLDNEW
« no previous file with comments | « ppapi/api/ppb_input_event.idl ('k') | ppapi/api/private/ppb_content_decryptor_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698