summaryrefslogtreecommitdiffstats
path: root/content/browser/byte_stream.cc
diff options
context:
space:
mode:
authortyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 03:59:36 +0000
committertyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-31 03:59:36 +0000
commit566357e5f9a9e1123134ceffdbd68c8683b84198 (patch)
tree1252d61bb0880d7840f097f391688cbdce2eed57 /content/browser/byte_stream.cc
parentfd5b7c9eb2ad8f74144bbaf76b985a8561a771b1 (diff)
downloadchromium_src-566357e5f9a9e1123134ceffdbd68c8683b84198.zip
chromium_src-566357e5f9a9e1123134ceffdbd68c8683b84198.tar.gz
chromium_src-566357e5f9a9e1123134ceffdbd68c8683b84198.tar.bz2
Add Flush() method to ByteStream.
To be used by Stream implementation to push received data to StreamURLRequestJob at arbitrary point. BUG=169957 Review URL: https://chromiumcodereview.appspot.com/18098004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214545 0039d316-1c4b-4281-b951-d872f2087c98
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());