Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: base/android/jni_generator/sample_for_tests.h

Issue 1476403003: jni: Pass method parameters as JavaParamRef in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary namespace qualifiers Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/android/java_handler_thread.cc ('k') | base/android/jni_generator/sample_for_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ 5 #ifndef BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_
6 #define BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ 6 #define BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ~CPPClass(); 141 ~CPPClass();
142 142
143 // Register C++ methods exposed to Java using JNI. 143 // Register C++ methods exposed to Java using JNI.
144 static bool RegisterJNI(JNIEnv* env); 144 static bool RegisterJNI(JNIEnv* env);
145 145
146 // Java @CalledByNative methods implicitly available to C++ via the _jni.h 146 // Java @CalledByNative methods implicitly available to C++ via the _jni.h
147 // file included in the .cc file. 147 // file included in the .cc file.
148 148
149 class InnerClass { 149 class InnerClass {
150 public: 150 public:
151 jdouble MethodOtherP0(JNIEnv* env, jobject caller); 151 jdouble MethodOtherP0(JNIEnv* env,
152 const base::android::JavaParamRef<jobject>& caller);
152 }; 153 };
153 154
154 void Destroy(JNIEnv* env, jobject caller); 155 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& caller);
155 156
156 jint Method(JNIEnv* env, jobject caller); 157 jint Method(JNIEnv* env, const base::android::JavaParamRef<jobject>& caller);
157 158
158 void AddStructB(JNIEnv* env, jobject caller, jobject structb); 159 void AddStructB(JNIEnv* env,
160 const base::android::JavaParamRef<jobject>& caller,
161 const base::android::JavaParamRef<jobject>& structb);
159 162
160 void IterateAndDoSomethingWithStructB(JNIEnv* env, jobject caller); 163 void IterateAndDoSomethingWithStructB(
164 JNIEnv* env,
165 const base::android::JavaParamRef<jobject>& caller);
161 166
162 base::android::ScopedJavaLocalRef<jstring> ReturnAString( 167 base::android::ScopedJavaLocalRef<jstring> ReturnAString(
163 JNIEnv* env, jobject caller); 168 JNIEnv* env,
169 const base::android::JavaParamRef<jobject>& caller);
164 170
165 private: 171 private:
166 std::map<long, std::string> map_; 172 std::map<long, std::string> map_;
167 173
168 DISALLOW_COPY_AND_ASSIGN(CPPClass); 174 DISALLOW_COPY_AND_ASSIGN(CPPClass);
169 }; 175 };
170 176
171 } // namespace android 177 } // namespace android
172 } // namespace base 178 } // namespace base
173 179
174 #endif // BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_ 180 #endif // BASE_ANDROID_JNI_GENERATOR_SAMPLE_FOR_TESTS_H_
OLDNEW
« no previous file with comments | « base/android/java_handler_thread.cc ('k') | base/android/jni_generator/sample_for_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698