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

Unified Diff: content/common/page_state_serialization.h

Issue 2038233002: Using ResourceRequestBody as the type of HTTP body outside of //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make-resource-request-body-public
Patch Set: Rebasing... Created 4 years, 6 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/common/android/resource_request_body_android.cc ('k') | content/common/page_state_serialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/page_state_serialization.h
diff --git a/content/common/page_state_serialization.h b/content/common/page_state_serialization.h
index 7939094cbed7d605b908617195a0f4d9770674a0..c8bacb785110cba74d984662d33e4641f679832f 100644
--- a/content/common/page_state_serialization.h
+++ b/content/common/page_state_serialization.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include <string>
#include <vector>
#include "base/strings/nullable_string16.h"
@@ -77,6 +78,17 @@ CONTENT_EXPORT bool DecodePageStateWithDeviceScaleFactorForTesting(
const std::string& encoded,
float device_scale_factor,
ExplodedPageState* exploded);
+
+// Converts results of EncodeResourceRequestBody (passed in as a pair of |data|
+// + |size|) back into a ResourceRequestBodyImpl. Returns nullptr if the
+// decoding fails (e.g. if |data| is malformed).
+scoped_refptr<ResourceRequestBodyImpl> DecodeResourceRequestBody(
+ const char* data,
+ size_t size);
+
+// Encodes |resource_request_body| into |encoded|.
+std::string EncodeResourceRequestBody(
+ const ResourceRequestBodyImpl& resource_request_body);
#endif
} // namespace content
« no previous file with comments | « content/common/android/resource_request_body_android.cc ('k') | content/common/page_state_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698