OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // A simple wrapper around invalidation::InvalidationClient that | 5 // A stand-in for stuff that expects a weak pointer to a BaseTask for |
6 // handles all the startup/shutdown details and hookups. | 6 // testing. |
7 | 7 |
8 #ifndef JINGLE_NOTIFIER_FAKE_XMPP_CLIENT_H_ | 8 #ifndef JINGLE_NOTIFIER_FAKE_XMPP_CLIENT_H_ |
9 #define JINGLE_NOTIFIER_FAKE_XMPP_CLIENT_H_ | 9 #define JINGLE_NOTIFIER_FAKE_XMPP_CLIENT_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/weak_ptr.h" | 13 #include "base/weak_ptr.h" |
14 #include "jingle/notifier/base/task_pump.h" | 14 #include "jingle/notifier/base/task_pump.h" |
15 | 15 |
16 namespace talk_base { | 16 namespace talk_base { |
17 class Task; | 17 class Task; |
18 } // namespace talk_base | 18 } // namespace talk_base |
19 | 19 |
20 namespace notifier { | 20 namespace notifier { |
21 | 21 |
22 // This class expects a message loop to exist on the current thread. | |
23 class FakeBaseTask { | 22 class FakeBaseTask { |
24 public: | 23 public: |
25 FakeBaseTask(); | 24 FakeBaseTask(); |
26 | 25 |
27 base::WeakPtr<talk_base::Task> AsWeakPtr(); | 26 base::WeakPtr<talk_base::Task> AsWeakPtr(); |
28 | 27 |
29 private: | 28 private: |
30 notifier::TaskPump task_pump_; | 29 notifier::TaskPump task_pump_; |
31 base::WeakPtr<talk_base::Task> base_task_; | 30 base::WeakPtr<talk_base::Task> base_task_; |
32 | 31 |
33 DISALLOW_COPY_AND_ASSIGN(FakeBaseTask); | 32 DISALLOW_COPY_AND_ASSIGN(FakeBaseTask); |
34 }; | 33 }; |
35 | 34 |
36 } // namespace notifier | 35 } // namespace notifier |
37 | 36 |
38 #endif // JINGLE_NOTIFIER_FAKE_XMPP_CLIENT_H_ | 37 #endif // JINGLE_NOTIFIER_FAKE_XMPP_CLIENT_H_ |
OLD | NEW |