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 #ifndef PPAPI_CPP_MESSAGE_LOOP_H_ | 5 #ifndef PPAPI_CPP_MESSAGE_LOOP_H_ |
6 #define PPAPI_CPP_MESSAGE_LOOP_H_ | 6 #define PPAPI_CPP_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include "ppapi/cpp/resource.h" | 8 #include "ppapi/cpp/resource.h" |
9 | 9 |
10 /// @file | 10 /// @file |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 /// (You can also create the message loop resource on the background thread, | 56 /// (You can also create the message loop resource on the background thread, |
57 /// but then the main thread will have no reference to it should you want to | 57 /// but then the main thread will have no reference to it should you want to |
58 /// call PostWork()). | 58 /// call PostWork()). |
59 /// | 59 /// |
60 /// | 60 /// |
61 /// THREAD HANDLING | 61 /// THREAD HANDLING |
62 /// | 62 /// |
63 /// The main thread has an implicitly created message loop. The main thread is | 63 /// The main thread has an implicitly created message loop. The main thread is |
64 /// the thread where PPP_InitializeModule and PPP_Instance functions are called. | 64 /// the thread where PPP_InitializeModule and PPP_Instance functions are called. |
65 /// You can retrieve a reference to this message loop by calling | 65 /// You can retrieve a reference to this message loop by calling |
66 /// GetForMainThread() or, if your code is on the main thread, | 66 /// GetForMainThread() or, if your code is on the main thread, GetCurrent() will |
67 /// GetForCurrentThread() will also work. | 67 /// also work. |
68 /// | 68 /// |
69 /// Some special threads created by the system can not have message loops. In | 69 /// Some special threads created by the system can not have message loops. In |
70 /// particular, the background thread created for audio processing has this | 70 /// particular, the background thread created for audio processing has this |
71 /// requirement because it's intended to be highly responsive to keep up with | 71 /// requirement because it's intended to be highly responsive to keep up with |
72 /// the realtime requirements of audio processing. You can not make PPAPI calls | 72 /// the realtime requirements of audio processing. You can not make PPAPI calls |
73 /// from these threads. | 73 /// from these threads. |
74 /// | 74 /// |
75 /// Once you associate a message loop with a thread, you don't have to keep a | 75 /// Once you associate a message loop with a thread, you don't have to keep a |
76 /// reference to it. The system will hold a reference to the message loop for as | 76 /// reference to it. The system will hold a reference to the message loop for as |
77 /// long as the thread is running. The current message loop can be retrieved | 77 /// long as the thread is running. The current message loop can be retrieved |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 /// - PP_ERROR_BADRESOURCE: The message loop was invalid. | 259 /// - PP_ERROR_BADRESOURCE: The message loop was invalid. |
260 /// - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. | 260 /// - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. |
261 /// The main thread's message loop is managed by the system and can't be | 261 /// The main thread's message loop is managed by the system and can't be |
262 /// quit. | 262 /// quit. |
263 int32_t PostQuit(bool should_destroy); | 263 int32_t PostQuit(bool should_destroy); |
264 }; | 264 }; |
265 | 265 |
266 } // namespace pp | 266 } // namespace pp |
267 | 267 |
268 #endif // PPAPI_CPP_MESSAGE_LOOP_H_ | 268 #endif // PPAPI_CPP_MESSAGE_LOOP_H_ |
OLD | NEW |