OLD | NEW |
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 // This object runs on a thread and knows how to interpret messages sent by the | 5 // This object runs on a thread and knows how to interpret messages sent by the |
6 // talk mediator. The mediator posts messages to a queue which the thread polls | 6 // talk mediator. The mediator posts messages to a queue which the thread polls |
7 // (in a super class). | 7 // (in a super class). |
8 // | 8 // |
9 // Example usage: | 9 // Example usage: |
10 // | 10 // |
11 // MediatorThread m = new MediatorThreadImpl(pass in stuff); | 11 // MediatorThread m = new MediatorThreadImpl(pass in stuff); |
12 // m.start(); // Start the thread | 12 // m.start(); // Start the thread |
13 // // Once the thread is started, you can do server stuff. | 13 // // Once the thread is started, you can do server stuff. |
14 // m.Login(loginInformation); | 14 // m.Login(loginInformation); |
15 // // Events happen, the mediator finds out through its pump more messages | 15 // // Events happen, the mediator finds out through its pump more messages |
16 // // are dispatched to the thread eventually we want to log out. | 16 // // are dispatched to the thread eventually we want to log out. |
17 // m.Logout(); | 17 // m.Logout(); |
18 // delete m; // Also stops the thread. | 18 // delete m; // Also stops the thread. |
19 | 19 |
20 #ifndef JINGLE_NOTIFIER_LISTENER_MEDIATOR_THREAD_IMPL_H_ | 20 #ifndef JINGLE_NOTIFIER_LISTENER_MEDIATOR_THREAD_IMPL_H_ |
21 #define JINGLE_NOTIFIER_LISTENER_MEDIATOR_THREAD_IMPL_H_ | 21 #define JINGLE_NOTIFIER_LISTENER_MEDIATOR_THREAD_IMPL_H_ |
22 | 22 |
23 #include <string> | 23 #include <string> |
24 #include <vector> | 24 #include <vector> |
25 | 25 |
26 #include "base/basictypes.h" | 26 #include "base/basictypes.h" |
27 #include "base/compiler_specific.h" | 27 #include "base/compiler_specific.h" |
28 #include "base/memory/ref_counted.h" | 28 #include "base/memory/ref_counted.h" |
29 #include "base/memory/weak_ptr.h" | 29 #include "base/memory/weak_ptr.h" |
30 #include "base/task.h" | |
31 #include "jingle/notifier/base/notifier_options.h" | 30 #include "jingle/notifier/base/notifier_options.h" |
32 #include "jingle/notifier/listener/mediator_thread.h" | 31 #include "jingle/notifier/listener/mediator_thread.h" |
33 | 32 |
34 namespace base { | 33 namespace base { |
35 class MessageLoopProxy; | 34 class MessageLoopProxy; |
36 } | 35 } |
37 | 36 |
38 namespace buzz { | 37 namespace buzz { |
39 class XmppClientSettings; | 38 class XmppClientSettings; |
40 class XmppTaskParentInterface; | 39 class XmppTaskParentInterface; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 class Core; | 82 class Core; |
84 scoped_refptr<Core> core_; | 83 scoped_refptr<Core> core_; |
85 scoped_refptr<base::MessageLoopProxy> parent_message_loop_proxy_; | 84 scoped_refptr<base::MessageLoopProxy> parent_message_loop_proxy_; |
86 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 85 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
87 DISALLOW_COPY_AND_ASSIGN(MediatorThreadImpl); | 86 DISALLOW_COPY_AND_ASSIGN(MediatorThreadImpl); |
88 }; | 87 }; |
89 | 88 |
90 } // namespace notifier | 89 } // namespace notifier |
91 | 90 |
92 #endif // JINGLE_NOTIFIER_LISTENER_MEDIATOR_THREAD_IMPL_H_ | 91 #endif // JINGLE_NOTIFIER_LISTENER_MEDIATOR_THREAD_IMPL_H_ |
OLD | NEW |