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

Unified Diff: remoting/protocol/protobuf_message_parser.h

Issue 1655433002: Remove done notifications from incoming message handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/protobuf_message_parser.h
diff --git a/remoting/protocol/protobuf_message_parser.h b/remoting/protocol/protobuf_message_parser.h
index 4fe01916823374fbe97e0f5a4293706b68aa47a7..43f86f06012583465e2d1e98deefdf298a86e55d 100644
--- a/remoting/protocol/protobuf_message_parser.h
+++ b/remoting/protocol/protobuf_message_parser.h
@@ -23,8 +23,7 @@ class ProtobufMessageParser {
public:
// The callback that is called when a new message is received. |done_task|
// must be called by the callback when it's done processing the |message|.
- typedef typename base::Callback<void(scoped_ptr<T> message,
- const base::Closure& done_task)>
+ typedef typename base::Callback<void(scoped_ptr<T> message)>
MessageReceivedCallback;
// |message_reader| must outlive ProtobufMessageParser.
@@ -41,8 +40,7 @@ class ProtobufMessageParser {
}
private:
- void OnNewData(scoped_ptr<CompoundBuffer> buffer,
- const base::Closure& done_task) {
+ void OnNewData(scoped_ptr<CompoundBuffer> buffer) {
scoped_ptr<T> message(new T());
CompoundBufferInputStream stream(buffer.get());
bool ret = message->ParseFromZeroCopyStream(&stream);
@@ -50,7 +48,7 @@ class ProtobufMessageParser {
LOG(WARNING) << "Received message that is not a valid protocol buffer.";
} else {
DCHECK_EQ(stream.position(), buffer->total_bytes());
- message_received_callback_.Run(std::move(message), done_task);
+ message_received_callback_.Run(std::move(message));
}
}
« no previous file with comments | « remoting/protocol/message_reader_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698