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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/common/resource_request_body.h" 5 #include "content/public/common/resource_request_body.h"
6 6
7 #include "content/common/resource_request_body_impl.h" 7 #include "content/common/resource_request_body_impl.h"
8 8
9 #if defined(OS_ANDROID)
10 #include "content/common/android/resource_request_body_android.h"
11 #endif
12
9 namespace content { 13 namespace content {
10 14
11 ResourceRequestBody::ResourceRequestBody() {} 15 ResourceRequestBody::ResourceRequestBody() {}
12 16
13 ResourceRequestBody::~ResourceRequestBody() {} 17 ResourceRequestBody::~ResourceRequestBody() {}
14 18
19 // static
20 scoped_refptr<ResourceRequestBody> ResourceRequestBody::CreateFromBytes(
21 const char* bytes,
22 size_t length) {
23 scoped_refptr<ResourceRequestBodyImpl> result = new ResourceRequestBodyImpl();
24 result->AppendBytes(bytes, length);
25 return result;
26 }
27
28 #if defined(OS_ANDROID)
29 base::android::ScopedJavaLocalRef<jobject> ResourceRequestBody::ToJavaObject(
30 JNIEnv* env) {
31 return ConvertResourceRequestBodyToJavaObject(
32 env, static_cast<ResourceRequestBodyImpl*>(this));
33 }
34
35 // static
36 scoped_refptr<ResourceRequestBody> ResourceRequestBody::FromJavaObject(
37 JNIEnv* env,
38 const base::android::JavaParamRef<jobject>& java_object) {
39 return ExtractResourceRequestBodyFromJavaObject(env, java_object);
40 }
41 #endif
42
15 } // namespace content 43 } // namespace content
OLDNEW
« 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