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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Implementation of HostStub that sends commands on a socket. Must be | 33 // Implementation of HostStub that sends commands on a socket. Must be |
34 // created and closed on the network thread, but can be used on any | 34 // created and closed on the network thread, but can be used on any |
35 // other thread. | 35 // other thread. |
36 class HostControlSender : public HostStub { | 36 class HostControlSender : public HostStub { |
37 public: | 37 public: |
38 explicit HostControlSender(base::MessageLoopProxy* message_loop, | 38 explicit HostControlSender(base::MessageLoopProxy* message_loop, |
39 net::Socket* socket); | 39 net::Socket* socket); |
40 virtual ~HostControlSender(); | 40 virtual ~HostControlSender(); |
41 | 41 |
42 virtual void BeginSessionRequest( | |
43 const LocalLoginCredentials* credentials, const base::Closure& done); | |
44 | |
45 // Stop writing. Must be called on the network thread when the | 42 // Stop writing. Must be called on the network thread when the |
46 // underlying socket is being destroyed. | 43 // underlying socket is being destroyed. |
47 void Close(); | 44 void Close(); |
48 | 45 |
49 private: | 46 private: |
50 // Buffered socket writer holds the serialized message and send it on the | 47 // Buffered socket writer holds the serialized message and send it on the |
51 // right thread. | 48 // right thread. |
52 scoped_refptr<BufferedSocketWriter> buffered_writer_; | 49 scoped_refptr<BufferedSocketWriter> buffered_writer_; |
53 | 50 |
54 DISALLOW_COPY_AND_ASSIGN(HostControlSender); | 51 DISALLOW_COPY_AND_ASSIGN(HostControlSender); |
55 }; | 52 }; |
56 | 53 |
57 } // namespace protocol | 54 } // namespace protocol |
58 } // namespace remoting | 55 } // namespace remoting |
59 | 56 |
60 #endif // REMOTING_PROTOCOL_HOST_STUB_IMPL_H_ | 57 #endif // REMOTING_PROTOCOL_HOST_STUB_IMPL_H_ |
OLD | NEW |