| 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" |
| 11 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
| 12 #include "remoting/protocol/buffered_socket_writer.h" | 12 #include "remoting/protocol/buffered_socket_writer.h" |
| 13 #include "remoting/protocol/session_config.h" | 13 #include "remoting/protocol/session_config.h" |
| 14 | 14 |
| 15 class Task; | 15 class Task; |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 class Socket; | 18 class Socket; |
| 19 class StreamSocket; | 19 class StreamSocket; |
| 20 } // namespace net | 20 } // namespace net |
| 21 | 21 |
| 22 namespace remoting { | 22 namespace remoting { |
| 23 namespace protocol { | 23 namespace protocol { |
| 24 | 24 |
| 25 // Generic interface for Chromotocol connection used by both client and host. | 25 // Generic interface for Chromotocol connection used by both client and host. |
| 26 // Provides access to the connection channels, but doesn't depend on the | 26 // Provides access to the connection channels, but doesn't depend on the |
| 27 // protocol used for each channel. | 27 // protocol used for each channel. |
| 28 // |
| 29 // Because libjingle's sigslot class doesn't handle deletion properly |
| 30 // while it is being invoked all Session instances must be deleted |
| 31 // with a clean stack, i.e. not from event handlers, when sigslot may |
| 32 // be present in the stack. |
| 28 class Session : public base::NonThreadSafe { | 33 class Session : public base::NonThreadSafe { |
| 29 public: | 34 public: |
| 30 enum State { | 35 enum State { |
| 31 // Created, but not connecting yet. | 36 // Created, but not connecting yet. |
| 32 INITIALIZING, | 37 INITIALIZING, |
| 33 | 38 |
| 34 // Sent or received session-initiate, but haven't sent or received | 39 // Sent or received session-initiate, but haven't sent or received |
| 35 // session-accept. | 40 // session-accept. |
| 36 CONNECTING, | 41 CONNECTING, |
| 37 | 42 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 virtual void Close() = 0; | 130 virtual void Close() = 0; |
| 126 | 131 |
| 127 private: | 132 private: |
| 128 DISALLOW_COPY_AND_ASSIGN(Session); | 133 DISALLOW_COPY_AND_ASSIGN(Session); |
| 129 }; | 134 }; |
| 130 | 135 |
| 131 } // namespace protocol | 136 } // namespace protocol |
| 132 } // namespace remoting | 137 } // namespace remoting |
| 133 | 138 |
| 134 #endif // REMOTING_PROTOCOL_SESSION_H_ | 139 #endif // REMOTING_PROTOCOL_SESSION_H_ |
| OLD | NEW |