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

Unified Diff: content/renderer/history_serialization.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/public/common/page_state.cc ('k') | content/renderer/http_body_conversions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/history_serialization.cc
diff --git a/content/renderer/history_serialization.cc b/content/renderer/history_serialization.cc
index ac85324c1c097f5e0294936da7a1a0ef40a0e13b..ee5981afa3fdede74589a74bd82311a614c5f09e 100644
--- a/content/renderer/history_serialization.cc
+++ b/content/renderer/history_serialization.cc
@@ -7,10 +7,10 @@
#include <stddef.h>
#include "base/strings/nullable_string16.h"
+#include "content/child/web_url_request_util.h"
#include "content/common/page_state_serialization.h"
#include "content/public/common/page_state.h"
#include "content/renderer/history_entry.h"
-#include "content/renderer/http_body_conversions.h"
#include "third_party/WebKit/public/platform/WebData.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/public/platform/WebHTTPBody.h"
@@ -56,15 +56,8 @@ void GenerateFrameStateFromItem(const WebHistoryItem& item,
state->http_body.http_content_type = item.httpContentType();
const WebHTTPBody& http_body = item.httpBody();
- state->http_body.is_null = http_body.isNull();
- if (!state->http_body.is_null) {
- state->http_body.identifier = http_body.identifier();
- state->http_body.elements.resize(http_body.elementCount());
- for (size_t i = 0; i < http_body.elementCount(); ++i) {
- WebHTTPBody::Element element;
- http_body.elementAt(i, element);
- ConvertToHttpBodyElement(element, &state->http_body.elements[i]);
- }
+ if (!http_body.isNull()) {
+ state->http_body.request_body = GetRequestBodyForWebHTTPBody(http_body);
state->http_body.contains_passwords = http_body.containsPasswordData();
}
}
@@ -111,13 +104,9 @@ void RecursivelyGenerateHistoryItem(const ExplodedFrameState& state,
item.setDocumentSequenceNumber(state.document_sequence_number);
item.setHTTPContentType(state.http_body.http_content_type);
- if (!state.http_body.is_null) {
- WebHTTPBody http_body;
- http_body.initialize();
- http_body.setIdentifier(state.http_body.identifier);
- for (size_t i = 0; i < state.http_body.elements.size(); ++i)
- AppendHttpBodyElement(state.http_body.elements[i], &http_body);
- item.setHTTPBody(http_body);
+ if (state.http_body.request_body != nullptr) {
+ item.setHTTPBody(
+ GetWebHTTPBodyForRequestBody(state.http_body.request_body));
}
node->set_item(item);
« no previous file with comments | « content/public/common/page_state.cc ('k') | content/renderer/http_body_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698