| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/android/jni_registrar.h" | 5 #include "base/android/jni_registrar.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 | 9 |
| 10 namespace base { | 10 namespace base { |
| 11 namespace android { | 11 namespace android { |
| 12 | 12 |
| 13 bool RegisterNativeMethods(JNIEnv* env, | 13 bool RegisterNativeMethods(JNIEnv* env, |
| 14 const RegistrationMethod* method, | 14 const RegistrationMethod* method, |
| 15 size_t count) { | 15 size_t count) { |
| 16 const RegistrationMethod* end = method + count; | 16 const RegistrationMethod* end = method + count; |
| 17 while (method != end) { | 17 while (method != end) { |
| 18 if (!method->func(env) < 0) { | 18 if (!method->func(env)) { |
| 19 DLOG(ERROR) << method->name << " failed registration!"; | 19 DLOG(ERROR) << method->name << " failed registration!"; |
| 20 return false; | 20 return false; |
| 21 } | 21 } |
| 22 method++; | 22 method++; |
| 23 } | 23 } |
| 24 return true; | 24 return true; |
| 25 } | 25 } |
| 26 | 26 |
| 27 } // namespace android | 27 } // namespace android |
| 28 } // namespace base | 28 } // namespace base |
| OLD | NEW |