Give names to all utility processes.
[chromium-blink-merge.git] / chrome / app / android / chrome_jni_onload.cc
blob124e3c2b7f05c18d9462228fddad4d7ba680b511
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
3 // found in the LICENSE file.
5 #include "chrome/app/android/chrome_jni_onload.h"
7 #include "base/android/library_loader/library_loader_hooks.h"
8 #include "base/bind.h"
9 #include "chrome/app/android/chrome_android_initializer.h"
10 #include "chrome/browser/android/chrome_jni_registrar.h"
11 #include "content/public/app/content_jni_onload.h"
13 namespace chrome {
14 namespace android {
16 namespace {
18 bool RegisterJNI(JNIEnv* env) {
19 if (base::android::GetLibraryProcessType(env) ==
20 base::android::PROCESS_BROWSER) {
21 return RegisterBrowserJNI(env);
23 return true;
26 bool Init() {
27 return RunChrome();
30 } // namespace
32 bool OnJNIOnLoadRegisterJNI(
33 JavaVM* vm,
34 base::android::RegisterCallback callback) {
35 std::vector<base::android::RegisterCallback> register_callbacks;
36 register_callbacks.push_back(callback);
37 register_callbacks.push_back(base::Bind(&RegisterJNI));
38 return content::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks);
41 bool OnJNIOnLoadInit(base::android::InitCallback callback) {
42 std::vector<base::android::InitCallback> init_callbacks;
43 init_callbacks.push_back(callback);
44 init_callbacks.push_back(base::Bind(&Init));
45 return content::android::OnJNIOnLoadInit(init_callbacks);
48 } // namespace android
49 } // namespace chrome