• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // This file encapsulates the JNI headers generated for IntStringCallback, so
6 // that the methods defined in the generated headers only end up in one object
7 // file. This is similar to //base/android/callback_android.*.
8 
9 #include "base/android/int_string_callback.h"
10 
11 #include <jni.h>
12 
13 #include "base/android/jni_string.h"
14 
15 // Must come after all headers that specialize FromJniType() / ToJniType().
16 #include "base/base_jni/IntStringCallback_jni.h"
17 
18 namespace base {
19 namespace android {
20 
RunIntStringCallbackAndroid(const JavaRef<jobject> & callback,int int_arg,const std::string & str_arg)21 void RunIntStringCallbackAndroid(const JavaRef<jobject>& callback,
22                                  int int_arg,
23                                  const std::string& str_arg) {
24   JNIEnv* env = jni_zero::AttachCurrentThread();
25   Java_IntStringCallback_onResult(env, callback, int_arg,
26                                   ConvertUTF8ToJavaString(env, str_arg));
27 }
28 
29 }  // namespace android
30 }  // namespace base
31