Index: remoting/host/native_messaging/native_messaging_channel.cc |
diff --git a/remoting/host/native_messaging/native_messaging_channel.cc b/remoting/host/native_messaging/native_messaging_channel.cc |
index b1d2c784e576d2dc1cf33fdd6307ed77c2bffeaa..12fc6474e68f65267857ed560d30d1074fe0c21a 100644 |
--- a/remoting/host/native_messaging/native_messaging_channel.cc |
+++ b/remoting/host/native_messaging/native_messaging_channel.cc |
@@ -45,17 +45,15 @@ base::PlatformFile DuplicatePlatformFile(base::PlatformFile handle) { |
namespace remoting { |
NativeMessagingChannel::NativeMessagingChannel( |
- scoped_ptr<Delegate> delegate, |
+ SendMessageCallback received_message, |
base::PlatformFile input, |
base::PlatformFile output) |
: native_messaging_reader_(DuplicatePlatformFile(input)), |
native_messaging_writer_(new NativeMessagingWriter( |
DuplicatePlatformFile(output))), |
- delegate_(delegate.Pass()), |
+ received_message_(received_message), |
weak_factory_(this) { |
weak_ptr_ = weak_factory_.GetWeakPtr(); |
- delegate_->SetSendMessageCallback( |
- base::Bind(&NativeMessagingChannel::SendMessage, weak_ptr_)); |
} |
NativeMessagingChannel::~NativeMessagingChannel() { |
@@ -83,7 +81,7 @@ void NativeMessagingChannel::ProcessMessage(scoped_ptr<base::Value> message) { |
scoped_ptr<base::DictionaryValue> message_dict( |
static_cast<base::DictionaryValue*>(message.release())); |
- delegate_->ProcessMessage(message_dict.Pass()); |
+ received_message_.Run(message_dict.Pass()); |
} |
void NativeMessagingChannel::SendMessage( |