From 8f170168f091f5199ef91ee138b9b030a8a53817 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Wed, 26 Jan 2011 23:42:42 +0000 Subject: 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 --- net/base/upload_data.cc | 1 - net/base/upload_data.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'net') 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::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 { ~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& 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 { 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. -- cgit v1.1