blob: 0805d8dd9f88d57a24081ef4803771719e7744a0 [file] [log] [blame]
tedchoc7efe9792016-05-21 00:35:491// Copyright 2016 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.
4
5#ifndef BASE_ANDROID_CALLBACK_ANDROID_H_
6#define BASE_ANDROID_CALLBACK_ANDROID_H_
7
8#include <jni.h>
Sky Maliceae1742a2018-07-02 18:40:599#include <string>
tedchoc69a502c2017-04-07 18:11:3610#include <vector>
tedchoc7efe9792016-05-21 00:35:4911
12#include "base/android/scoped_java_ref.h"
13#include "base/base_export.h"
14
tedchoc69a502c2017-04-07 18:11:3615// Provides helper utility methods that run the given callback with the
16// specified argument.
tedchoc7efe9792016-05-21 00:35:4917namespace base {
18namespace android {
19
Sky Maliceae1742a2018-07-02 18:40:5920void BASE_EXPORT RunObjectCallbackAndroid(const JavaRef<jobject>& callback,
21 const JavaRef<jobject>& arg);
tedchoc7efe9792016-05-21 00:35:4922
Sky Maliceae1742a2018-07-02 18:40:5923void BASE_EXPORT RunBooleanCallbackAndroid(const JavaRef<jobject>& callback,
24 bool arg);
tedchoc7efe9792016-05-21 00:35:4925
Sky Maliceae1742a2018-07-02 18:40:5926void BASE_EXPORT RunIntCallbackAndroid(const JavaRef<jobject>& callback,
27 int arg);
dewittj457b52532016-06-13 21:42:4628
Yaron Friedman0dc3d912018-04-12 16:41:3629void BASE_EXPORT RunStringCallbackAndroid(const JavaRef<jobject>& callback,
30 const std::string& arg);
31
Sky Maliceae1742a2018-07-02 18:40:5932void BASE_EXPORT RunByteArrayCallbackAndroid(const JavaRef<jobject>& callback,
33 const std::vector<uint8_t>& arg);
tedchoc69a502c2017-04-07 18:11:3634
Boris Sazonov39d6a8092018-12-04 22:16:2935void BASE_EXPORT RunRunnableAndroid(const JavaRef<jobject>& runnable);
36
tedchoc7efe9792016-05-21 00:35:4937} // namespace android
38} // namespace base
39
40#endif // BASE_ANDROID_CALLBACK_ANDROID_H_