Roll leveldb 3f7758:803d69 (v1.17 -> v1.18)
[chromium-blink-merge.git] / components / devtools_bridge / test / android / javatests / jni / jni_onload.cc
blob8fc7480088329a336ef762076048b5e7b4cf6c55
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
3 // found in the LICENSE file.
5 #include "base/android/base_jni_registrar.h"
6 #include "base/android/jni_android.h"
7 #include "base/android/library_loader/library_loader_hooks.h"
8 #include "components/devtools_bridge/android/session_dependency_factory_android.h"
10 using namespace devtools_bridge::android;
12 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
13 base::android::InitVM(vm);
14 JNIEnv* env = base::android::AttachCurrentThread();
15 if (!base::android::RegisterLibraryLoaderEntryHook(env)) {
16 return -1;
18 if (!base::android::RegisterJni(env)) {
19 return -1;
21 if (!SessionDependencyFactoryAndroid::InitializeSSL()) {
22 return -1;
24 SessionDependencyFactoryAndroid::RegisterNatives(env);
25 return JNI_VERSION_1_4;