Chromium Code Reviews| Index: remoting/protocol/host_control_dispatcher.cc |
| diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc |
| index a213ac6eeb3090c2cb5c29982420b425bb41fd6d..c435b4ffb4ebac4cd65bc99da2ba6d77a763c9bf 100644 |
| --- a/remoting/protocol/host_control_dispatcher.cc |
| +++ b/remoting/protocol/host_control_dispatcher.cc |
| @@ -19,7 +19,8 @@ namespace protocol { |
| HostControlDispatcher::HostControlDispatcher() |
| : ChannelDispatcherBase(kControlChannelName), |
| clipboard_stub_(NULL), |
| - host_stub_(NULL) { |
| + host_stub_(NULL), |
| + weak_factory_(this) { |
| } |
| HostControlDispatcher::~HostControlDispatcher() { |
| @@ -69,10 +70,21 @@ void HostControlDispatcher::OnMessageReceived( |
| host_stub_->ControlAudio(message->audio_control()); |
| } else if (message->has_capabilities()) { |
| host_stub_->SetCapabilities(message->capabilities()); |
| + } else if (message->has_pairing_request()) { |
| + host_stub_->RequestPairing( |
| + message->pairing_request(), |
| + base::Bind(&HostControlDispatcher::OnPairingReply, |
|
rmsousa
2013/05/09 03:55:02
If you don't use a bound callback you can remove t
Jamie
2013/05/09 17:59:52
Done.
|
| + weak_factory_.GetWeakPtr())); |
| } else { |
| LOG(WARNING) << "Unknown control message received."; |
| } |
| } |
| +void HostControlDispatcher::OnPairingReply(const PairingReply& pairing_reply) { |
|
rmsousa
2013/05/09 03:55:02
nit: Make this a verb (RespondToPairing?), move it
Jamie
2013/05/09 17:59:52
Done.
|
| + ControlMessage message; |
| + message.mutable_pairing_reply()->CopyFrom(pairing_reply); |
| + writer_.Write(SerializeAndFrameMessage(message), base::Closure()); |
| +} |
| + |
| } // namespace protocol |
| } // namespace remoting |