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

Unified Diff: net/test/url_request/url_request_mock_data_job.cc

Issue 1467603002: URLRequestJob: change ReadRawData contract (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add done_reading_called_ to MockNetworkTransaction 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
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 95492421a82ef7451e4abd61c8bfa03a232f3a32..b9ef385bcd2d54ba8c1f9d2f648f41a84cab5056 100644
--- a/net/test/url_request/url_request_mock_data_job.cc
+++ b/net/test/url_request/url_request_mock_data_job.cc
@@ -104,15 +104,12 @@ void URLRequestMockDataJob::Start() {
URLRequestMockDataJob::~URLRequestMockDataJob() {
}
-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::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;
}
int URLRequestMockDataJob::GetResponseCode() const {
« no previous file with comments | « net/test/url_request/url_request_mock_data_job.h ('k') | net/test/url_request/url_request_slow_download_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698