Index: net/test/url_request/url_request_mock_data_job.cc |
diff --git a/net/test/url_request/url_request_mock_data_job.cc b/net/test/url_request/url_request_mock_data_job.cc |
index b9ef385bcd2d54ba8c1f9d2f648f41a84cab5056..95492421a82ef7451e4abd61c8bfa03a232f3a32 100644 |
--- a/net/test/url_request/url_request_mock_data_job.cc |
+++ b/net/test/url_request/url_request_mock_data_job.cc |
@@ -104,12 +104,15 @@ void URLRequestMockDataJob::Start() { |
URLRequestMockDataJob::~URLRequestMockDataJob() { |
} |
-int URLRequestMockDataJob::ReadRawData(IOBuffer* buf, int buf_size) { |
- int bytes_read = |
- std::min(static_cast<size_t>(buf_size), data_.length() - data_offset_); |
- memcpy(buf->data(), data_.c_str() + data_offset_, bytes_read); |
- data_offset_ += bytes_read; |
- return bytes_read; |
+bool URLRequestMockDataJob::ReadRawData(IOBuffer* buf, |
+ int buf_size, |
+ int* bytes_read) { |
+ DCHECK(bytes_read); |
+ *bytes_read = static_cast<int>( |
+ std::min(static_cast<size_t>(buf_size), data_.length() - data_offset_)); |
+ memcpy(buf->data(), data_.c_str() + data_offset_, *bytes_read); |
+ data_offset_ += *bytes_read; |
+ return true; |
} |
int URLRequestMockDataJob::GetResponseCode() const { |