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

Unified Diff: net/url_request/url_request_test_job.cc

Issue 10392111: Use ByteStream in downloads system to decouple source and sink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR. Created 8 years, 6 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 | « net/url_request/url_request_test_job.h ('k') | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_job.cc
diff --git a/net/url_request/url_request_test_job.cc b/net/url_request/url_request_test_job.cc
index 4a0ba6e21291ca62a345ff57ca84526eefd59129..94a6bf5a757f53a362ddc9f96acce490fe999982 100644
--- a/net/url_request/url_request_test_job.cc
+++ b/net/url_request/url_request_test_job.cc
@@ -247,6 +247,11 @@ void URLRequestTestJob::ProcessNextOperation() {
if (!ReadRawData(async_buf_, async_buf_size_, &bytes_read))
NOTREACHED() << "This should not return false in DATA_AVAILABLE.";
SetStatus(URLRequestStatus()); // clear the io pending flag
+ if (NextReadAsync()) {
+ // Make all future reads return io pending until the next
+ // ProcessNextOperation().
+ stage_ = WAITING;
+ }
NotifyReadComplete(bytes_read);
}
break;
@@ -265,6 +270,10 @@ void URLRequestTestJob::ProcessNextOperation() {
}
}
+bool URLRequestTestJob::NextReadAsync() {
+ return false;
+}
+
void URLRequestTestJob::AdvanceJob() {
if (auto_advance_) {
MessageLoop::current()->PostTask(
« no previous file with comments | « net/url_request/url_request_test_job.h ('k') | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698