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

Side by Side Diff: remoting/protocol/session_manager_pair.h

Issue 7291016: Remove SessionManagerPair. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 9 years, 5 months 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
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/session_manager_pair.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // SessionManagerPair class is used by unittests to create a pair of session
6 // managers connected to each other. These session managers are then can be
7 // passed to a pair of JingleChromotocolConnection objects, so that it is
8 // possible to simulate connection between host and client.
9
10 #ifndef REMOTING_PROTOCOL_MOCK_SESSION_MANAGER_H_
11 #define REMOTING_PROTOCOL_MOCK_SESSION_MANAGER_H_
12
13 #include <base/memory/ref_counted.h>
14 #include <base/memory/scoped_ptr.h>
15
16 #include "third_party/libjingle/source/talk/base/sigslot.h"
17
18 class MessageLoop;
19
20 namespace buzz {
21 class XmlElement;
22 } // namespace buzz
23
24 namespace cricket {
25 class BasicPortAllocator;
26 class SessionManager;
27 } // namespace cricket
28
29 namespace talk_base {
30 class NetworkManager;
31 class PacketSocketFactory;
32 } // namespace talk_base
33
34 namespace remoting {
35
36 class JingleThread;
37
38 class SessionManagerPair
39 : public sigslot::has_slots<>,
40 public base::RefCountedThreadSafe<SessionManagerPair>{
41 public:
42 static const char kHostJid[];
43 static const char kClientJid[];
44
45 SessionManagerPair(JingleThread* thread);
46 virtual ~SessionManagerPair();
47
48 void Init();
49
50 // The session managers are named 'host' and 'client' just for convenience.
51 // Both can be used for client or host.
52 cricket::SessionManager* host_session_manager();
53 cricket::SessionManager* client_session_manager();
54
55 private:
56 void ProcessMessage(cricket::SessionManager* manager,
57 const buzz::XmlElement* stanza);
58 void DoProcessMessage(cricket::SessionManager* manager,
59 buzz::XmlElement* stanza);
60 void DeliverMessage(cricket::SessionManager* to,
61 buzz::XmlElement* stanza);
62
63 MessageLoop* message_loop_;
64 scoped_ptr<talk_base::NetworkManager> network_manager_;
65 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_;
66 scoped_ptr<cricket::BasicPortAllocator> port_allocator_;
67 scoped_ptr<cricket::SessionManager> host_session_manager_;
68 scoped_ptr<cricket::SessionManager> client_session_manager_;
69 };
70
71 } // namespace remoting
72
73 #endif // REMOTING_PROTOCOL_MOCK_SESSION_MANAGER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session_unittest.cc ('k') | remoting/protocol/session_manager_pair.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698