Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: remoting/protocol/host_control_sender.h

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/fake_session.cc ('k') | remoting/protocol/host_control_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
11 11
12 #ifndef REMOTING_PROTOCOL_HOST_STUB_IMPL_H_ 12 #ifndef REMOTING_PROTOCOL_HOST_STUB_IMPL_H_
13 #define REMOTING_PROTOCOL_HOST_STUB_IMPL_H_ 13 #define REMOTING_PROTOCOL_HOST_STUB_IMPL_H_
14 14
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/callback.h"
16 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
17 #include "remoting/protocol/host_stub.h" 18 #include "remoting/protocol/host_stub.h"
18 19
19 class Task;
20
21 namespace base { 20 namespace base {
22 class MessageLoopProxy; 21 class MessageLoopProxy;
23 } // namespace base 22 } // namespace base
24 23
25 namespace net { 24 namespace net {
26 class Socket; 25 class Socket;
27 } // namespace net 26 } // namespace net
28 27
29 namespace remoting { 28 namespace remoting {
30 namespace protocol { 29 namespace protocol {
31 30
32 class BufferedSocketWriter; 31 class BufferedSocketWriter;
33 32
34 // Implementation of HostStub that sends commands on a socket. Must be 33 // Implementation of HostStub that sends commands on a socket. Must be
35 // 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
36 // other thread. 35 // other thread.
37 class HostControlSender : public HostStub { 36 class HostControlSender : public HostStub {
38 public: 37 public:
39 explicit HostControlSender(base::MessageLoopProxy* message_loop, 38 explicit HostControlSender(base::MessageLoopProxy* message_loop,
40 net::Socket* socket); 39 net::Socket* socket);
41 virtual ~HostControlSender(); 40 virtual ~HostControlSender();
42 41
43 virtual void BeginSessionRequest( 42 virtual void BeginSessionRequest(
44 const LocalLoginCredentials* credentials, Task* done); 43 const LocalLoginCredentials* credentials, const base::Closure& done);
45 44
46 // Stop writing. Must be called on the network thread when the 45 // Stop writing. Must be called on the network thread when the
47 // underlying socket is being destroyed. 46 // underlying socket is being destroyed.
48 void Close(); 47 void Close();
49 48
50 private: 49 private:
51 // Buffered socket writer holds the serialized message and send it on the 50 // Buffered socket writer holds the serialized message and send it on the
52 // right thread. 51 // right thread.
53 scoped_refptr<BufferedSocketWriter> buffered_writer_; 52 scoped_refptr<BufferedSocketWriter> buffered_writer_;
54 53
55 DISALLOW_COPY_AND_ASSIGN(HostControlSender); 54 DISALLOW_COPY_AND_ASSIGN(HostControlSender);
56 }; 55 };
57 56
58 } // namespace protocol 57 } // namespace protocol
59 } // namespace remoting 58 } // namespace remoting
60 59
61 #endif // REMOTING_PROTOCOL_HOST_STUB_IMPL_H_ 60 #endif // REMOTING_PROTOCOL_HOST_STUB_IMPL_H_
OLDNEW
« no previous file with comments | « remoting/protocol/fake_session.cc ('k') | remoting/protocol/host_control_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698