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

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

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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/input_sender.cc ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 REMOTING_PROTOCOL_JINGLE_SESSION_H_ 5 #ifndef REMOTING_PROTOCOL_JINGLE_SESSION_H_
6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_ 6 #define REMOTING_PROTOCOL_JINGLE_SESSION_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "crypto/rsa_private_key.h" 10 #include "crypto/rsa_private_key.h"
11 #include "net/base/completion_callback.h" 11 #include "net/base/completion_callback.h"
12 #include "remoting/protocol/session.h" 12 #include "remoting/protocol/session.h"
13 #include "third_party/libjingle/source/talk/base/sigslot.h" 13 #include "third_party/libjingle/source/talk/base/sigslot.h"
14 #include "third_party/libjingle/source/talk/p2p/base/session.h" 14 #include "third_party/libjingle/source/talk/p2p/base/session.h"
15 15
16 namespace remoting { 16 namespace remoting {
17 17
18 namespace protocol { 18 namespace protocol {
19 19
20 class JingleChannelConnector; 20 class JingleChannelConnector;
21 class JingleSessionManager; 21 class JingleSessionManager;
22 22
23 // Implements protocol::Session that work over libjingle session (the 23 // Implements protocol::Session that work over libjingle session (the
24 // cricket::Session object is passed to Init() method). Created 24 // cricket::Session object is passed to Init() method). Created
25 // by JingleSessionManager for incoming and outgoing connections. 25 // by JingleSessionManager for incoming and outgoing connections.
26 class JingleSession : public protocol::Session, 26 class JingleSession : public protocol::Session,
27 public sigslot::has_slots<> { 27 public sigslot::has_slots<> {
28 public: 28 public:
29 // Session interface. 29 // Session interface.
30 virtual void SetStateChangeCallback(StateChangeCallback* callback) OVERRIDE; 30 virtual void SetStateChangeCallback(
31 const StateChangeCallback& callback) OVERRIDE;
31 virtual Error error() OVERRIDE; 32 virtual Error error() OVERRIDE;
32 virtual void CreateStreamChannel( 33 virtual void CreateStreamChannel(
33 const std::string& name, 34 const std::string& name,
34 const StreamChannelCallback& callback) OVERRIDE; 35 const StreamChannelCallback& callback) OVERRIDE;
35 virtual void CreateDatagramChannel( 36 virtual void CreateDatagramChannel(
36 const std::string& name, 37 const std::string& name,
37 const DatagramChannelCallback& callback) OVERRIDE; 38 const DatagramChannelCallback& callback) OVERRIDE;
38 virtual net::Socket* control_channel() OVERRIDE; 39 virtual net::Socket* control_channel() OVERRIDE;
39 virtual net::Socket* event_channel() OVERRIDE; 40 virtual net::Socket* event_channel() OVERRIDE;
40 virtual const std::string& jid() OVERRIDE; 41 virtual const std::string& jid() OVERRIDE;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 scoped_ptr<crypto::RSAPrivateKey> local_private_key_; 143 scoped_ptr<crypto::RSAPrivateKey> local_private_key_;
143 144
144 // Public key of the peer. 145 // Public key of the peer.
145 std::string peer_public_key_; 146 std::string peer_public_key_;
146 147
147 // Shared secret to use in channel authentication. This is currently only 148 // Shared secret to use in channel authentication. This is currently only
148 // used in IT2Me. 149 // used in IT2Me.
149 std::string shared_secret_; 150 std::string shared_secret_;
150 151
151 State state_; 152 State state_;
152 scoped_ptr<StateChangeCallback> state_change_callback_; 153 StateChangeCallback state_change_callback_;
153 154
154 Error error_; 155 Error error_;
155 156
156 bool closing_; 157 bool closing_;
157 158
158 // JID of the other side. Set when the connection is initialized, 159 // JID of the other side. Set when the connection is initialized,
159 // and never changed after that. 160 // and never changed after that.
160 std::string jid_; 161 std::string jid_;
161 162
162 // The corresponding libjingle session. 163 // The corresponding libjingle session.
(...skipping 17 matching lines...) Expand all
180 ScopedRunnableMethodFactory<JingleSession> task_factory_; 181 ScopedRunnableMethodFactory<JingleSession> task_factory_;
181 182
182 DISALLOW_COPY_AND_ASSIGN(JingleSession); 183 DISALLOW_COPY_AND_ASSIGN(JingleSession);
183 }; 184 };
184 185
185 } // namespace protocol 186 } // namespace protocol
186 187
187 } // namespace remoting 188 } // namespace remoting
188 189
189 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_ 190 #endif // REMOTING_PROTOCOL_JINGLE_SESSION_H_
OLDNEW
« no previous file with comments | « remoting/protocol/input_sender.cc ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698