summaryrefslogtreecommitdiffstats
path: root/content/browser/byte_stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/byte_stream.cc')
-rw-r--r--content/browser/byte_stream.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/browser/byte_stream.cc b/content/browser/byte_stream.cc
index f83e8c3..8031815 100644
--- a/content/browser/byte_stream.cc
+++ b/content/browser/byte_stream.cc
@@ -55,6 +55,7 @@ class ByteStreamWriterImpl : public ByteStreamWriter {
// Overridden from ByteStreamWriter.
virtual bool Write(scoped_refptr<net::IOBuffer> buffer,
size_t byte_count) OVERRIDE;
+ virtual void Flush() OVERRIDE;
virtual void Close(DownloadInterruptReason status) OVERRIDE;
virtual void RegisterCallback(const base::Closure& source_callback) OVERRIDE;
@@ -215,6 +216,12 @@ bool ByteStreamWriterImpl::Write(
return (input_contents_size_ + output_size_used_ <= total_buffer_size_);
}
+void ByteStreamWriterImpl::Flush() {
+ DCHECK(my_task_runner_->RunsTasksOnCurrentThread());
+ if (input_contents_size_ > 0)
+ PostToPeer(false, DOWNLOAD_INTERRUPT_REASON_NONE);
+}
+
void ByteStreamWriterImpl::Close(
DownloadInterruptReason status) {
DCHECK(my_task_runner_->RunsTasksOnCurrentThread());