• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifdef UNSAFE_BUFFERS_BUILD
6 // TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
7 #pragma allow_unsafe_buffers
8 #endif
9 
10 #include "base/android/jni_registrar.h"
11 
12 #include "base/android/jni_android.h"
13 #include "base/logging.h"
14 #include "base/trace_event/base_tracing.h"
15 
16 namespace base {
17 namespace android {
18 
RegisterNativeMethods(JNIEnv * env,const RegistrationMethod * method,size_t count)19 bool RegisterNativeMethods(JNIEnv* env,
20                            const RegistrationMethod* method,
21                            size_t count) {
22   TRACE_EVENT0("startup", "base_android::RegisterNativeMethods");
23   const RegistrationMethod* end = method + count;
24   while (method != end) {
25     if (!method->func(env)) {
26       DLOG(ERROR) << method->name << " failed registration!";
27       return false;
28     }
29     method++;
30   }
31   return true;
32 }
33 
34 }  // namespace android
35 }  // namespace base
36