OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The purpose of SessionManager is to facilitate creation of chromotocol | 5 // The purpose of SessionManager is to facilitate creation of chromotocol |
6 // sessions. Both host and client use it to establish chromotocol | 6 // sessions. Both host and client use it to establish chromotocol |
7 // sessions. JingleChromotocolServer implements this inteface using | 7 // sessions. JingleChromotocolServer implements this inteface using |
8 // libjingle. | 8 // libjingle. |
9 // | 9 // |
10 // OUTGOING SESSIONS | 10 // OUTGOING SESSIONS |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 #include <string> | 56 #include <string> |
57 | 57 |
58 #include "base/callback.h" | 58 #include "base/callback.h" |
59 #include "base/macros.h" | 59 #include "base/macros.h" |
60 #include "base/threading/non_thread_safe.h" | 60 #include "base/threading/non_thread_safe.h" |
61 #include "remoting/protocol/session.h" | 61 #include "remoting/protocol/session.h" |
62 | 62 |
63 namespace remoting { | 63 namespace remoting { |
64 | 64 |
| 65 class SignalingAddress; |
65 class SignalStrategy; | 66 class SignalStrategy; |
66 | 67 |
67 namespace protocol { | 68 namespace protocol { |
68 | 69 |
69 class Authenticator; | 70 class Authenticator; |
70 class AuthenticatorFactory; | 71 class AuthenticatorFactory; |
71 | 72 |
72 // Generic interface for Chromoting session manager. | 73 // Generic interface for Chromoting session manager. |
73 class SessionManager : public base::NonThreadSafe { | 74 class SessionManager : public base::NonThreadSafe { |
74 public: | 75 public: |
(...skipping 26 matching lines...) Expand all Loading... |
101 | 102 |
102 // Starts accepting incoming connections. | 103 // Starts accepting incoming connections. |
103 virtual void AcceptIncoming( | 104 virtual void AcceptIncoming( |
104 const IncomingSessionCallback& incoming_session_callback) = 0; | 105 const IncomingSessionCallback& incoming_session_callback) = 0; |
105 | 106 |
106 // Sets local protocol configuration to be used when negotiating outgoing and | 107 // Sets local protocol configuration to be used when negotiating outgoing and |
107 // incoming connections. | 108 // incoming connections. |
108 virtual void set_protocol_config( | 109 virtual void set_protocol_config( |
109 std::unique_ptr<CandidateSessionConfig> config) = 0; | 110 std::unique_ptr<CandidateSessionConfig> config) = 0; |
110 | 111 |
111 // Tries to create a session to the host |jid|. | 112 // Creates a new outgoing session. |
112 // | 113 // |
113 // |host_jid| is the full jid of the host to connect to. | 114 // |peer_address| - full SignalingAddress to connect to. |
114 // |authenticator| is a client authenticator for the session. | 115 // |authenticator| - client authenticator for the session. |
115 virtual std::unique_ptr<Session> Connect( | 116 virtual std::unique_ptr<Session> Connect( |
116 const std::string& host_jid, | 117 const SignalingAddress& peer_address, |
117 std::unique_ptr<Authenticator> authenticator) = 0; | 118 std::unique_ptr<Authenticator> authenticator) = 0; |
118 | 119 |
119 // Set authenticator factory that should be used to authenticate | 120 // Set authenticator factory that should be used to authenticate |
120 // incoming connection. No connections will be accepted if | 121 // incoming connection. No connections will be accepted if |
121 // authenticator factory isn't set. Must not be called more than | 122 // authenticator factory isn't set. Must not be called more than |
122 // once per SessionManager because it may not be safe to delete | 123 // once per SessionManager because it may not be safe to delete |
123 // factory before all authenticators it created are deleted. | 124 // factory before all authenticators it created are deleted. |
124 virtual void set_authenticator_factory( | 125 virtual void set_authenticator_factory( |
125 std::unique_ptr<AuthenticatorFactory> authenticator_factory) = 0; | 126 std::unique_ptr<AuthenticatorFactory> authenticator_factory) = 0; |
126 | 127 |
127 private: | 128 private: |
128 DISALLOW_COPY_AND_ASSIGN(SessionManager); | 129 DISALLOW_COPY_AND_ASSIGN(SessionManager); |
129 }; | 130 }; |
130 | 131 |
131 } // namespace protocol | 132 } // namespace protocol |
132 } // namespace remoting | 133 } // namespace remoting |
133 | 134 |
134 #endif // REMOTING_PROTOCOL_SESSION_MANAGER_H_ | 135 #endif // REMOTING_PROTOCOL_SESSION_MANAGER_H_ |
OLD | NEW |