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

Unified Diff: blimp/net/packet_reader.h

Issue 1452823011: Make PacketReader/PacketWriter interfaces async-only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 5 years, 1 month 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 | « no previous file | blimp/net/packet_writer.h » ('j') | blimp/net/stream_packet_reader_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/packet_reader.h
diff --git a/blimp/net/packet_reader.h b/blimp/net/packet_reader.h
index 407e2fdd2c1d7f3fc7343404a0e2bf41bf95a7e8..bcc4901254609c4f7f9d9afbaa3d00281d652bc0 100644
--- a/blimp/net/packet_reader.h
+++ b/blimp/net/packet_reader.h
@@ -18,14 +18,11 @@ class BLIMP_NET_EXPORT PacketReader {
virtual ~PacketReader() {}
// Reads a packet from the connection.
- // Returns the size of the packet, in bytes, if the read operation executed
- // successfully.
- // Returns ERR_IO_PENDING if the operation will be executed asynchronously.
- // |cb| is later invoked with the packet size or an error code.
- // All other return values indicate errors and caller should stop using this
- // reader.
- virtual int ReadPacket(const scoped_refptr<net::GrowableIOBuffer>& buf,
- const net::CompletionCallback& cb) = 0;
+ // Passes net::OK to |cb| if the read operation executed successfully.
Wez 2015/11/24 23:43:18 nit: Remove double-space
Kevin M 2015/11/25 01:18:37 Done.
+ // The read size can be accessed by calling |buf.offset()|.
Wez 2015/11/24 23:43:18 Suggest: Sets |buf.offset()| to the received messa
Kevin M 2015/11/25 01:18:37 Done.
+ // All other values indicate errors.
+ virtual void ReadPacket(const scoped_refptr<net::GrowableIOBuffer>& buf,
+ const net::CompletionCallback& cb) = 0;
};
} // namespace blimp
« no previous file with comments | « no previous file | blimp/net/packet_writer.h » ('j') | blimp/net/stream_packet_reader_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698