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

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
« no previous file with comments | « media/filters/in_memory_url_protocol.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
@@ -9,18 +9,15 @@
InMemoryUrlProtocol::InMemoryUrlProtocol(const uint8* data, int64 size,
bool streaming)
: data_(data),
- size_(size),
+ size_(size >= 0 ? size : 0),
position_(0),
streaming_(streaming) {
}
InMemoryUrlProtocol::~InMemoryUrlProtocol() {}
-int InMemoryUrlProtocol::Read(int size, uint8* data) {
- if (size < 0)
- return -1;
-
- int available_bytes = static_cast<int>(size_ - position_);
+size_t InMemoryUrlProtocol::Read(size_t size, uint8* data) {
+ size_t available_bytes = size_ - position_;
if (size > available_bytes)
size = available_bytes;
« no previous file with comments | « 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