mac: Let IPhotoDataProvider::GetAlbumNames() return albums in a deterministic order.
[chromium-blink-merge.git] / base / android / jni_generator / testNatives.golden
blobf9538a33f2baee4dee1332d8bb67b2d83456e3a9
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 // This file is autogenerated by
6 //     base/android/jni_generator/jni_generator.py
7 // For
8 //     org/chromium/TestJni
10 #ifndef org_chromium_TestJni_JNI
11 #define org_chromium_TestJni_JNI
13 #include <jni.h>
15 #include "base/android/jni_generator/jni_generator_helper.h"
17 #include "base/android/jni_int_wrapper.h"
19 // Step 1: forward declarations.
20 namespace {
21 const char kTestJniClassPath[] = "org/chromium/TestJni";
22 // Leaking this jclass as we cannot use LazyInstance from some threads.
23 jclass g_TestJni_clazz = NULL;
24 #define TestJni_clazz(env) g_TestJni_clazz
26 }  // namespace
28 // Step 2: method stubs.
30 static jint Init(JNIEnv* env, const JavaParamRef<jobject>& jcaller);
32 static jint Java_org_chromium_TestJni_nativeInit(JNIEnv* env, jobject jcaller) {
33   return Init(env, JavaParamRef<jobject>(env, jcaller));
36 static void Java_org_chromium_TestJni_nativeDestroy(JNIEnv* env,
37     jobject jcaller,
38     jint nativeChromeBrowserProvider) {
39   ChromeBrowserProvider* native =
40       reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
41   CHECK_NATIVE_PTR(env, jcaller, native, "Destroy");
42   return native->Destroy(env, JavaParamRef<jobject>(env, jcaller));
45 static jlong Java_org_chromium_TestJni_nativeAddBookmark(JNIEnv* env,
46     jobject jcaller,
47     jint nativeChromeBrowserProvider,
48     jstring url,
49     jstring title,
50     jboolean isFolder,
51     jlong parentId) {
52   ChromeBrowserProvider* native =
53       reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
54   CHECK_NATIVE_PTR(env, jcaller, native, "AddBookmark", 0);
55   return native->AddBookmark(env, JavaParamRef<jobject>(env, jcaller),
56       JavaParamRef<jstring>(env, url), JavaParamRef<jstring>(env, title),
57       isFolder, parentId);
60 static ScopedJavaLocalRef<jstring> GetDomainAndRegistry(JNIEnv* env, const
61     JavaParamRef<jclass>& jcaller,
62     const JavaParamRef<jstring>& url);
64 static jstring Java_org_chromium_TestJni_nativeGetDomainAndRegistry(JNIEnv* env,
65     jclass jcaller,
66     jstring url) {
67   return GetDomainAndRegistry(env, JavaParamRef<jclass>(env, jcaller),
68       JavaParamRef<jstring>(env, url)).Release();
71 static void CreateHistoricalTabFromState(JNIEnv* env, const
72     JavaParamRef<jclass>& jcaller,
73     const JavaParamRef<jbyteArray>& state,
74     jint tab_index);
76 static void Java_org_chromium_TestJni_nativeCreateHistoricalTabFromState(JNIEnv*
77     env, jclass jcaller,
78     jbyteArray state,
79     jint tab_index) {
80   return CreateHistoricalTabFromState(env, JavaParamRef<jclass>(env, jcaller),
81       JavaParamRef<jbyteArray>(env, state), tab_index);
84 static ScopedJavaLocalRef<jbyteArray> GetStateAsByteArray(JNIEnv* env, const
85     JavaParamRef<jobject>& jcaller,
86     const JavaParamRef<jobject>& view);
88 static jbyteArray Java_org_chromium_TestJni_nativeGetStateAsByteArray(JNIEnv*
89     env, jobject jcaller,
90     jobject view) {
91   return GetStateAsByteArray(env, JavaParamRef<jobject>(env, jcaller),
92       JavaParamRef<jobject>(env, view)).Release();
95 static ScopedJavaLocalRef<jobjectArray> GetAutofillProfileGUIDs(JNIEnv* env,
96     const JavaParamRef<jclass>& jcaller);
98 static jobjectArray
99     Java_org_chromium_TestJni_nativeGetAutofillProfileGUIDs(JNIEnv* env, jclass
100     jcaller) {
101   return GetAutofillProfileGUIDs(env, JavaParamRef<jclass>(env,
102       jcaller)).Release();
105 static void SetRecognitionResults(JNIEnv* env, const JavaParamRef<jobject>&
106     jcaller,
107     jint sessionId,
108     const JavaParamRef<jobjectArray>& results);
110 static void Java_org_chromium_TestJni_nativeSetRecognitionResults(JNIEnv* env,
111     jobject jcaller,
112     jint sessionId,
113     jobjectArray results) {
114   return SetRecognitionResults(env, JavaParamRef<jobject>(env, jcaller),
115       sessionId, JavaParamRef<jobjectArray>(env, results));
118 static jlong Java_org_chromium_TestJni_nativeAddBookmarkFromAPI(JNIEnv* env,
119     jobject jcaller,
120     jint nativeChromeBrowserProvider,
121     jstring url,
122     jobject created,
123     jobject isBookmark,
124     jobject date,
125     jbyteArray favicon,
126     jstring title,
127     jobject visits) {
128   ChromeBrowserProvider* native =
129       reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
130   CHECK_NATIVE_PTR(env, jcaller, native, "AddBookmarkFromAPI", 0);
131   return native->AddBookmarkFromAPI(env, JavaParamRef<jobject>(env, jcaller),
132       JavaParamRef<jstring>(env, url), JavaParamRef<jobject>(env, created),
133       JavaParamRef<jobject>(env, isBookmark), JavaParamRef<jobject>(env, date),
134       JavaParamRef<jbyteArray>(env, favicon), JavaParamRef<jstring>(env, title),
135       JavaParamRef<jobject>(env, visits));
138 static jint FindAll(JNIEnv* env, const JavaParamRef<jobject>& jcaller,
139     const JavaParamRef<jstring>& find);
141 static jint Java_org_chromium_TestJni_nativeFindAll(JNIEnv* env, jobject
142     jcaller,
143     jstring find) {
144   return FindAll(env, JavaParamRef<jobject>(env, jcaller),
145       JavaParamRef<jstring>(env, find));
148 static ScopedJavaLocalRef<jobject> GetInnerClass(JNIEnv* env, const
149     JavaParamRef<jclass>& jcaller);
151 static jobject Java_org_chromium_TestJni_nativeGetInnerClass(JNIEnv* env, jclass
152     jcaller) {
153   return GetInnerClass(env, JavaParamRef<jclass>(env, jcaller)).Release();
156 static jobject Java_org_chromium_TestJni_nativeQueryBitmap(JNIEnv* env,
157     jobject jcaller,
158     jint nativeChromeBrowserProvider,
159     jobjectArray projection,
160     jstring selection,
161     jobjectArray selectionArgs,
162     jstring sortOrder) {
163   ChromeBrowserProvider* native =
164       reinterpret_cast<ChromeBrowserProvider*>(nativeChromeBrowserProvider);
165   CHECK_NATIVE_PTR(env, jcaller, native, "QueryBitmap", NULL);
166   return native->QueryBitmap(env, JavaParamRef<jobject>(env, jcaller),
167       JavaParamRef<jobjectArray>(env, projection), JavaParamRef<jstring>(env,
168       selection), JavaParamRef<jobjectArray>(env, selectionArgs),
169       JavaParamRef<jstring>(env, sortOrder)).Release();
172 static void Java_org_chromium_TestJni_nativeGotOrientation(JNIEnv* env,
173     jobject jcaller,
174     jint nativeDataFetcherImplAndroid,
175     jdouble alpha,
176     jdouble beta,
177     jdouble gamma) {
178   DataFetcherImplAndroid* native =
179       reinterpret_cast<DataFetcherImplAndroid*>(nativeDataFetcherImplAndroid);
180   CHECK_NATIVE_PTR(env, jcaller, native, "GotOrientation");
181   return native->GotOrientation(env, JavaParamRef<jobject>(env, jcaller), alpha,
182       beta, gamma);
185 static ScopedJavaLocalRef<jthrowable> MessWithJavaException(JNIEnv* env, const
186     JavaParamRef<jclass>& jcaller,
187     const JavaParamRef<jthrowable>& e);
189 static jthrowable Java_org_chromium_TestJni_nativeMessWithJavaException(JNIEnv*
190     env, jclass jcaller,
191     jthrowable e) {
192   return MessWithJavaException(env, JavaParamRef<jclass>(env, jcaller),
193       JavaParamRef<jthrowable>(env, e)).Release();
196 // Step 3: RegisterNatives.
198 static const JNINativeMethod kMethodsTestJni[] = {
199     { "nativeInit",
202 "I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeInit) },
203     { "nativeDestroy",
207 "V", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeDestroy) },
208     { "nativeAddBookmark",
211 "Ljava/lang/String;"
212 "Ljava/lang/String;"
216 "J", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeAddBookmark) },
217     { "nativeGetDomainAndRegistry",
219 "Ljava/lang/String;"
221 "Ljava/lang/String;",
222     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetDomainAndRegistry)
223     },
224     { "nativeCreateHistoricalTabFromState",
226 "[B"
229 "V",
230     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeCreateHistoricalTabFromState)
231     },
232     { "nativeGetStateAsByteArray",
234 "Landroid/view/View;"
236 "[B",
237     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetStateAsByteArray)
238     },
239     { "nativeGetAutofillProfileGUIDs",
242 "[Ljava/lang/String;",
243     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetAutofillProfileGUIDs)
244     },
245     { "nativeSetRecognitionResults",
248 "[Ljava/lang/String;"
250 "V",
251     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeSetRecognitionResults)
252     },
253     { "nativeAddBookmarkFromAPI",
256 "Ljava/lang/String;"
257 "Ljava/lang/Long;"
258 "Ljava/lang/Boolean;"
259 "Ljava/lang/Long;"
260 "[B"
261 "Ljava/lang/String;"
262 "Ljava/lang/Integer;"
264 "J", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeAddBookmarkFromAPI)
265     },
266     { "nativeFindAll",
268 "Ljava/lang/String;"
270 "I", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeFindAll) },
271     { "nativeGetInnerClass",
274 "Lorg/chromium/example/jni_generator/SampleForTests$OnFrameAvailableListener;",
275     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGetInnerClass) },
276     { "nativeQueryBitmap",
279 "[Ljava/lang/String;"
280 "Ljava/lang/String;"
281 "[Ljava/lang/String;"
282 "Ljava/lang/String;"
284 "Landroid/graphics/Bitmap;",
285     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeQueryBitmap) },
286     { "nativeGotOrientation",
293 "V", reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeGotOrientation) },
294     { "nativeMessWithJavaException",
296 "Ljava/lang/Throwable;"
298 "Ljava/lang/Throwable;",
299     reinterpret_cast<void*>(Java_org_chromium_TestJni_nativeMessWithJavaException)
300     },
303 static bool RegisterNativesImpl(JNIEnv* env) {
305   g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
306       base::android::GetClass(env, kTestJniClassPath).obj()));
308   const int kMethodsTestJniSize = arraysize(kMethodsTestJni);
310   if (env->RegisterNatives(TestJni_clazz(env),
311                            kMethodsTestJni,
312                            kMethodsTestJniSize) < 0) {
313     jni_generator::HandleRegistrationError(
314         env, TestJni_clazz(env), __FILE__);
315     return false;
316   }
318   return true;
321 #endif  // org_chromium_TestJni_JNI