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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // State change callbacks are called after session state has | 67 // State change callbacks are called after session state has |
68 // changed. It is not safe to destroy the session from within the | 68 // changed. It is not safe to destroy the session from within the |
69 // handler unless |state| is CLOSED or FAILED. | 69 // handler unless |state| is CLOSED or FAILED. |
70 typedef base::Callback<void(State state)> StateChangeCallback; | 70 typedef base::Callback<void(State state)> StateChangeCallback; |
71 | 71 |
72 // TODO(lambroslambrou): Merge this together with StateChangeCallback into a | 72 // TODO(lambroslambrou): Merge this together with StateChangeCallback into a |
73 // single interface. | 73 // single interface. |
74 typedef base::Callback<void( | 74 typedef base::Callback<void( |
75 const std::string& channel_name, | 75 const std::string& channel_name, |
76 const net::IPEndPoint& end_point)> RouteChangeCallback; | 76 const net::IPEndPoint& remote_end_point, |
| 77 const net::IPEndPoint& local_end_point)> RouteChangeCallback; |
77 | 78 |
78 // TODO(sergeyu): Specify connection error code when channel | 79 // TODO(sergeyu): Specify connection error code when channel |
79 // connection fails. | 80 // connection fails. |
80 typedef base::Callback<void(net::StreamSocket*)> StreamChannelCallback; | 81 typedef base::Callback<void(net::StreamSocket*)> StreamChannelCallback; |
81 typedef base::Callback<void(net::Socket*)> DatagramChannelCallback; | 82 typedef base::Callback<void(net::Socket*)> DatagramChannelCallback; |
82 | 83 |
83 Session() { } | 84 Session() { } |
84 virtual ~Session() { } | 85 virtual ~Session() { } |
85 | 86 |
86 // Set callback that is called when state of the connection is changed. | 87 // Set callback that is called when state of the connection is changed. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 virtual void Close() = 0; | 136 virtual void Close() = 0; |
136 | 137 |
137 private: | 138 private: |
138 DISALLOW_COPY_AND_ASSIGN(Session); | 139 DISALLOW_COPY_AND_ASSIGN(Session); |
139 }; | 140 }; |
140 | 141 |
141 } // namespace protocol | 142 } // namespace protocol |
142 } // namespace remoting | 143 } // namespace remoting |
143 | 144 |
144 #endif // REMOTING_PROTOCOL_SESSION_H_ | 145 #endif // REMOTING_PROTOCOL_SESSION_H_ |
OLD | NEW |