| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_JAVA_GIN_JAVA_METHOD_INVOCATION_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_METHOD_INVOCATION_HELPER_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_METHOD_INVOCATION_HELPER_H_ | 6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_METHOD_INVOCATION_HELPER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 JNIEnv* env) = 0; | 48 JNIEnv* env) = 0; |
| 49 virtual const JavaMethod* FindMethod(const std::string& method_name, | 49 virtual const JavaMethod* FindMethod(const std::string& method_name, |
| 50 size_t num_parameters) = 0; | 50 size_t num_parameters) = 0; |
| 51 virtual bool IsObjectGetClassMethod(const JavaMethod* method) = 0; | 51 virtual bool IsObjectGetClassMethod(const JavaMethod* method) = 0; |
| 52 virtual const base::android::JavaRef<jclass>& GetSafeAnnotationClass() = 0; | 52 virtual const base::android::JavaRef<jclass>& GetSafeAnnotationClass() = 0; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(ObjectDelegate); | 55 DISALLOW_COPY_AND_ASSIGN(ObjectDelegate); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 GinJavaMethodInvocationHelper(scoped_ptr<ObjectDelegate> object, | 58 GinJavaMethodInvocationHelper(std::unique_ptr<ObjectDelegate> object, |
| 59 const std::string& method_name, | 59 const std::string& method_name, |
| 60 const base::ListValue& arguments); | 60 const base::ListValue& arguments); |
| 61 void Init(DispatcherDelegate* dispatcher); | 61 void Init(DispatcherDelegate* dispatcher); |
| 62 | 62 |
| 63 void Invoke(); | 63 void Invoke(); |
| 64 | 64 |
| 65 bool HoldsPrimitiveResult(); | 65 bool HoldsPrimitiveResult(); |
| 66 const base::ListValue& GetPrimitiveResult(); | 66 const base::ListValue& GetPrimitiveResult(); |
| 67 const base::android::JavaRef<jobject>& GetObjectResult(); | 67 const base::android::JavaRef<jobject>& GetObjectResult(); |
| 68 const base::android::JavaRef<jclass>& GetSafeAnnotationClass(); | 68 const base::android::JavaRef<jclass>& GetSafeAnnotationClass(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 87 jvalue* parameters); | 87 jvalue* parameters); |
| 88 void SetInvocationError(GinJavaBridgeError error); | 88 void SetInvocationError(GinJavaBridgeError error); |
| 89 void SetPrimitiveResult(const base::ListValue& result_wrapper); | 89 void SetPrimitiveResult(const base::ListValue& result_wrapper); |
| 90 void SetObjectResult( | 90 void SetObjectResult( |
| 91 const base::android::JavaRef<jobject>& object, | 91 const base::android::JavaRef<jobject>& object, |
| 92 const base::android::JavaRef<jclass>& safe_annotation_clazz); | 92 const base::android::JavaRef<jclass>& safe_annotation_clazz); |
| 93 | 93 |
| 94 typedef std::map<GinJavaBoundObject::ObjectID, | 94 typedef std::map<GinJavaBoundObject::ObjectID, |
| 95 JavaObjectWeakGlobalRef> ObjectRefs; | 95 JavaObjectWeakGlobalRef> ObjectRefs; |
| 96 | 96 |
| 97 scoped_ptr<ObjectDelegate> object_; | 97 std::unique_ptr<ObjectDelegate> object_; |
| 98 const std::string method_name_; | 98 const std::string method_name_; |
| 99 scoped_ptr<base::ListValue> arguments_; | 99 std::unique_ptr<base::ListValue> arguments_; |
| 100 ObjectRefs object_refs_; | 100 ObjectRefs object_refs_; |
| 101 bool holds_primitive_result_; | 101 bool holds_primitive_result_; |
| 102 scoped_ptr<base::ListValue> primitive_result_; | 102 std::unique_ptr<base::ListValue> primitive_result_; |
| 103 GinJavaBridgeError invocation_error_; | 103 GinJavaBridgeError invocation_error_; |
| 104 base::android::ScopedJavaGlobalRef<jobject> object_result_; | 104 base::android::ScopedJavaGlobalRef<jobject> object_result_; |
| 105 base::android::ScopedJavaGlobalRef<jclass> safe_annotation_clazz_; | 105 base::android::ScopedJavaGlobalRef<jclass> safe_annotation_clazz_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(GinJavaMethodInvocationHelper); | 107 DISALLOW_COPY_AND_ASSIGN(GinJavaMethodInvocationHelper); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace content | 110 } // namespace content |
| 111 | 111 |
| 112 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_METHOD_INVOCATION_HELPER_H_ | 112 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_METHOD_INVOCATION_HELPER_H_ |
| OLD | NEW |