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

Unified Diff: remoting/client/jni/chromoting_jni_runtime.cc

Issue 1288183004: jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some newlines for readability Created 5 years, 4 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: remoting/client/jni/chromoting_jni_runtime.cc
diff --git a/remoting/client/jni/chromoting_jni_runtime.cc b/remoting/client/jni/chromoting_jni_runtime.cc
index cb7dbb0e9865cb0fc78b5aa885c39e19bfcecdaa..88572e801b93e361c3647fb57ecf1ba3156ff202 100644
--- a/remoting/client/jni/chromoting_jni_runtime.cc
+++ b/remoting/client/jni/chromoting_jni_runtime.cc
@@ -53,21 +53,20 @@ static void LoadNative(JNIEnv* env, jclass clazz, jobject context) {
remoting::ChromotingJniRuntime::GetInstance();
}
-static jstring GetApiKey(JNIEnv* env, jclass clazz) {
- return ConvertUTF8ToJavaString(
- env, google_apis::GetAPIKey().c_str()).Release();
+static ScopedJavaLocalRef<jstring> GetApiKey(JNIEnv* env, jclass clazz) {
+ return ConvertUTF8ToJavaString(env, google_apis::GetAPIKey().c_str());
}
-static jstring GetClientId(JNIEnv* env, jclass clazz) {
+static ScopedJavaLocalRef<jstring> GetClientId(JNIEnv* env, jclass clazz) {
return ConvertUTF8ToJavaString(
- env, google_apis::GetOAuth2ClientID(
- google_apis::CLIENT_REMOTING).c_str()).Release();
+ env,
+ google_apis::GetOAuth2ClientID(google_apis::CLIENT_REMOTING).c_str());
}
-static jstring GetClientSecret(JNIEnv* env, jclass clazz) {
+static ScopedJavaLocalRef<jstring> GetClientSecret(JNIEnv* env, jclass clazz) {
return ConvertUTF8ToJavaString(
- env, google_apis::GetOAuth2ClientSecret(
- google_apis::CLIENT_REMOTING).c_str()).Release();
+ env,
+ google_apis::GetOAuth2ClientSecret(google_apis::CLIENT_REMOTING).c_str());
}
static void Connect(JNIEnv* env,

Powered by Google App Engine
This is Rietveld 408576698