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

Unified Diff: content/browser/streams/stream.cc

Issue 18284005: Make ByteStream independent from DownloadInterruptReason (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rdsmith's comments Created 7 years, 5 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 | « content/browser/streams/stream.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/streams/stream.cc
diff --git a/content/browser/streams/stream.cc b/content/browser/streams/stream.cc
index 38f91b82e5043179ae0a90e71636e13d45e10712..cac8ce099724cc80852bd10fae3394f4fa11d054 100644
--- a/content/browser/streams/stream.cc
+++ b/content/browser/streams/stream.cc
@@ -32,11 +32,11 @@ Stream::Stream(StreamRegistry* registry,
write_observer_(write_observer),
stream_handle_(NULL),
weak_ptr_factory_(this) {
- CreateByteStream(base::MessageLoopProxy::current(),
- base::MessageLoopProxy::current(),
- kDeferSizeThreshold,
- &writer_,
- &reader_);
+ CreateByteStream<bool>(base::MessageLoopProxy::current(),
+ base::MessageLoopProxy::current(),
+ kDeferSizeThreshold,
+ &writer_,
+ &reader_);
// Setup callback for writing.
writer_->RegisterCallback(base::Bind(&Stream::OnSpaceAvailable,
@@ -72,7 +72,8 @@ void Stream::AddData(scoped_refptr<net::IOBuffer> buffer, size_t size) {
}
void Stream::Finalize() {
- writer_->Close(DOWNLOAD_INTERRUPT_REASON_NONE);
+ // We don't use the status passing feature of ByteStream.
+ writer_->Close(false /* status */);
writer_.reset(NULL);
// Continue asynchronously.
@@ -88,14 +89,15 @@ Stream::StreamState Stream::ReadRawData(net::IOBuffer* buf,
if (!data_.get()) {
data_length_ = 0;
data_bytes_read_ = 0;
- ByteStreamReader::StreamState state = reader_->Read(&data_, &data_length_);
+ ByteStreamReader<bool>::StreamState state =
+ reader_->Read(&data_, &data_length_);
switch (state) {
- case ByteStreamReader::STREAM_HAS_DATA:
+ case ByteStreamReader<bool>::STREAM_HAS_DATA:
break;
- case ByteStreamReader::STREAM_COMPLETE:
+ case ByteStreamReader<bool>::STREAM_COMPLETE:
registry_->UnregisterStream(url());
return STREAM_COMPLETE;
- case ByteStreamReader::STREAM_EMPTY:
+ case ByteStreamReader<bool>::STREAM_EMPTY:
return STREAM_EMPTY;
}
}
« no previous file with comments | « content/browser/streams/stream.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698