summaryrefslogtreecommitdiffstats
path: root/base/android/base_jni_onload.h
blob: dcc7756684eba733881b84f6891fe41f16d25ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_ANDROID_BASE_JNI_ONLOAD_H_
#define BASE_ANDROID_BASE_JNI_ONLOAD_H_

#include <jni.h>
#include <vector>

#include "base/base_export.h"
#include "base/callback.h"

namespace base {
namespace android {

// Returns whether JNI registration succeeded. Caller shall put the
// RegisterCallback into |callbacks| in reverse order.
typedef base::Callback<bool(JNIEnv*)> RegisterCallback;
BASE_EXPORT bool OnJNIOnLoadRegisterJNI(
    JavaVM* vm,
    std::vector<RegisterCallback> callbacks);

// Returns whether initialization succeeded. Caller shall put the
// InitCallback into |callbacks| in reverse order.
typedef base::Callback<bool(void)> InitCallback;
BASE_EXPORT bool OnJNIOnLoadInit(std::vector<InitCallback> callbacks);

}  // namespace android
}  // namespace base

#endif  // BASE_ANDROID_BASE_JNI_ONLOAD_H_