Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: jingle/notifier/base/task_pump.h

Issue 8551004: base::Bind: Convert jingle/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 JINGLE_NOTIFIER_BASE_TASK_PUMP_H_ 5 #ifndef JINGLE_NOTIFIER_BASE_TASK_PUMP_H_
6 #define JINGLE_NOTIFIER_BASE_TASK_PUMP_H_ 6 #define JINGLE_NOTIFIER_BASE_TASK_PUMP_H_
7 7
8 #include "base/memory/weak_ptr.h"
8 #include "base/task.h" 9 #include "base/task.h"
9 #include "base/threading/non_thread_safe.h" 10 #include "base/threading/non_thread_safe.h"
10 #include "talk/base/taskrunner.h" 11 #include "talk/base/taskrunner.h"
11 12
12 namespace notifier { 13 namespace notifier {
13 14
14 class TaskPump : public talk_base::TaskRunner { 15 class TaskPump : public talk_base::TaskRunner {
15 public: 16 public:
16 TaskPump(); 17 TaskPump();
17 18
18 virtual ~TaskPump(); 19 virtual ~TaskPump();
19 20
20 // talk_base::TaskRunner implementation. 21 // talk_base::TaskRunner implementation.
21 virtual void WakeTasks(); 22 virtual void WakeTasks();
22 virtual int64 CurrentTime(); 23 virtual int64 CurrentTime();
23 24
24 // No tasks will be processed after this is called, even if 25 // No tasks will be processed after this is called, even if
25 // WakeTasks() is called. 26 // WakeTasks() is called.
26 void Stop(); 27 void Stop();
27 28
28 private: 29 private:
29 void CheckAndRunTasks(); 30 void CheckAndRunTasks();
30 31
31 base::NonThreadSafe non_thread_safe_; 32 base::NonThreadSafe non_thread_safe_;
32 ScopedRunnableMethodFactory<TaskPump> scoped_runnable_method_factory_; 33 base::WeakPtrFactory<TaskPump> weak_factory_;
33 bool posted_wake_; 34 bool posted_wake_;
34 bool stopped_; 35 bool stopped_;
35 36
36 DISALLOW_COPY_AND_ASSIGN(TaskPump); 37 DISALLOW_COPY_AND_ASSIGN(TaskPump);
37 }; 38 };
38 39
39 } // namespace notifier 40 } // namespace notifier
40 41
41 #endif // JINGLE_NOTIFIER_BASE_TASK_PUMP_H_ 42 #endif // JINGLE_NOTIFIER_BASE_TASK_PUMP_H_
OLDNEW
« no previous file with comments | « jingle/notifier/base/proxy_resolving_client_socket.cc ('k') | jingle/notifier/base/task_pump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698