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

Side by Side Diff: webrtc/sdk/android/src/jni/jni_helpers.h

Issue 3009613002: Android: Replace webrtc_jni namespace with nested jni namespace (Closed)
Patch Set: Rebase Created 3 years, 3 months 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 21 matching lines...) Expand all
32 // Helper that calls ptr->Release() and aborts the process with a useful 32 // Helper that calls ptr->Release() and aborts the process with a useful
33 // message if that didn't actually delete *ptr because of extra refcounts. 33 // message if that didn't actually delete *ptr because of extra refcounts.
34 #define CHECK_RELEASE(ptr) \ 34 #define CHECK_RELEASE(ptr) \
35 RTC_CHECK_EQ(0, (ptr)->Release()) << "Unexpected refcount." 35 RTC_CHECK_EQ(0, (ptr)->Release()) << "Unexpected refcount."
36 36
37 // Convenience macro defining JNI-accessible methods in the org.webrtc package. 37 // Convenience macro defining JNI-accessible methods in the org.webrtc package.
38 // Eliminates unnecessary boilerplate and line-wraps, reducing visual clutter. 38 // Eliminates unnecessary boilerplate and line-wraps, reducing visual clutter.
39 #define JNI_FUNCTION_DECLARATION(rettype, name, ...) \ 39 #define JNI_FUNCTION_DECLARATION(rettype, name, ...) \
40 extern "C" JNIEXPORT rettype JNICALL Java_org_webrtc_##name(__VA_ARGS__) 40 extern "C" JNIEXPORT rettype JNICALL Java_org_webrtc_##name(__VA_ARGS__)
41 41
42 namespace webrtc_jni { 42 namespace webrtc {
43 namespace jni {
43 44
44 jint InitGlobalJniVariables(JavaVM *jvm); 45 jint InitGlobalJniVariables(JavaVM *jvm);
45 46
46 // Return a |JNIEnv*| usable on this thread or NULL if this thread is detached. 47 // Return a |JNIEnv*| usable on this thread or NULL if this thread is detached.
47 JNIEnv* GetEnv(); 48 JNIEnv* GetEnv();
48 49
49 JavaVM *GetJVM(); 50 JavaVM *GetJVM();
50 51
51 // Return a |JNIEnv*| usable on this thread. Attaches to |g_jvm| if necessary. 52 // Return a |JNIEnv*| usable on this thread. Attaches to |g_jvm| if necessary.
52 JNIEnv* AttachCurrentThreadIfNeeded(); 53 JNIEnv* AttachCurrentThreadIfNeeded();
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 Iterable::Iterator begin() { return Iterable::Iterator(jni_, iterable_); } 198 Iterable::Iterator begin() { return Iterable::Iterator(jni_, iterable_); }
198 Iterable::Iterator end() { return Iterable::Iterator(); } 199 Iterable::Iterator end() { return Iterable::Iterator(); }
199 200
200 private: 201 private:
201 JNIEnv* jni_; 202 JNIEnv* jni_;
202 jobject iterable_; 203 jobject iterable_;
203 204
204 RTC_DISALLOW_COPY_AND_ASSIGN(Iterable); 205 RTC_DISALLOW_COPY_AND_ASSIGN(Iterable);
205 }; 206 };
206 207
208 } // namespace jni
209 } // namespace webrtc
210
211 // TODO(magjed): Remove once external clients are updated.
212 namespace webrtc_jni {
213
214 using webrtc::jni::AttachCurrentThreadIfNeeded;
215 using webrtc::jni::InitGlobalJniVariables;
216
207 } // namespace webrtc_jni 217 } // namespace webrtc_jni
208 218
209 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_JNI_HELPERS_H_ 219 #endif // WEBRTC_SDK_ANDROID_SRC_JNI_JNI_HELPERS_H_
OLDNEW
« no previous file with comments | « webrtc/sdk/android/src/jni/filevideocapturer_jni.cc ('k') | webrtc/sdk/android/src/jni/jni_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698