| 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/channel_dispatcher_base.h" | 5 #include "remoting/protocol/channel_dispatcher_base.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "remoting/base/compound_buffer.h" | 10 #include "remoting/base/compound_buffer.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 void ChannelDispatcherBase::Init(MessageChannelFactory* channel_factory, | 25 void ChannelDispatcherBase::Init(MessageChannelFactory* channel_factory, |
| 26 EventHandler* event_handler) { | 26 EventHandler* event_handler) { |
| 27 channel_factory_ = channel_factory; | 27 channel_factory_ = channel_factory; |
| 28 event_handler_ = event_handler; | 28 event_handler_ = event_handler; |
| 29 | 29 |
| 30 channel_factory_->CreateChannel(channel_name_, base::Bind( | 30 channel_factory_->CreateChannel(channel_name_, base::Bind( |
| 31 &ChannelDispatcherBase::OnChannelReady, base::Unretained(this))); | 31 &ChannelDispatcherBase::OnChannelReady, base::Unretained(this))); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void ChannelDispatcherBase::OnChannelReady( | 34 void ChannelDispatcherBase::OnChannelReady( |
| 35 scoped_ptr<MessagePipe> message_pipe) { | 35 std::unique_ptr<MessagePipe> message_pipe) { |
| 36 channel_factory_ = nullptr; | 36 channel_factory_ = nullptr; |
| 37 message_pipe_ = std::move(message_pipe); | 37 message_pipe_ = std::move(message_pipe); |
| 38 message_pipe_->StartReceiving(base::Bind( | 38 message_pipe_->StartReceiving(base::Bind( |
| 39 &ChannelDispatcherBase::OnIncomingMessage, base::Unretained(this))); | 39 &ChannelDispatcherBase::OnIncomingMessage, base::Unretained(this))); |
| 40 | 40 |
| 41 event_handler_->OnChannelInitialized(this); | 41 event_handler_->OnChannelInitialized(this); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace protocol | 44 } // namespace protocol |
| 45 } // namespace remoting | 45 } // namespace remoting |
| OLD | NEW |