Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2552)

Unified Diff: chrome/common/common_param_traits.cc

Issue 6626035: Enable ChromeFrame net tests. These tests regressed with the change in the ch... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome_frame/test/net/fake_external_tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/common_param_traits.cc
===================================================================
--- chrome/common/common_param_traits.cc (revision 76946)
+++ chrome/common/common_param_traits.cc (working copy)
@@ -378,7 +378,19 @@
break;
}
case net::UploadData::TYPE_CHUNK: {
- m->WriteData(&p.bytes()[0], static_cast<int>(p.bytes().size()));
+ std::string chunk_length = StringPrintf("%X\r\n", p.bytes().size());
+ std::vector<char> bytes;
+ bytes.insert(bytes.end(), chunk_length.data(),
+ chunk_length.data() + chunk_length.length());
+ const char* data = &p.bytes()[0];
+ bytes.insert(bytes.end(), data, data + p.bytes().size());
+ const char* crlf = "\r\n";
+ bytes.insert(bytes.end(), crlf, crlf + 2);
+ if (p.is_last_chunk()) {
+ const char* end_of_data = "0\r\n\r\n";
+ bytes.insert(bytes.end(), end_of_data, end_of_data + 5);
+ }
+ m->WriteData(&bytes[0], static_cast<int>(bytes.size()));
// If this element is part of a chunk upload then send over information
// indicating if this is the last chunk.
WriteParam(m, p.is_last_chunk());
« no previous file with comments | « no previous file | chrome_frame/test/net/fake_external_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698