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

Unified Diff: content/public/common/resource_request_body.h

Issue 2030473002: ABANDONED CL: Using ResourceRequestBody as the type of browser_initiated_post_data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make-resource-request-body-public
Patch Set: Rebasing... 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/browser/page_navigator.h ('k') | content/public/common/resource_request_body.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/resource_request_body.h
diff --git a/content/public/common/resource_request_body.h b/content/public/common/resource_request_body.h
index 0634706b418dec78824fba52645f32aa184d9052..061d1bc055d792bac1a14a141504927c9f90cf8c 100644
--- a/content/public/common/resource_request_body.h
+++ b/content/public/common/resource_request_body.h
@@ -7,17 +7,38 @@
#include <stdint.h>
+#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "build/build_config.h"
#include "content/common/content_export.h"
+#if defined(OS_ANDROID)
+#include <jni.h>
+#include "base/android/scoped_java_ref.h"
+#endif
+
namespace content {
// ResourceRequestBody represents body (i.e. upload data) of a HTTP request.
class CONTENT_EXPORT ResourceRequestBody
: public base::RefCountedThreadSafe<ResourceRequestBody> {
+ public:
+ // Creates ResourceRequestBody that holds a copy of |bytes|.
+ static scoped_refptr<ResourceRequestBody> CreateFromBytes(const char* bytes,
+ size_t length);
+ static scoped_refptr<ResourceRequestBody> CreateFromBytes(
+ const std::string& bytes);
+
+#if defined(OS_ANDROID)
+ // Converts ResourceRequestBody to a Java byte array.
+ // Works only for ResourceRequestBodies created via CreateFromBytes above.
+ virtual base::android::ScopedJavaLocalRef<jbyteArray> ToJavaByteArray(
+ JNIEnv* env) const = 0;
+#endif
+
protected:
ResourceRequestBody();
virtual ~ResourceRequestBody();
« no previous file with comments | « content/public/browser/page_navigator.h ('k') | content/public/common/resource_request_body.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698