| 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 "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Called after session state has changed. It is safe to destroy | 64 // Called after session state has changed. It is safe to destroy |
| 65 // the session from within the handler if |state| is CLOSED or | 65 // the session from within the handler if |state| is CLOSED or |
| 66 // FAILED. | 66 // FAILED. |
| 67 virtual void OnSessionStateChange(State state) = 0; | 67 virtual void OnSessionStateChange(State state) = 0; |
| 68 | 68 |
| 69 // Called whenever route for the channel specified with | 69 // Called whenever route for the channel specified with |
| 70 // |channel_name| changes. | 70 // |channel_name| changes. |
| 71 virtual void OnSessionRouteChange(const std::string& channel_name, | 71 virtual void OnSessionRouteChange(const std::string& channel_name, |
| 72 const TransportRoute& route) = 0; | 72 const TransportRoute& route) = 0; |
| 73 |
| 74 // Called when inactive state on one of the channels changes. |
| 75 virtual void OnSessionInactive(const std::string& channel_name, |
| 76 bool inactive) {} |
| 73 }; | 77 }; |
| 74 | 78 |
| 75 // TODO(sergeyu): Specify connection error code when channel | 79 // TODO(sergeyu): Specify connection error code when channel |
| 76 // connection fails. | 80 // connection fails. |
| 77 typedef base::Callback<void(scoped_ptr<net::StreamSocket>)> | 81 typedef base::Callback<void(scoped_ptr<net::StreamSocket>)> |
| 78 StreamChannelCallback; | 82 StreamChannelCallback; |
| 79 typedef base::Callback<void(scoped_ptr<net::Socket>)> | 83 typedef base::Callback<void(scoped_ptr<net::Socket>)> |
| 80 DatagramChannelCallback; | 84 DatagramChannelCallback; |
| 81 | 85 |
| 82 Session() {} | 86 Session() {} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 virtual void Close() = 0; | 133 virtual void Close() = 0; |
| 130 | 134 |
| 131 private: | 135 private: |
| 132 DISALLOW_COPY_AND_ASSIGN(Session); | 136 DISALLOW_COPY_AND_ASSIGN(Session); |
| 133 }; | 137 }; |
| 134 | 138 |
| 135 } // namespace protocol | 139 } // namespace protocol |
| 136 } // namespace remoting | 140 } // namespace remoting |
| 137 | 141 |
| 138 #endif // REMOTING_PROTOCOL_SESSION_H_ | 142 #endif // REMOTING_PROTOCOL_SESSION_H_ |
| OLD | NEW |