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

Unified Diff: content/common/page_state_serialization.cc

Issue 2406053002: PlzNavigate: Fix the failing ContinueWhereILeftOffTest.PostWithPassword test. (Closed)
Patch Set: Address comments and add code to serialize and deserialize the contains_sensitive_info_ field in th… 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
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..dcfd25e06c8b5c3586ed0367bc9aa0e16ff4e36c 100644
--- a/content/common/page_state_serialization.cc
+++ b/content/common/page_state_serialization.cc
@@ -765,6 +765,9 @@ 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
+ // this is being explicitl deserialized.
Łukasz Anforowicz 2016/10/15 00:02:27 nit:explicitly nit:s/this/that/
ananta 2016/10/15 00:23:31 Done.
+ result->set_contains_sensitive_info(ReadBoolean(&obj));
return obj.parse_error ? nullptr : result;
}
@@ -773,6 +776,10 @@ std::string EncodeResourceRequestBody(
SerializeObject obj;
obj.version = kCurrentVersion;
WriteResourceRequestBody(resource_request_body, &obj);
+ // We are serializing the contains_sensitive_info() field explicitly to avoid
+ // changing the WriteResourceRequestBody function which would require a
+ // PageState version update.
Łukasz Anforowicz 2016/10/15 00:02:27 Maybe we could tweak the comment to say why Encode
ananta 2016/10/15 00:23:31 Done.
+ WriteBoolean(resource_request_body.contains_sensitive_info(), &obj);
return obj.GetAsString();
}

Powered by Google App Engine
This is Rietveld 408576698