| 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 #include "content/browser/android/java/gin_java_method_invocation_helper.h" | 5 #include "content/browser/android/java/gin_java_method_invocation_helper.h" |
| 6 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 const base::android::JavaRef<jobject>& | 202 const base::android::JavaRef<jobject>& |
| 203 GinJavaMethodInvocationHelper::GetObjectResult() { | 203 GinJavaMethodInvocationHelper::GetObjectResult() { |
| 204 return object_result_; | 204 return object_result_; |
| 205 } | 205 } |
| 206 | 206 |
| 207 const base::android::JavaRef<jclass>& | 207 const base::android::JavaRef<jclass>& |
| 208 GinJavaMethodInvocationHelper::GetSafeAnnotationClass() { | 208 GinJavaMethodInvocationHelper::GetSafeAnnotationClass() { |
| 209 return safe_annotation_clazz_; | 209 return safe_annotation_clazz_; |
| 210 } | 210 } |
| 211 | 211 |
| 212 const GinJavaBridgeError GinJavaMethodInvocationHelper::GetInvocationError() { | 212 GinJavaBridgeError GinJavaMethodInvocationHelper::GetInvocationError() { |
| 213 return invocation_error_; | 213 return invocation_error_; |
| 214 } | 214 } |
| 215 | 215 |
| 216 void GinJavaMethodInvocationHelper::InvokeMethod(jobject object, | 216 void GinJavaMethodInvocationHelper::InvokeMethod(jobject object, |
| 217 jclass clazz, | 217 jclass clazz, |
| 218 const JavaType& return_type, | 218 const JavaType& return_type, |
| 219 jmethodID id, | 219 jmethodID id, |
| 220 jvalue* parameters) { | 220 jvalue* parameters) { |
| 221 DCHECK(object || clazz); | 221 DCHECK(object || clazz); |
| 222 JNIEnv* env = AttachCurrentThread(); | 222 JNIEnv* env = AttachCurrentThread(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 } | 336 } |
| 337 // This is for all cases except JavaType::TypeObject. | 337 // This is for all cases except JavaType::TypeObject. |
| 338 if (!base::android::ClearException(env)) { | 338 if (!base::android::ClearException(env)) { |
| 339 SetPrimitiveResult(result_wrapper); | 339 SetPrimitiveResult(result_wrapper); |
| 340 } else { | 340 } else { |
| 341 SetInvocationError(kGinJavaBridgeJavaExceptionRaised); | 341 SetInvocationError(kGinJavaBridgeJavaExceptionRaised); |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace content | 345 } // namespace content |
| OLD | NEW |