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

Side by Side Diff: webrtc/examples/android/media_demo/jni/jni_helpers.h

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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
« no previous file with comments | « webrtc/base/x11windowpicker.cc ('k') | webrtc/examples/peerconnection/client/defaults.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 CHECK(0, msg); \ 44 CHECK(0, msg); \
45 } \ 45 } \
46 } 46 }
47 47
48 // JNIEnv-helper methods that CHECK success: no Java exception thrown and found 48 // JNIEnv-helper methods that CHECK success: no Java exception thrown and found
49 // object/class/method/field is non-null. 49 // object/class/method/field is non-null.
50 jmethodID GetMethodID(JNIEnv* jni, jclass c, const std::string& name, 50 jmethodID GetMethodID(JNIEnv* jni, jclass c, const std::string& name,
51 const char* signature); 51 const char* signature);
52 52
53 // Return a |jlong| that will automatically convert back to |ptr| when assigned 53 // Return a |jlong| that will automatically convert back to |ptr| when assigned
54 // to a |uint64| 54 // to a |uint64_t|
55 jlong jlongFromPointer(void* ptr); 55 jlong jlongFromPointer(void* ptr);
56 56
57 // Given a (UTF-16) jstring return a new UTF-8 native string. 57 // Given a (UTF-16) jstring return a new UTF-8 native string.
58 std::string JavaToStdString(JNIEnv* jni, const jstring& j_string); 58 std::string JavaToStdString(JNIEnv* jni, const jstring& j_string);
59 59
60 // Android's FindClass() is trickier than usual because the app-specific 60 // Android's FindClass() is trickier than usual because the app-specific
61 // ClassLoader is not consulted when there is no app-specific frame on the 61 // ClassLoader is not consulted when there is no app-specific frame on the
62 // stack. Consequently, we only look up classes once in JNI_OnLoad. 62 // stack. Consequently, we only look up classes once in JNI_OnLoad.
63 // http://developer.android.com/training/articles/perf-jni.html#faq_FindClass 63 // http://developer.android.com/training/articles/perf-jni.html#faq_FindClass
64 class ClassReferenceHolder { 64 class ClassReferenceHolder {
65 public: 65 public:
66 ClassReferenceHolder(JNIEnv* jni, const char** classes, int size); 66 ClassReferenceHolder(JNIEnv* jni, const char** classes, int size);
67 ~ClassReferenceHolder(); 67 ~ClassReferenceHolder();
68 68
69 void FreeReferences(JNIEnv* jni); 69 void FreeReferences(JNIEnv* jni);
70 70
71 jclass GetClass(const std::string& name); 71 jclass GetClass(const std::string& name);
72 72
73 private: 73 private:
74 void LoadClass(JNIEnv* jni, const std::string& name); 74 void LoadClass(JNIEnv* jni, const std::string& name);
75 75
76 std::map<std::string, jclass> classes_; 76 std::map<std::string, jclass> classes_;
77 }; 77 };
78 78
79 #endif // WEBRTC_EXAMPLES_ANDROID_MEDIA_DEMO_JNI_JNI_HELPERS_H_ 79 #endif // WEBRTC_EXAMPLES_ANDROID_MEDIA_DEMO_JNI_JNI_HELPERS_H_
OLDNEW
« no previous file with comments | « webrtc/base/x11windowpicker.cc ('k') | webrtc/examples/peerconnection/client/defaults.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698