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

Unified Diff: net/base/upload_data.cc

Issue 9270030: net: Don't merge HTTP headers and body if the body is not in memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build Created 8 years, 11 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
Index: net/base/upload_data.cc
diff --git a/net/base/upload_data.cc b/net/base/upload_data.cc
index 913c172b7355bfc46d42d7cf1771bd57b3faf18d..019254e48878c431c31304373c0ef5a9bd5041e7 100644
--- a/net/base/upload_data.cc
+++ b/net/base/upload_data.cc
@@ -177,6 +177,18 @@ uint64 UploadData::GetContentLength() {
return len;
}
+bool UploadData::IsInMemory() const {
+ // Chunks are provided as a stream, hence it's not in memory.
wtc 2012/01/24 19:08:04 Nit: this comment is not 100% accurate. Chunks ar
satorux1 2012/01/24 19:25:42 Done.
+ if (is_chunked_)
wtc 2012/01/24 19:08:04 Question: Is this test necessary? If is_chunked_
satorux1 2012/01/24 19:25:42 I originally thought about it, but there is a case
+ return false;
+
+ for (size_t i = 0; i < elements_.size(); ++i) {
+ if (elements_[i].type() != TYPE_BYTES)
+ return false;
+ }
+ return true;
+}
+
void UploadData::SetElements(const std::vector<Element>& elements) {
elements_ = elements;
}

Powered by Google App Engine
This is Rietveld 408576698