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

Unified Diff: content/public/common/page_state.cc

Issue 2012913002: Deduping conversions between ResourceRequestBody/WebHTTPBody/ExplodedHttpBody. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-rid-of-exploded-http-body
Patch Set: Calling ResourceRequestBody::AppendFileRange with optional_body_file_path. Created 4 years, 7 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 | « content/content_renderer.gypi ('k') | content/renderer/history_serialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/page_state.cc
diff --git a/content/public/common/page_state.cc b/content/public/common/page_state.cc
index 74f65df7b97383ed190a6412f334d0ead3a7667f..5dddc498277983436c9422f4ec03e58d0d22694f 100644
--- a/content/public/common/page_state.cc
+++ b/content/public/common/page_state.cc
@@ -85,16 +85,18 @@ PageState PageState::CreateForTesting(
state.top.url_string = ToNullableString16(url.possibly_invalid_spec());
if (optional_body_data || optional_body_file_path) {
- state.top.http_body.is_null = false;
if (optional_body_data) {
- ExplodedHttpBodyElement element;
std::string body_data(optional_body_data);
- element.SetToBytes(body_data.data(), body_data.size());
- state.top.http_body.elements.push_back(element);
+ state.top.http_body.request_body = new ResourceRequestBody();
+ state.top.http_body.request_body->AppendBytes(body_data.data(),
+ body_data.size());
}
if (optional_body_file_path) {
- ExplodedHttpBodyElement element;
- element.SetToFilePath(*optional_body_file_path);
+ state.top.http_body.request_body = new ResourceRequestBody();
+ state.top.http_body.request_body->AppendFileRange(
+ *optional_body_file_path,
+ 0, std::numeric_limits<uint64_t>::max(),
+ base::Time());
state.referenced_files.push_back(base::NullableString16(
optional_body_file_path->AsUTF16Unsafe(), false));
}
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/history_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698