Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: base/android/jni_generator/SampleForTests_jni.golden

Issue 2501193003: Selectively perform JNI registration in render processes on Android. (Closed)
Patch Set: Conditionally register JNI based on process type. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // This file is autogenerated by 5 // This file is autogenerated by
6 // base/android/jni_generator/jni_generator.py 6 // base/android/jni_generator/jni_generator.py
7 // For 7 // For
8 // org/chromium/example/jni_generator/SampleForTests 8 // org/chromium/example/jni_generator/SampleForTests
9 9
10 #ifndef org_chromium_example_jni_generator_SampleForTests_JNI 10 #ifndef org_chromium_example_jni_generator_SampleForTests_JNI
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 "(" 477 "("
478 "J" 478 "J"
479 ")" 479 ")"
480 "Ljava/lang/String;", 480 "Ljava/lang/String;",
481 reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTe sts_nativeReturnAString) 481 reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTe sts_nativeReturnAString)
482 }, 482 },
483 }; 483 };
484 484
485 static bool RegisterNativesImpl(JNIEnv* env) { 485 static bool RegisterNativesImpl(JNIEnv* env) {
486 if (base::android::IsManualJniRegistrationDisabled()) return true; 486 if (base::android::IsManualJniRegistrationDisabled()) return true;
487 base::android::LibraryProcessType proc_type =
488 base::android::GetLibraryProcessType(env);
489 if (proc_type != base::android::PROCESS_BROWSER &&
490 proc_type != base::android::PROCESS_UNINITIALIZED) {
491 return true;
492 }
487 493
488 const int kMethodsInnerClassSize = arraysize(kMethodsInnerClass); 494 const int kMethodsInnerClassSize = arraysize(kMethodsInnerClass);
489 495
490 if (env->RegisterNatives(InnerClass_clazz(env), 496 if (env->RegisterNatives(InnerClass_clazz(env),
491 kMethodsInnerClass, 497 kMethodsInnerClass,
492 kMethodsInnerClassSize) < 0) { 498 kMethodsInnerClassSize) < 0) {
493 jni_generator::HandleRegistrationError( 499 jni_generator::HandleRegistrationError(
494 env, InnerClass_clazz(env), __FILE__); 500 env, InnerClass_clazz(env), __FILE__);
495 return false; 501 return false;
496 } 502 }
497 503
498 const int kMethodsSampleForTestsSize = arraysize(kMethodsSampleForTests); 504 const int kMethodsSampleForTestsSize = arraysize(kMethodsSampleForTests);
499 505
500 if (env->RegisterNatives(SampleForTests_clazz(env), 506 if (env->RegisterNatives(SampleForTests_clazz(env),
501 kMethodsSampleForTests, 507 kMethodsSampleForTests,
502 kMethodsSampleForTestsSize) < 0) { 508 kMethodsSampleForTestsSize) < 0) {
503 jni_generator::HandleRegistrationError( 509 jni_generator::HandleRegistrationError(
504 env, SampleForTests_clazz(env), __FILE__); 510 env, SampleForTests_clazz(env), __FILE__);
505 return false; 511 return false;
506 } 512 }
507 513
508 return true; 514 return true;
509 } 515 }
510 516
511 } // namespace android 517 } // namespace android
512 } // namespace base 518 } // namespace base
513 519
514 #endif // org_chromium_example_jni_generator_SampleForTests_JNI 520 #endif // org_chromium_example_jni_generator_SampleForTests_JNI
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698