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

Side by Side Diff: chrome/app/android/chrome_android_initializer.cc

Issue 864563002: Separate JNI registration with initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments and sync Created 5 years, 10 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
OLDNEW
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 "chrome/app/android/chrome_android_initializer.h" 5 #include "chrome/app/android/chrome_android_initializer.h"
6 6
7 #include "base/android/jni_android.h"
8 #include "base/android/library_loader/library_loader_hooks.h" 7 #include "base/android/library_loader/library_loader_hooks.h"
9 #include "base/logging.h"
10 #include "chrome/app/android/chrome_main_delegate_android.h" 8 #include "chrome/app/android/chrome_main_delegate_android.h"
11 #include "chrome/common/chrome_version_info.h" 9 #include "chrome/common/chrome_version_info.h"
12 #include "content/public/app/android_library_loader_hooks.h"
13 #include "content/public/app/content_main.h" 10 #include "content/public/app/content_main.h"
14 11
15 jint RunChrome(JavaVM* vm, ChromeMainDelegateAndroid* main_delegate) { 12 bool RunChrome() {
16 base::android::InitVM(vm);
17 JNIEnv* env = base::android::AttachCurrentThread();
18 if (!base::android::RegisterLibraryLoaderEntryHook(env))
19 return -1;
20
21 // Pass the library version number to content so that we can check it from the 13 // Pass the library version number to content so that we can check it from the
22 // Java side before continuing initialization 14 // Java side before continuing initialization
23 chrome::VersionInfo vi; 15 chrome::VersionInfo vi;
24 base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
25 base::android::SetVersionNumber(vi.Version().c_str()); 16 base::android::SetVersionNumber(vi.Version().c_str());
17 content::SetContentMainDelegate(ChromeMainDelegateAndroid::Create());
26 18
27 DCHECK(main_delegate); 19 return true;
28 content::SetContentMainDelegate(main_delegate);
29
30 return JNI_VERSION_1_4;
31 } 20 }
OLDNEW
« no previous file with comments | « chrome/app/android/chrome_android_initializer.h ('k') | chrome/app/android/chrome_jni_onload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698