Chromium Code Reviews| 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_CONNECTION_TO_HOST_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/logging.h" | |
|
Sergey Ulanov
2015/07/30 22:00:44
nit: don't need this include.
tonychun
2015/07/30 23:20:26
Removed.
| |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "remoting/protocol/errors.h" | 14 #include "remoting/protocol/errors.h" |
| 14 | 15 |
| 15 namespace remoting { | 16 namespace remoting { |
| 16 | 17 |
| 17 class SignalStrategy; | 18 class SignalStrategy; |
| 18 | 19 |
| 19 namespace protocol { | 20 namespace protocol { |
| 20 | 21 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 39 // update these locations if you make any changes to the ordering. | 40 // update these locations if you make any changes to the ordering. |
| 40 enum State { | 41 enum State { |
| 41 INITIALIZING, | 42 INITIALIZING, |
| 42 CONNECTING, | 43 CONNECTING, |
| 43 AUTHENTICATED, | 44 AUTHENTICATED, |
| 44 CONNECTED, | 45 CONNECTED, |
| 45 FAILED, | 46 FAILED, |
| 46 CLOSED, | 47 CLOSED, |
| 47 }; | 48 }; |
| 48 | 49 |
| 50 // Returns the literal string of |state|. | |
| 51 static const char* StateToString(State state); | |
| 52 | |
| 49 class HostEventCallback { | 53 class HostEventCallback { |
| 50 public: | 54 public: |
| 51 virtual ~HostEventCallback() {} | 55 virtual ~HostEventCallback() {} |
| 52 | 56 |
| 53 // Called when state of the connection changes. | 57 // Called when state of the connection changes. |
| 54 virtual void OnConnectionState(State state, ErrorCode error) = 0; | 58 virtual void OnConnectionState(State state, ErrorCode error) = 0; |
| 55 | 59 |
| 56 // Called when ready state of the connection changes. When |ready| | 60 // Called when ready state of the connection changes. When |ready| |
| 57 // is set to false some data sent by the peers may be | 61 // is set to false some data sent by the peers may be |
| 58 // delayed. This is used to indicate in the UI when connection is | 62 // delayed. This is used to indicate in the UI when connection is |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 virtual InputStub* input_stub() = 0; | 107 virtual InputStub* input_stub() = 0; |
| 104 | 108 |
| 105 // Return the current state of ConnectionToHost. | 109 // Return the current state of ConnectionToHost. |
| 106 virtual State state() const = 0; | 110 virtual State state() const = 0; |
| 107 }; | 111 }; |
| 108 | 112 |
| 109 } // namespace protocol | 113 } // namespace protocol |
| 110 } // namespace remoting | 114 } // namespace remoting |
| 111 | 115 |
| 112 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 116 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| OLD | NEW |