Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: remoting/protocol/message_reader.cc

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/message_reader.h ('k') | remoting/protocol/message_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/message_reader.cc
diff --git a/remoting/protocol/message_reader.cc b/remoting/protocol/message_reader.cc
index f2902e023e517f1d49818d5adb2ee0fbe88be2b3..82a3c80158f7c58cf94f7d4c6d24498fbe223fc0 100644
--- a/remoting/protocol/message_reader.cc
+++ b/remoting/protocol/message_reader.cc
@@ -32,8 +32,8 @@ MessageReader::~MessageReader() {
}
void MessageReader::Init(net::Socket* socket,
- MessageReceivedCallback* callback) {
- message_received_callback_.reset(callback);
+ const MessageReceivedCallback& callback) {
+ message_received_callback_ = callback;
DCHECK(socket);
socket_ = socket;
DoRead();
@@ -96,9 +96,9 @@ void MessageReader::OnDataReceived(net::IOBuffer* data, int data_size) {
// plugin thread if this code is compiled into a separate binary. Fix this.
for (std::vector<CompoundBuffer*>::iterator it = new_messages.begin();
it != new_messages.end(); ++it) {
- message_received_callback_->Run(*it, NewRunnableMethod(
- this, &MessageReader::OnMessageDone, *it,
- base::MessageLoopProxy::current()));
+ message_received_callback_.Run(*it, base::Bind(
+ &MessageReader::OnMessageDone, this,
+ *it, base::MessageLoopProxy::current()));
}
}
« no previous file with comments | « remoting/protocol/message_reader.h ('k') | remoting/protocol/message_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698