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

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

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/public/common/resource_request_body.h ('k') | content/shell/browser/shell.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.cc
diff --git a/content/public/common/resource_request_body.cc b/content/public/common/resource_request_body.cc
index e3235fa8c5e9b9a18709cb60a2d31d45996570f6..e273b9e2a4fc9743e2419452ba31507917d7078e 100644
--- a/content/public/common/resource_request_body.cc
+++ b/content/public/common/resource_request_body.cc
@@ -6,10 +6,38 @@
#include "content/common/resource_request_body_impl.h"
+#if defined(OS_ANDROID)
+#include "content/common/android/resource_request_body_android.h"
+#endif
+
namespace content {
ResourceRequestBody::ResourceRequestBody() {}
ResourceRequestBody::~ResourceRequestBody() {}
+// static
+scoped_refptr<ResourceRequestBody> ResourceRequestBody::CreateFromBytes(
+ const char* bytes,
+ size_t length) {
+ scoped_refptr<ResourceRequestBodyImpl> result = new ResourceRequestBodyImpl();
+ result->AppendBytes(bytes, length);
+ return result;
+}
+
+#if defined(OS_ANDROID)
+base::android::ScopedJavaLocalRef<jobject> ResourceRequestBody::ToJavaObject(
+ JNIEnv* env) {
+ return ConvertResourceRequestBodyToJavaObject(
+ env, static_cast<ResourceRequestBodyImpl*>(this));
+}
+
+// static
+scoped_refptr<ResourceRequestBody> ResourceRequestBody::FromJavaObject(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& java_object) {
+ return ExtractResourceRequestBodyFromJavaObject(env, java_object);
+}
+#endif
+
} // namespace content
« no previous file with comments | « content/public/common/resource_request_body.h ('k') | content/shell/browser/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698