diff options
Diffstat (limited to 'jingle/notifier/base/task_pump.cc')
-rw-r--r-- | jingle/notifier/base/task_pump.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/jingle/notifier/base/task_pump.cc b/jingle/notifier/base/task_pump.cc index 52ffd26..9423ffa 100644 --- a/jingle/notifier/base/task_pump.cc +++ b/jingle/notifier/base/task_pump.cc @@ -12,12 +12,17 @@ TaskPump::TaskPump() ALLOW_THIS_IN_INITIALIZER_LIST(this)), posted_wake_(false) {} -TaskPump::~TaskPump() {} +TaskPump::~TaskPump() { + DCHECK(non_thread_safe_.CalledOnValidThread()); +} void TaskPump::WakeTasks() { + DCHECK(non_thread_safe_.CalledOnValidThread()); if (!posted_wake_) { + MessageLoop* current_message_loop = MessageLoop::current(); + CHECK(current_message_loop); // Do the requested wake up. - MessageLoop::current()->PostTask( + current_message_loop->PostTask( FROM_HERE, scoped_runnable_method_factory_.NewRunnableMethod( &TaskPump::CheckAndRunTasks)); @@ -26,12 +31,14 @@ void TaskPump::WakeTasks() { } int64 TaskPump::CurrentTime() { + DCHECK(non_thread_safe_.CalledOnValidThread()); // Only timeout tasks rely on this function. Since we're not using // libjingle tasks for timeout, it's safe to return 0 here. return 0; } void TaskPump::CheckAndRunTasks() { + DCHECK(non_thread_safe_.CalledOnValidThread()); posted_wake_ = false; // We shouldn't be using libjingle for timeout tasks, so we should // have no timeout tasks at all. |