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

Unified Diff: webrtc/sdk/android/src/jni/jni_helpers.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/android/src/jni/jni_helpers.cc
diff --git a/webrtc/sdk/android/src/jni/jni_helpers.cc b/webrtc/sdk/android/src/jni/jni_helpers.cc
index 8860f06d5aeab6ee0fbd405db7df263ee8634ecc..405668f68d2600f79eae9b03d859f752af86922d 100644
--- a/webrtc/sdk/android/src/jni/jni_helpers.cc
+++ b/webrtc/sdk/android/src/jni/jni_helpers.cc
@@ -23,8 +23,8 @@ static JavaVM* g_jvm = nullptr;
static pthread_once_t g_jni_ptr_once = PTHREAD_ONCE_INIT;
-// Key for per-thread JNIEnv* data. Non-NULL in threads attached to |g_jvm| by
-// AttachCurrentThreadIfNeeded(), NULL in unattached threads and threads that
+// Key for per-thread JNIEnv* data. Non-null in threads attached to |g_jvm| by
+// AttachCurrentThreadIfNeeded(), null in unattached threads and threads that
// were attached by the JVM because of a Java->native call.
static pthread_key_t g_jni_ptr;
@@ -33,7 +33,7 @@ JavaVM *GetJVM() {
return g_jvm;
}
-// Return a |JNIEnv*| usable on this thread or NULL if this thread is detached.
+// Return a |JNIEnv*| usable on this thread or null if this thread is detached.
JNIEnv* GetEnv() {
void* env = nullptr;
jint status = g_jvm->GetEnv(&env, JNI_VERSION_1_6);
@@ -44,7 +44,7 @@ JNIEnv* GetEnv() {
}
static void ThreadDestructor(void* prev_jni_ptr) {
- // This function only runs on threads where |g_jni_ptr| is non-NULL, meaning
+ // This function only runs on threads where |g_jni_ptr| is non-null, meaning
// we were responsible for originally attaching the thread, so are responsible
// for detaching it now. However, because some JVM implementations (notably
// Oracle's http://goo.gl/eHApYT) also use the pthread_key_create mechanism,
@@ -69,7 +69,7 @@ static void CreateJNIPtrKey() {
jint InitGlobalJniVariables(JavaVM *jvm) {
RTC_CHECK(!g_jvm) << "InitGlobalJniVariables!";
g_jvm = jvm;
- RTC_CHECK(g_jvm) << "InitGlobalJniVariables handed NULL?";
+ RTC_CHECK(g_jvm) << "InitGlobalJniVariables handed null?";
RTC_CHECK(!pthread_once(&g_jni_ptr_once, &CreateJNIPtrKey)) << "pthread_once";
@@ -82,7 +82,7 @@ jint InitGlobalJniVariables(JavaVM *jvm) {
// Return thread ID as a string.
static std::string GetThreadId() {
- char buf[21]; // Big enough to hold a kuint64max plus terminating NULL.
+ char buf[21]; // Big enough to hold a kuint64max plus terminating nullptr.
RTC_CHECK_LT(snprintf(buf, sizeof(buf), "%ld",
static_cast<long>(syscall(__NR_gettid))),
sizeof(buf))
@@ -119,7 +119,7 @@ JNIEnv* AttachCurrentThreadIfNeeded() {
#endif
RTC_CHECK(!g_jvm->AttachCurrentThread(&env, &args))
<< "Failed to attach thread";
- RTC_CHECK(env) << "AttachCurrentThread handed back NULL!";
+ RTC_CHECK(env) << "AttachCurrentThread handed back null!";
jni = reinterpret_cast<JNIEnv*>(env);
RTC_CHECK(!pthread_setspecific(g_jni_ptr, jni)) << "pthread_setspecific";
return jni;
@@ -180,21 +180,21 @@ jfieldID GetStaticFieldID(JNIEnv* jni,
jclass GetObjectClass(JNIEnv* jni, jobject object) {
jclass c = jni->GetObjectClass(object);
CHECK_EXCEPTION(jni) << "error during GetObjectClass";
- RTC_CHECK(c) << "GetObjectClass returned NULL";
+ RTC_CHECK(c) << "GetObjectClass returned null";
return c;
}
jobject GetObjectField(JNIEnv* jni, jobject object, jfieldID id) {
jobject o = jni->GetObjectField(object, id);
CHECK_EXCEPTION(jni) << "error during GetObjectField";
- RTC_CHECK(!IsNull(jni, o)) << "GetObjectField returned NULL";
+ RTC_CHECK(!IsNull(jni, o)) << "GetObjectField returned null";
return o;
}
jobject GetStaticObjectField(JNIEnv* jni, jclass c, jfieldID id) {
jobject o = jni->GetStaticObjectField(c, id);
CHECK_EXCEPTION(jni) << "error during GetStaticObjectField";
- RTC_CHECK(!IsNull(jni, o)) << "GetStaticObjectField returned NULL";
+ RTC_CHECK(!IsNull(jni, o)) << "GetStaticObjectField returned null";
return o;
}

Powered by Google App Engine
This is Rietveld 408576698