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

Unified Diff: media/filters/in_memory_url_protocol.cc

Issue 8352019: Change Read size to a size_t for clarity (Closed) Base URL: svn://chrome-svn/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
Index: media/filters/in_memory_url_protocol.cc
===================================================================
--- media/filters/in_memory_url_protocol.cc (revision 102015)
+++ media/filters/in_memory_url_protocol.cc (working copy)
@@ -16,11 +16,11 @@
InMemoryUrlProtocol::~InMemoryUrlProtocol() {}
-int InMemoryUrlProtocol::Read(int size, uint8* data) {
+int InMemoryUrlProtocol::Read(size_t size, uint8* data) {
Ami GONE FROM CHROMIUM 2011/10/19 21:14:58 ret val
Cris Neckar 2011/10/19 22:25:41 Done.
if (size < 0)
Ami GONE FROM CHROMIUM 2011/10/19 21:14:58 This check can go away.
Cris Neckar 2011/10/19 22:25:41 Done.
return -1;
- int available_bytes = static_cast<int>(size_ - position_);
+ size_t available_bytes = size_ - position_;
Ami GONE FROM CHROMIUM 2011/10/19 21:14:58 It'd be nice if size_>=position_ was an invariant
Cris Neckar 2011/10/19 22:25:41 When I first saw this I was trying to find a way t
if (size > available_bytes)
size = available_bytes;
« media/filters/in_memory_url_protocol.h ('K') | « media/filters/in_memory_url_protocol.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698