summaryrefslogtreecommitdiffstats
path: root/jingle/notifier/base/task_pump.cc
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 09:23:27 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 09:23:27 +0000
commit01f91e825511800dde18826d979cbc4d39c5862d (patch)
tree7f9734e9e108216a11dd52748dafdf2f306f297e /jingle/notifier/base/task_pump.cc
parent2b82c0d249fe3753e198567e505db9baade30136 (diff)
downloadchromium_src-01f91e825511800dde18826d979cbc4d39c5862d.zip
chromium_src-01f91e825511800dde18826d979cbc4d39c5862d.tar.gz
chromium_src-01f91e825511800dde18826d979cbc4d39c5862d.tar.bz2
Refactored handling of XmppClient.
Added new classes WeakXmppClient and XmppConnection, which let me simplify MediatorThreadImpl et al. BUG=55302 TEST=new unit tests, manually Review URL: http://codereview.chromium.org/3290025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/notifier/base/task_pump.cc')
-rw-r--r--jingle/notifier/base/task_pump.cc11
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.