summaryrefslogtreecommitdiffstats
path: root/net/flip/flip_io_buffer.h
diff options
context:
space:
mode:
authormbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 00:43:06 +0000
committermbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 00:43:06 +0000
commit246f429937fda025fe76c9332015d7647fb33307 (patch)
tree5005419cdd6be63ce5eed0ee70144d0f727de8a7 /net/flip/flip_io_buffer.h
parent025bc9679326c36e9c6cf9a7c466ab64a63eb0be (diff)
downloadchromium_src-246f429937fda025fe76c9332015d7647fb33307.zip
chromium_src-246f429937fda025fe76c9332015d7647fb33307.tar.gz
chromium_src-246f429937fda025fe76c9332015d7647fb33307.tar.bz2
Fix the FlipSession to support partial writes.
Modified the FlipIOBuffer to use a DrainableIOBuffer instead of a IOBufferWithSize. When a write completes, we drain the bytes, and only fetch the next FlipFrame from the queue after we have fully drained the buffer. I will update the tests to be much more thorough in my next CL. BUG=none TEST=FlipNetworkTransactionTest.PartialWrites Review URL: http://codereview.chromium.org/436019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip/flip_io_buffer.h')
-rw-r--r--net/flip/flip_io_buffer.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/flip/flip_io_buffer.h b/net/flip/flip_io_buffer.h
index ffb4b3b..c16c39c 100644
--- a/net/flip/flip_io_buffer.h
+++ b/net/flip/flip_io_buffer.h
@@ -20,15 +20,16 @@ class FlipIOBuffer {
public:
// Constructor
// |buffer| is the actual data buffer.
+ // |size| is the size of the data buffer.
// |priority| is the priority of this buffer. Lower numbers are higher
// priority.
// |stream| is a pointer to the stream which is managing this buffer.
- FlipIOBuffer(IOBufferWithSize* buffer, int priority, FlipStream* stream);
+ FlipIOBuffer(IOBuffer* buffer, int size, int priority, FlipStream* stream);
FlipIOBuffer();
~FlipIOBuffer();
// Accessors.
- IOBuffer* buffer() const { return buffer_; }
+ DrainableIOBuffer* buffer() const { return buffer_; }
size_t size() const { return buffer_->size(); }
void release();
int priority() const { return priority_; }
@@ -42,7 +43,7 @@ class FlipIOBuffer {
}
private:
- scoped_refptr<IOBufferWithSize> buffer_;
+ scoped_refptr<DrainableIOBuffer> buffer_;
int priority_;
uint64 position_;
scoped_refptr<FlipStream> stream_;