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

Side by Side Diff: base/android/base_jni_onload.cc

Issue 995313003: Moving the initialization of AtExitManager to base::android::Init() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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
« no previous file with comments | « no previous file | base/android/library_loader/library_loader_hooks.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/base_jni_onload.h" 5 #include "base/android/base_jni_onload.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_utils.h" 8 #include "base/android/jni_utils.h"
9 #include "base/android/library_loader/library_loader_hooks.h" 9 #include "base/android/library_loader/library_loader_hooks.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 11
12 namespace base { 12 namespace base {
13 namespace android { 13 namespace android {
14 14
15 namespace { 15 namespace {
16 16
17 bool RegisterJNI(JNIEnv* env) { 17 bool RegisterJNI(JNIEnv* env) {
18 return RegisterLibraryLoaderEntryHook(env); 18 return RegisterLibraryLoaderEntryHook(env);
19 } 19 }
20 20
21 bool Init() { 21 bool Init() {
22 InitAtExitManager();
22 JNIEnv* env = base::android::AttachCurrentThread(); 23 JNIEnv* env = base::android::AttachCurrentThread();
23 base::android::InitReplacementClassLoader(env, 24 base::android::InitReplacementClassLoader(env,
24 base::android::GetClassLoader(env)); 25 base::android::GetClassLoader(env));
25 return true; 26 return true;
26 } 27 }
27 28
28 } // namespace 29 } // namespace
29 30
30 31
31 bool OnJNIOnLoadRegisterJNI(JavaVM* vm, 32 bool OnJNIOnLoadRegisterJNI(JavaVM* vm,
(...skipping 15 matching lines...) Expand all
47 for (std::vector<InitCallback>::reverse_iterator i = 48 for (std::vector<InitCallback>::reverse_iterator i =
48 callbacks.rbegin(); i != callbacks.rend(); ++i) { 49 callbacks.rbegin(); i != callbacks.rend(); ++i) {
49 if (!i->Run()) 50 if (!i->Run())
50 return false; 51 return false;
51 } 52 }
52 return true; 53 return true;
53 } 54 }
54 55
55 } // namespace android 56 } // namespace android
56 } // namespace base 57 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/android/library_loader/library_loader_hooks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698