Chromium Code Reviews| Index: ppapi/cpp/message_loop.h |
| diff --git a/ppapi/cpp/message_loop.h b/ppapi/cpp/message_loop.h |
| index 9e28b2d835b18b3d92786e78c7750b4545934446..ef27d91569efdf7fe78c2d212629e2a0ffa35aa1 100644 |
| --- a/ppapi/cpp/message_loop.h |
| +++ b/ppapi/cpp/message_loop.h |
| @@ -7,6 +7,10 @@ |
| #include "ppapi/cpp/resource.h" |
| +/// @file |
| +/// This file defines the PPB_MessageLoop API, which is used to allow |
| +/// PPAPI calls from any thread |
|
dmichael (off chromium)
2013/05/30 22:35:33
nit: I'd just leave off the ", which is used..." p
Andy
2013/05/30 22:49:05
Done.
|
| + |
| namespace pp { |
| class CompletionCallback; |
| @@ -39,13 +43,15 @@ class InstanceHandle; |
| /// - Call Run() with the message loop resource. |
| /// |
| /// Your callbacks should look like this: |
| -/// void DoMyWork(void* user_data, int32_t status) { |
| -/// if (status != PP_OK) { |
| -/// Cleanup(); // e.g. free user_data. |
| -/// return; |
| -/// } |
| -/// ... do your work... |
| -/// } |
| +/// @code |
| +/// void DoMyWork(void* user_data, int32_t status) { |
| +/// if (status != PP_OK) { |
| +/// Cleanup(); // e.g. free user_data. |
| +/// return; |
| +/// } |
| +/// ... do your work... |
| +/// } |
| +/// @endcode |
| /// For a C++ example, see ppapi/utility/threading/simple_thread.h |
| /// |
| /// (You can also create the message loop resource on the background thread, |
| @@ -116,12 +122,12 @@ class InstanceHandle; |
| /// Therefore, you should check for errors from PostWork and destroy any |
| /// associated memory to avoid leaks. If you're using the C++ |
| /// CompletionCallbackFactory, use the following pattern: |
| -/// |
| -/// pp::CompletionCallback callback = factory_.NewOptionalCallback(...); |
| -/// int32_t result = message_loop.PostWork(callback); |
| -/// if (result != PP_OK) |
| -/// callback.Run(result); |
| -/// |
| +/// @code |
| +/// pp::CompletionCallback callback = factory_.NewOptionalCallback(...); |
| +/// int32_t result = message_loop.PostWork(callback); |
| +/// if (result != PP_OK) |
| +/// callback.Run(result); |
| +/// @endcode |
| /// This will run the callback with an error value, and assumes that the |
| /// implementation of your callback checks the "result" argument and returns |
| /// immediately on error. |