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

Unified Diff: content/common/page_state_serialization.cc

Issue 2406053002: PlzNavigate: Fix the failing ContinueWhereILeftOffTest.PostWithPassword test. (Closed)
Patch Set: Address comments Created 4 years, 2 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/child/web_url_request_util.cc ('k') | content/common/resource_messages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/page_state_serialization.cc
diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc
index 2d4782e27b6f12e1d5e44bd35fe867fb37a5a8ae..3e52960c1f6dea808939410e3e7233289505679d 100644
--- a/content/common/page_state_serialization.cc
+++ b/content/common/page_state_serialization.cc
@@ -765,6 +765,10 @@ scoped_refptr<ResourceRequestBodyImpl> DecodeResourceRequestBody(
scoped_refptr<ResourceRequestBodyImpl> result = new ResourceRequestBodyImpl();
SerializeObject obj(data, static_cast<int>(size));
ReadResourceRequestBody(&obj, result);
+ // Please see the EncodeResourceRequestBody() function below for information
+ // about why the contains_sensitive_info() field is being explicitly
+ // deserialized.
+ result->set_contains_sensitive_info(ReadBoolean(&obj));
return obj.parse_error ? nullptr : result;
}
@@ -773,6 +777,11 @@ std::string EncodeResourceRequestBody(
SerializeObject obj;
obj.version = kCurrentVersion;
WriteResourceRequestBody(resource_request_body, &obj);
+ // EncodeResourceRequestBody() is different from WriteResourceRequestBody()
+ // because it covers additional data (e.g.|contains_sensitive_info|) which
+ // is marshaled between native code and java. WriteResourceRequestBody()
+ // serializes data which needs to be saved out to disk.
+ WriteBoolean(resource_request_body.contains_sensitive_info(), &obj);
return obj.GetAsString();
}
« no previous file with comments | « content/child/web_url_request_util.cc ('k') | content/common/resource_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698