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 #ifndef REMOTING_PROTOCOL_SESSION_H_ | 5 #ifndef REMOTING_PROTOCOL_SESSION_H_ |
6 #define REMOTING_PROTOCOL_SESSION_H_ | 6 #define REMOTING_PROTOCOL_SESSION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // Created, but not connecting yet. | 34 // Created, but not connecting yet. |
35 INITIALIZING, | 35 INITIALIZING, |
36 | 36 |
37 // Sent or received session-initiate, but haven't sent or received | 37 // Sent or received session-initiate, but haven't sent or received |
38 // session-accept. | 38 // session-accept. |
39 CONNECTING, | 39 CONNECTING, |
40 | 40 |
41 // Session has been accepted, but channels are connected yet. | 41 // Session has been accepted, but channels are connected yet. |
42 CONNECTED, | 42 CONNECTED, |
43 | 43 |
44 // Video and control channels are connected. | |
45 // TODO(sergeyu): Remove this state. | |
46 CONNECTED_CHANNELS, | |
47 | |
48 // Session has been closed. | 44 // Session has been closed. |
49 CLOSED, | 45 CLOSED, |
50 | 46 |
51 // Connection has failed. | 47 // Connection has failed. |
52 FAILED, | 48 FAILED, |
53 }; | 49 }; |
54 | 50 |
55 // TODO(sergeyu): Move error codes to a separate file. | 51 // TODO(sergeyu): Move error codes to a separate file. |
56 enum Error { | 52 enum Error { |
57 OK = 0, | 53 OK = 0, |
(...skipping 30 matching lines...) Expand all Loading... |
88 virtual void CreateStreamChannel( | 84 virtual void CreateStreamChannel( |
89 const std::string& name, const StreamChannelCallback& callback) = 0; | 85 const std::string& name, const StreamChannelCallback& callback) = 0; |
90 virtual void CreateDatagramChannel( | 86 virtual void CreateDatagramChannel( |
91 const std::string& name, const DatagramChannelCallback& callback) = 0; | 87 const std::string& name, const DatagramChannelCallback& callback) = 0; |
92 | 88 |
93 // Cancels a pending CreateStreamChannel() or CreateDatagramChannel() | 89 // Cancels a pending CreateStreamChannel() or CreateDatagramChannel() |
94 // operation for the named channel. If the channel creation already | 90 // operation for the named channel. If the channel creation already |
95 // completed then cancelling it has no effect. | 91 // completed then cancelling it has no effect. |
96 virtual void CancelChannelCreation(const std::string& name) = 0; | 92 virtual void CancelChannelCreation(const std::string& name) = 0; |
97 | 93 |
98 // TODO(sergeyu): Remove these methods, and use CreateChannel() | |
99 // instead. | |
100 virtual net::Socket* control_channel() = 0; | |
101 virtual net::Socket* event_channel() = 0; | |
102 | |
103 // JID of the other side. | 94 // JID of the other side. |
104 virtual const std::string& jid() = 0; | 95 virtual const std::string& jid() = 0; |
105 | 96 |
106 // Configuration of the protocol that was sent or received in the | 97 // Configuration of the protocol that was sent or received in the |
107 // session-initiate jingle message. Returned pointer is valid until | 98 // session-initiate jingle message. Returned pointer is valid until |
108 // connection is closed. | 99 // connection is closed. |
109 virtual const CandidateSessionConfig* candidate_config() = 0; | 100 virtual const CandidateSessionConfig* candidate_config() = 0; |
110 | 101 |
111 // Protocol configuration. Can be called only after session has been accepted. | 102 // Protocol configuration. Can be called only after session has been accepted. |
112 // Returned pointer is valid until connection is closed. | 103 // Returned pointer is valid until connection is closed. |
(...skipping 20 matching lines...) Expand all Loading... |
133 virtual void Close() = 0; | 124 virtual void Close() = 0; |
134 | 125 |
135 private: | 126 private: |
136 DISALLOW_COPY_AND_ASSIGN(Session); | 127 DISALLOW_COPY_AND_ASSIGN(Session); |
137 }; | 128 }; |
138 | 129 |
139 } // namespace protocol | 130 } // namespace protocol |
140 } // namespace remoting | 131 } // namespace remoting |
141 | 132 |
142 #endif // REMOTING_PROTOCOL_SESSION_H_ | 133 #endif // REMOTING_PROTOCOL_SESSION_H_ |
OLD | NEW |