| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 namespace protocol { | 35 namespace protocol { |
| 36 | 36 |
| 37 class Authenticator; | 37 class Authenticator; |
| 38 class ClientControlDispatcher; | 38 class ClientControlDispatcher; |
| 39 class ClientEventDispatcher; | 39 class ClientEventDispatcher; |
| 40 class ClientStub; | 40 class ClientStub; |
| 41 class ClipboardStub; | 41 class ClipboardStub; |
| 42 class HostStub; | 42 class HostStub; |
| 43 class InputStub; | 43 class InputStub; |
| 44 class SessionConfig; | 44 class SessionConfig; |
| 45 class TransportFactory; |
| 45 class VideoReader; | 46 class VideoReader; |
| 46 class VideoStub; | 47 class VideoStub; |
| 47 | 48 |
| 48 class ConnectionToHost : public SignalStrategy::Listener, | 49 class ConnectionToHost : public SignalStrategy::Listener, |
| 49 public SessionManager::Listener { | 50 public SessionManager::Listener { |
| 50 public: | 51 public: |
| 51 enum State { | 52 enum State { |
| 52 CONNECTING, | 53 CONNECTING, |
| 53 CONNECTED, | 54 CONNECTED, |
| 54 FAILED, | 55 FAILED, |
| 55 CLOSED, | 56 CLOSED, |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 class HostEventCallback { | 59 class HostEventCallback { |
| 59 public: | 60 public: |
| 60 virtual ~HostEventCallback() {} | 61 virtual ~HostEventCallback() {} |
| 61 | 62 |
| 62 // Called when state of the connection changes. | 63 // Called when state of the connection changes. |
| 63 virtual void OnConnectionState(State state, ErrorCode error) = 0; | 64 virtual void OnConnectionState(State state, ErrorCode error) = 0; |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 ConnectionToHost(base::MessageLoopProxy* message_loop, | 67 ConnectionToHost(base::MessageLoopProxy* message_loop, |
| 67 pp::Instance* pp_instance, | |
| 68 bool allow_nat_traversal); | 68 bool allow_nat_traversal); |
| 69 virtual ~ConnectionToHost(); | 69 virtual ~ConnectionToHost(); |
| 70 | 70 |
| 71 virtual void Connect(scoped_refptr<XmppProxy> xmpp_proxy, | 71 virtual void Connect(scoped_refptr<XmppProxy> xmpp_proxy, |
| 72 const std::string& local_jid, | 72 const std::string& local_jid, |
| 73 const std::string& host_jid, | 73 const std::string& host_jid, |
| 74 const std::string& host_public_key, | 74 const std::string& host_public_key, |
| 75 scoped_ptr<TransportFactory> transport_factory, |
| 75 scoped_ptr<Authenticator> authenticator, | 76 scoped_ptr<Authenticator> authenticator, |
| 76 HostEventCallback* event_callback, | 77 HostEventCallback* event_callback, |
| 77 ClientStub* client_stub, | 78 ClientStub* client_stub, |
| 78 ClipboardStub* clipboard_stub, | 79 ClipboardStub* clipboard_stub, |
| 79 VideoStub* video_stub); | 80 VideoStub* video_stub); |
| 80 | 81 |
| 81 virtual void Disconnect(const base::Closure& shutdown_task); | 82 virtual void Disconnect(const base::Closure& shutdown_task); |
| 82 | 83 |
| 83 virtual const SessionConfig& config(); | 84 virtual const SessionConfig& config(); |
| 84 | 85 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 115 void OnVideoPacket(VideoPacket* packet); | 116 void OnVideoPacket(VideoPacket* packet); |
| 116 | 117 |
| 117 void CloseOnError(ErrorCode error); | 118 void CloseOnError(ErrorCode error); |
| 118 | 119 |
| 119 // Stops writing in the channels. | 120 // Stops writing in the channels. |
| 120 void CloseChannels(); | 121 void CloseChannels(); |
| 121 | 122 |
| 122 void SetState(State state, ErrorCode error); | 123 void SetState(State state, ErrorCode error); |
| 123 | 124 |
| 124 scoped_refptr<base::MessageLoopProxy> message_loop_; | 125 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 125 pp::Instance* pp_instance_; | |
| 126 bool allow_nat_traversal_; | 126 bool allow_nat_traversal_; |
| 127 | 127 |
| 128 std::string host_jid_; | 128 std::string host_jid_; |
| 129 std::string host_public_key_; | 129 std::string host_public_key_; |
| 130 scoped_ptr<Authenticator> authenticator_; | 130 scoped_ptr<Authenticator> authenticator_; |
| 131 | 131 |
| 132 HostEventCallback* event_callback_; | 132 HostEventCallback* event_callback_; |
| 133 | 133 |
| 134 // Stub for incoming messages. | 134 // Stub for incoming messages. |
| 135 ClientStub* client_stub_; | 135 ClientStub* client_stub_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 151 ErrorCode error_; | 151 ErrorCode error_; |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); | 154 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 } // namespace protocol | 157 } // namespace protocol |
| 158 } // namespace remoting | 158 } // namespace remoting |
| 159 | 159 |
| 160 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 160 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| OLD | NEW |