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 // Implementation of HostStub using sockets created from jingle connection. | 5 // Implementation of HostStub using sockets created from jingle connection. |
6 // It sends messages through the socket after serializing it. | 6 // It sends messages through the socket after serializing it. |
7 // | 7 // |
8 // Object of this class can only be created by ConnectionToHost. | 8 // Object of this class can only be created by ConnectionToHost. |
9 // | 9 // |
10 // This class can be used on any thread. | 10 // This class can be used on any thread. |
(...skipping 17 matching lines...) Expand all Loading... |
28 class BufferedSocketWriter; | 28 class BufferedSocketWriter; |
29 | 29 |
30 // Implementation of HostStub that sends commands on a socket. Must be | 30 // Implementation of HostStub that sends commands on a socket. Must be |
31 // created and closed on the network thread, but can be used on any | 31 // created and closed on the network thread, but can be used on any |
32 // other thread. | 32 // other thread. |
33 class HostControlSender : public HostStub { | 33 class HostControlSender : public HostStub { |
34 public: | 34 public: |
35 explicit HostControlSender(net::Socket* socket); | 35 explicit HostControlSender(net::Socket* socket); |
36 virtual ~HostControlSender(); | 36 virtual ~HostControlSender(); |
37 | 37 |
38 virtual void SuggestResolution( | |
39 const SuggestResolutionRequest* msg, Task* done); | |
40 virtual void BeginSessionRequest( | 38 virtual void BeginSessionRequest( |
41 const LocalLoginCredentials* credentials, Task* done); | 39 const LocalLoginCredentials* credentials, Task* done); |
42 | 40 |
43 // Stop writing. Must be called on the network thread when the | 41 // Stop writing. Must be called on the network thread when the |
44 // underlying socket is being destroyed. | 42 // underlying socket is being destroyed. |
45 void Close(); | 43 void Close(); |
46 | 44 |
47 private: | 45 private: |
48 // Buffered socket writer holds the serialized message and send it on the | 46 // Buffered socket writer holds the serialized message and send it on the |
49 // right thread. | 47 // right thread. |
50 scoped_refptr<BufferedSocketWriter> buffered_writer_; | 48 scoped_refptr<BufferedSocketWriter> buffered_writer_; |
51 | 49 |
52 DISALLOW_COPY_AND_ASSIGN(HostControlSender); | 50 DISALLOW_COPY_AND_ASSIGN(HostControlSender); |
53 }; | 51 }; |
54 | 52 |
55 } // namespace protocol | 53 } // namespace protocol |
56 } // namespace remoting | 54 } // namespace remoting |
57 | 55 |
58 #endif // REMOTING_PROTOCOL_HOST_STUB_IMPL_H_ | 56 #endif // REMOTING_PROTOCOL_HOST_STUB_IMPL_H_ |
OLD | NEW |