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 // This stub is thread safe because of the use of BufferedSocketWriter. | 5 // This stub is thread safe because of the use of BufferedSocketWriter. |
6 // BufferedSocketWriter buffers messages and send them on the right thread. | 6 // BufferedSocketWriter buffers messages and send them on the right thread. |
7 | 7 |
8 #include "remoting/protocol/input_sender.h" | 8 #include "remoting/protocol/input_sender.h" |
9 | 9 |
10 #include "base/task.h" | 10 #include "base/task.h" |
| 11 #include "base/time.h" |
11 #include "remoting/proto/event.pb.h" | 12 #include "remoting/proto/event.pb.h" |
12 #include "remoting/proto/internal.pb.h" | 13 #include "remoting/proto/internal.pb.h" |
13 #include "remoting/protocol/buffered_socket_writer.h" | 14 #include "remoting/protocol/buffered_socket_writer.h" |
14 #include "remoting/protocol/util.h" | 15 #include "remoting/protocol/util.h" |
15 | 16 |
16 namespace remoting { | 17 namespace remoting { |
17 namespace protocol { | 18 namespace protocol { |
18 | 19 |
19 InputSender::InputSender(base::MessageLoopProxy* message_loop, | 20 InputSender::InputSender(base::MessageLoopProxy* message_loop, |
20 net::Socket* socket) | 21 net::Socket* socket) |
(...skipping 19 matching lines...) Expand all Loading... |
40 message.mutable_mouse_event()->CopyFrom(event); | 41 message.mutable_mouse_event()->CopyFrom(event); |
41 buffered_writer_->Write(SerializeAndFrameMessage(message), NULL); | 42 buffered_writer_->Write(SerializeAndFrameMessage(message), NULL); |
42 } | 43 } |
43 | 44 |
44 void InputSender::Close() { | 45 void InputSender::Close() { |
45 buffered_writer_->Close(); | 46 buffered_writer_->Close(); |
46 } | 47 } |
47 | 48 |
48 } // namespace protocol | 49 } // namespace protocol |
49 } // namespace remoting | 50 } // namespace remoting |
OLD | NEW |