| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_ANDROID_RESOURCE_REQUEST_BODY_JNI_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_RESOURCE_REQUEST_BODY_JNI_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_RESOURCE_REQUEST_BODY_JNI_H_ | 6 #define CONTENT_BROWSER_ANDROID_RESOURCE_REQUEST_BODY_JNI_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class ResourceRequestBodyImpl; | 15 class ResourceRequestBody; |
| 16 | 16 |
| 17 bool RegisterResourceRequestBody(JNIEnv* env); | 17 bool RegisterResourceRequestBody(JNIEnv* env); |
| 18 | 18 |
| 19 // Returns an instance of org.chromium.content_public.common.ResourceRequestBody | 19 // Returns an instance of org.chromium.content_public.common.ResourceRequestBody |
| 20 // that contains serialized representation of the |native_object|. | 20 // that contains serialized representation of the |native_object|. |
| 21 base::android::ScopedJavaLocalRef<jobject> | 21 base::android::ScopedJavaLocalRef<jobject> |
| 22 ConvertResourceRequestBodyToJavaObject( | 22 ConvertResourceRequestBodyToJavaObject( |
| 23 JNIEnv* env, | 23 JNIEnv* env, |
| 24 const scoped_refptr<ResourceRequestBodyImpl>& native_object); | 24 const scoped_refptr<ResourceRequestBody>& native_object); |
| 25 | 25 |
| 26 // Reconstructs the native C++ content::ResourceRequestBody object based on | 26 // Reconstructs the native C++ content::ResourceRequestBody object based on |
| 27 // org.chromium.content_public.common.ResourceRequestBody (|java_object|) passed | 27 // org.chromium.content_public.common.ResourceRequestBody (|java_object|) passed |
| 28 // in as an argument. | 28 // in as an argument. |
| 29 scoped_refptr<ResourceRequestBodyImpl> ExtractResourceRequestBodyFromJavaObject( | 29 scoped_refptr<ResourceRequestBody> ExtractResourceRequestBodyFromJavaObject( |
| 30 JNIEnv* env, | 30 JNIEnv* env, |
| 31 const base::android::JavaParamRef<jobject>& java_object); | 31 const base::android::JavaParamRef<jobject>& java_object); |
| 32 | 32 |
| 33 } // namespace content | 33 } // namespace content |
| 34 | 34 |
| 35 #endif // CONTENT_BROWSER_ANDROID_RESOURCE_REQUEST_BODY_JNI_H_ | 35 #endif // CONTENT_BROWSER_ANDROID_RESOURCE_REQUEST_BODY_JNI_H_ |
| OLD | NEW |