| Index: ppapi/shared_impl/tracked_callback.h
|
| diff --git a/ppapi/shared_impl/tracked_callback.h b/ppapi/shared_impl/tracked_callback.h
|
| index 1fa7b1bce88a1bf688e61891ded618638c614864..03bf1626e30882cf09b986c8f7f61f28388cce3c 100644
|
| --- a/ppapi/shared_impl/tracked_callback.h
|
| +++ b/ppapi/shared_impl/tracked_callback.h
|
| @@ -16,10 +16,12 @@
|
| #include "ppapi/c/pp_instance.h"
|
| #include "ppapi/c/pp_resource.h"
|
| #include "ppapi/shared_impl/ppapi_shared_export.h"
|
| +#include "ppapi/shared_impl/ppb_message_loop_shared.h"
|
|
|
| namespace ppapi {
|
|
|
| class CallbackTracker;
|
| +class MessageLoopShared;
|
| class Resource;
|
|
|
| namespace thunk {
|
| @@ -76,7 +78,6 @@ class PPAPI_SHARED_EXPORT TrackedCallback
|
| // Run() will invoke the call immediately, if invoked from the target thread
|
| // (as determined by target_loop_). If invoked on a different thread, the
|
| // callback will be scheduled to run later on target_loop_.
|
| - // TODO(dmichael): Make the above part about different threads actually true.
|
| void Run(int32_t result);
|
| // PostRun is like Run(), except it guarantees that the callback will be run
|
| // later. In particular, if you invoke PostRun on the same thread on which the
|
| @@ -116,6 +117,9 @@ class PPAPI_SHARED_EXPORT TrackedCallback
|
| return (callback_.func &&
|
| (callback_.flags & PP_COMPLETIONCALLBACK_FLAG_OPTIONAL));
|
| }
|
| + bool has_null_target_loop() const {
|
| + return target_loop_ == NULL;
|
| + }
|
|
|
| private:
|
| // TrackedCallback and EnterBase manage dealing with how to invoke callbacks
|
| @@ -146,6 +150,10 @@ class PPAPI_SHARED_EXPORT TrackedCallback
|
| bool aborted_;
|
| PP_CompletionCallback callback_;
|
|
|
| + // The MessageLoopShared on which this callback should be run. This will be
|
| + // NULL if we're in-process.
|
| + scoped_refptr<MessageLoopShared> target_loop_;
|
| +
|
| int32_t result_for_blocked_callback_;
|
| // Used for pausing/waking the blocked thread if this is a blocking completion
|
| // callback. Note that in-process, there is no lock, blocking callbacks are
|
|
|