diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 23:42:42 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 23:42:42 +0000 |
commit | 8f170168f091f5199ef91ee138b9b030a8a53817 (patch) | |
tree | eff82afe27264a0cfccfee837a16442a77892f92 /net | |
parent | 87e57e72ad7fefdcb4ee3e952ce27829018c0b66 (diff) | |
download | chromium_src-8f170168f091f5199ef91ee138b9b030a8a53817.zip chromium_src-8f170168f091f5199ef91ee138b9b030a8a53817.tar.gz chromium_src-8f170168f091f5199ef91ee138b9b030a8a53817.tar.bz2 |
Add support for chunked encoding in ChromeFrame for POST requests. This fixes the
URLRequestTestHTTP.TestPostChunkedDataBeforeStart net test failure in ChromeFrame.
To support chunked encoding we need to marshal the corresponding information in the
net::UploadData object to ensure that this object gets reconstructed correctly on the
other side (CF).
Disabled the URLRequestTestHTTP.TestPostChunkedDataAfterStart for ChromeFrame as this
test modifies the UploadData object after it has been marshaled over to CF which we don't
support in ChromeFrame.
BUG=none
TEST=Covered by existing net tests.
Review URL: http://codereview.chromium.org/6357017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/upload_data.cc | 1 | ||||
-rw-r--r-- | net/base/upload_data.h | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/net/base/upload_data.cc b/net/base/upload_data.cc index 1dd8bbc..490029c 100644 --- a/net/base/upload_data.cc +++ b/net/base/upload_data.cc @@ -159,7 +159,6 @@ void UploadData::set_chunk_callback(ChunkCallback* callback) { } uint64 UploadData::GetContentLength() { - DCHECK(!is_chunked_); uint64 len = 0; std::vector<Element>::iterator it = elements_.begin(); for (; it != elements_.end(); ++it) diff --git a/net/base/upload_data.h b/net/base/upload_data.h index 68ca26b..e746f65 100644 --- a/net/base/upload_data.h +++ b/net/base/upload_data.h @@ -48,6 +48,12 @@ class UploadData : public base::RefCounted<UploadData> { ~Element(); Type type() const { return type_; } + // Explicitly sets the type of this Element. Used during IPC + // marshalling. + void set_type(Type type) { + type_ = type; + } + const std::vector<char>& bytes() const { return bytes_; } const FilePath& file_path() const { return file_path_; } uint64 file_range_offset() const { return file_range_offset_; } @@ -93,6 +99,10 @@ class UploadData : public base::RefCounted<UploadData> { void SetToChunk(const char* bytes, int bytes_len); bool is_last_chunk() const { return is_last_chunk_; } + // Sets whether this is the last chunk. Used during IPC marshalling. + void set_is_last_chunk(bool is_last_chunk) { + is_last_chunk_ = is_last_chunk; + } // Returns the byte-length of the element. For files that do not exist, 0 // is returned. This is done for consistency with Mozilla. |