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 "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" | 7 #include "base/android/jni_android.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/app/android/chrome_main_delegate_android.h" | 9 #include "chrome/app/android/chrome_main_delegate_android.h" |
10 #include "chrome/common/chrome_version_info.h" | |
10 #include "content/public/app/android_library_loader_hooks.h" | 11 #include "content/public/app/android_library_loader_hooks.h" |
11 #include "content/public/app/content_main.h" | 12 #include "content/public/app/content_main.h" |
12 #include "net/proxy/proxy_resolver_v8.h" | 13 #include "net/proxy/proxy_resolver_v8.h" |
13 | 14 |
14 jint RunChrome(JavaVM* vm, ChromeMainDelegateAndroid* main_delegate) { | 15 jint RunChrome(JavaVM* vm, ChromeMainDelegateAndroid* main_delegate) { |
15 base::android::InitVM(vm); | 16 base::android::InitVM(vm); |
16 JNIEnv* env = base::android::AttachCurrentThread(); | 17 JNIEnv* env = base::android::AttachCurrentThread(); |
17 if (!content::RegisterLibraryLoaderEntryHook(env)) | 18 if (!content::RegisterLibraryLoaderEntryHook(env)) |
18 return -1; | 19 return -1; |
19 | 20 |
21 // Pass the library version number to content so that we can check it from the | |
22 // Java side before continuing initialization | |
23 chrome::VersionInfo vi; | |
24 content::SetVersionName(vi.Version()); | |
joth
2013/11/11 20:28:56
Version() returns the version "number" so bit conf
aberent
2013/11/13 20:20:52
I thought originally that this was going to match
| |
25 | |
20 DCHECK(main_delegate); | 26 DCHECK(main_delegate); |
21 content::SetContentMainDelegate(main_delegate); | 27 content::SetContentMainDelegate(main_delegate); |
22 | 28 |
23 // http://crbug.com/173648 . V8's default isolate is used by ProxyResolverV8 | 29 // http://crbug.com/173648 . V8's default isolate is used by ProxyResolverV8 |
24 // to resolve PAC urls. The default isolate is created by static initializer | 30 // to resolve PAC urls. The default isolate is created by static initializer |
25 // on the shared library thread, and can only be looked up in that thread's | 31 // on the shared library thread, and can only be looked up in that thread's |
26 // TLS. | 32 // TLS. |
27 net::ProxyResolverV8::RememberDefaultIsolate(); | 33 net::ProxyResolverV8::RememberDefaultIsolate(); |
28 | 34 |
29 return JNI_VERSION_1_4; | 35 return JNI_VERSION_1_4; |
30 } | 36 } |
OLD | NEW |