Index: mojo/services/network/url_loader_impl_apptest.cc |
diff --git a/mojo/services/network/url_loader_impl_apptest.cc b/mojo/services/network/url_loader_impl_apptest.cc |
index 0fe17495404ca8802cfcb00630f9ca2696d646c9..0b9de67dad75032b9dc72b94f8f99a86cc9c94a6 100644 |
--- a/mojo/services/network/url_loader_impl_apptest.cc |
+++ b/mojo/services/network/url_loader_impl_apptest.cc |
@@ -49,32 +49,28 @@ class TestURLRequestJob : public net::URLRequestJob { |
void Start() override { status_ = STARTED; } |
- bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) override { |
+ int ReadRawData(net::IOBuffer* buf, int buf_size) override { |
status_ = READING; |
buf_size_ = buf_size; |
- SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); |
- return false; |
+ return net::ERR_IO_PENDING; |
} |
void NotifyHeadersComplete() { net::URLRequestJob::NotifyHeadersComplete(); } |
void NotifyReadComplete(int bytes_read) { |
if (bytes_read < 0) { |
- NotifyDone(net::URLRequestStatus( |
- net::URLRequestStatus::FromError(net::ERR_FAILED))); |
- net::URLRequestJob::NotifyReadComplete(0); |
+ // Map errors to net::ERR_FAILED. |
+ ReadRawDataComplete(net::ERR_FAILED); |
// Set this after calling ReadRawDataComplete since that ends up calling |
// ReadRawData. |
status_ = COMPLETED; |
} else if (bytes_read == 0) { |
- NotifyDone(net::URLRequestStatus()); |
- net::URLRequestJob::NotifyReadComplete(bytes_read); |
+ ReadRawDataComplete(bytes_read); |
// Set this after calling ReadRawDataComplete since that ends up calling |
// ReadRawData. |
status_ = COMPLETED; |
} else { |
- SetStatus(net::URLRequestStatus()); |
- net::URLRequestJob::NotifyReadComplete(bytes_read); |
+ ReadRawDataComplete(bytes_read); |
// Set this after calling ReadRawDataComplete since that ends up calling |
// ReadRawData. |
status_ = STARTED; |