| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Called after session state has changed. It is safe to destroy | 59 // Called after session state has changed. It is safe to destroy |
| 60 // the session from within the handler if |state| is CLOSED or | 60 // the session from within the handler if |state| is CLOSED or |
| 61 // FAILED. | 61 // 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 |
| 70 // Called when ready state on one of the channels changes. See |
| 71 // comments in transport.h for explanation on what this state |
| 72 // means and how it can used. |
| 73 virtual void OnSessionChannelReady(const std::string& channel_name, |
| 74 bool ready) {} |
| 69 }; | 75 }; |
| 70 | 76 |
| 71 // TODO(sergeyu): Specify connection error code when channel | 77 // TODO(sergeyu): Specify connection error code when channel |
| 72 // connection fails. | 78 // connection fails. |
| 73 typedef base::Callback<void(scoped_ptr<net::StreamSocket>)> | 79 typedef base::Callback<void(scoped_ptr<net::StreamSocket>)> |
| 74 StreamChannelCallback; | 80 StreamChannelCallback; |
| 75 typedef base::Callback<void(scoped_ptr<net::Socket>)> | 81 typedef base::Callback<void(scoped_ptr<net::Socket>)> |
| 76 DatagramChannelCallback; | 82 DatagramChannelCallback; |
| 77 | 83 |
| 78 Session() {} | 84 Session() {} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 virtual void Close() = 0; | 131 virtual void Close() = 0; |
| 126 | 132 |
| 127 private: | 133 private: |
| 128 DISALLOW_COPY_AND_ASSIGN(Session); | 134 DISALLOW_COPY_AND_ASSIGN(Session); |
| 129 }; | 135 }; |
| 130 | 136 |
| 131 } // namespace protocol | 137 } // namespace protocol |
| 132 } // namespace remoting | 138 } // namespace remoting |
| 133 | 139 |
| 134 #endif // REMOTING_PROTOCOL_SESSION_H_ | 140 #endif // REMOTING_PROTOCOL_SESSION_H_ |
| OLD | NEW |