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 #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 "remoting/protocol/errors.h" | 10 #include "remoting/protocol/errors.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // or CLOSED or FAILED. | 61 // or CLOSED or FAILED. |
62 virtual void OnSessionStateChange(State state) = 0; | 62 virtual void OnSessionStateChange(State state) = 0; |
63 | 63 |
64 // Called whenever route for the channel specified with | 64 // Called whenever route for the channel specified with |
65 // |channel_name| changes. Session must not be destroyed by the | 65 // |channel_name| changes. Session must not be destroyed by the |
66 // handler of this event. | 66 // handler of this event. |
67 virtual void OnSessionRouteChange(const std::string& channel_name, | 67 virtual void OnSessionRouteChange(const std::string& channel_name, |
68 const TransportRoute& route) = 0; | 68 const TransportRoute& route) = 0; |
69 }; | 69 }; |
70 | 70 |
71 | |
72 Session() {} | 71 Session() {} |
73 virtual ~Session() {} | 72 virtual ~Session() {} |
74 | 73 |
75 // Set event handler for this session. |event_handler| must outlive | 74 // Set event handler for this session. |event_handler| must outlive |
76 // this object. | 75 // this object. |
77 virtual void SetEventHandler(EventHandler* event_handler) = 0; | 76 virtual void SetEventHandler(EventHandler* event_handler) = 0; |
78 | 77 |
79 // Returns error code for a failed session. | 78 // Returns error code for a failed session. |
80 virtual ErrorCode error() = 0; | 79 virtual ErrorCode error() = 0; |
81 | 80 |
82 // JID of the other side. | 81 // JID of the other side. |
83 virtual const std::string& jid() = 0; | 82 virtual const std::string& jid() = 0; |
84 | 83 |
85 // Protocol configuration. Can be called only after session has been accepted. | 84 // Protocol configuration. Can be called only after session has been accepted. |
86 // Returned pointer is valid until connection is closed. | 85 // Returned pointer is valid until connection is closed. |
87 virtual const SessionConfig& config() = 0; | 86 virtual const SessionConfig& config() = 0; |
88 | 87 |
89 // GetTransportChannelFactory() returns a factory that creates a new transport | 88 // GetTransportChannelFactory() returns a factory that creates a new transport |
90 // channel for each logical channel. GetMultiplexedChannelFactory() channels | 89 // channel for each logical channel. GetMultiplexedChannelFactory() channels |
91 // share a single underlying transport channel | 90 // share a single underlying transport channel |
92 virtual StreamChannelFactory* GetTransportChannelFactory() = 0; | 91 virtual StreamChannelFactory* GetTransportChannelFactory() = 0; |
93 virtual StreamChannelFactory* GetMultiplexedChannelFactory() = 0; | 92 virtual StreamChannelFactory* GetMultiplexedChannelFactory() = 0; |
| 93 virtual StreamChannelFactory* GetQuicChannelFactory() = 0; |
94 | 94 |
95 // Closes connection. Callbacks are guaranteed not to be called | 95 // Closes connection. Callbacks are guaranteed not to be called |
96 // after this method returns. Must be called before the object is | 96 // after this method returns. Must be called before the object is |
97 // destroyed, unless the state is set to FAILED or CLOSED. | 97 // destroyed, unless the state is set to FAILED or CLOSED. |
98 virtual void Close() = 0; | 98 virtual void Close() = 0; |
99 | 99 |
100 private: | 100 private: |
101 DISALLOW_COPY_AND_ASSIGN(Session); | 101 DISALLOW_COPY_AND_ASSIGN(Session); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace protocol | 104 } // namespace protocol |
105 } // namespace remoting | 105 } // namespace remoting |
106 | 106 |
107 #endif // REMOTING_PROTOCOL_SESSION_H_ | 107 #endif // REMOTING_PROTOCOL_SESSION_H_ |
OLD | NEW |