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 #include "remoting/protocol/client_control_dispatcher.h" | 5 #include "remoting/protocol/client_control_dispatcher.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return false; | 53 return false; |
54 } | 54 } |
55 | 55 |
56 return true; | 56 return true; |
57 } | 57 } |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 ClientControlDispatcher::ClientControlDispatcher() | 61 ClientControlDispatcher::ClientControlDispatcher() |
62 : ChannelDispatcherBase(kControlChannelName), | 62 : ChannelDispatcherBase(kControlChannelName), |
63 client_stub_(NULL), | 63 client_stub_(nullptr), |
64 clipboard_stub_(NULL) { | 64 clipboard_stub_(nullptr) { |
65 } | 65 } |
66 | 66 |
67 ClientControlDispatcher::~ClientControlDispatcher() { | 67 ClientControlDispatcher::~ClientControlDispatcher() { |
68 writer_.Close(); | 68 writer_.Close(); |
69 } | 69 } |
70 | 70 |
71 void ClientControlDispatcher::OnInitialized() { | 71 void ClientControlDispatcher::OnInitialized() { |
72 // TODO(garykac): Set write failed callback. | 72 // TODO(garykac): Set write failed callback. |
73 writer_.Init(channel(), BufferedSocketWriter::WriteFailedCallback()); | 73 writer_.Init(channel(), BufferedSocketWriter::WriteFailedCallback()); |
74 reader_.Init(channel(), base::Bind( | 74 reader_.Init(channel(), base::Bind( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 client_stub_->SetPairingResponse(message->pairing_response()); | 139 client_stub_->SetPairingResponse(message->pairing_response()); |
140 } else if (message->has_extension_message()) { | 140 } else if (message->has_extension_message()) { |
141 client_stub_->DeliverHostMessage(message->extension_message()); | 141 client_stub_->DeliverHostMessage(message->extension_message()); |
142 } else { | 142 } else { |
143 LOG(WARNING) << "Unknown control message received."; | 143 LOG(WARNING) << "Unknown control message received."; |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 } // namespace protocol | 147 } // namespace protocol |
148 } // namespace remoting | 148 } // namespace remoting |
OLD | NEW |