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

Unified Diff: chrome/browser/android/profiles/profile_downloader_android.cc

Issue 1308363003: Revert of jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/browser/android/preferences/pref_service_bridge.cc ('k') | chrome/browser/android/tab_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/profiles/profile_downloader_android.cc
diff --git a/chrome/browser/android/profiles/profile_downloader_android.cc b/chrome/browser/android/profiles/profile_downloader_android.cc
index c0914d59454adce3d81dfda3b911b811438cca07..9560c8688455da5656f959884ac730a084c5de74 100644
--- a/chrome/browser/android/profiles/profile_downloader_android.cc
+++ b/chrome/browser/android/profiles/profile_downloader_android.cc
@@ -120,10 +120,9 @@
} // namespace
// static
-ScopedJavaLocalRef<jstring> GetCachedFullNameForPrimaryAccount(
- JNIEnv* env,
- jclass clazz,
- jobject jprofile) {
+jstring GetCachedFullNameForPrimaryAccount(JNIEnv* env,
+ jclass clazz,
+ jobject jprofile) {
Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile);
ProfileInfoInterface& info =
g_browser_process->profile_manager()->GetProfileInfoCache();
@@ -133,14 +132,13 @@
if (index != std::string::npos)
name = info.GetGAIANameOfProfileAtIndex(index);
- return base::android::ConvertUTF16ToJavaString(env, name);
-}
-
-// static
-ScopedJavaLocalRef<jstring> GetCachedGivenNameForPrimaryAccount(
- JNIEnv* env,
- jclass clazz,
- jobject jprofile) {
+ return base::android::ConvertUTF16ToJavaString(env, name).Release();
+}
+
+// static
+jstring GetCachedGivenNameForPrimaryAccount(JNIEnv* env,
+ jclass clazz,
+ jobject jprofile) {
Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile);
ProfileInfoInterface& info =
g_browser_process->profile_manager()->GetProfileInfoCache();
@@ -150,13 +148,13 @@
if (index != std::string::npos)
name = info.GetGAIAGivenNameOfProfileAtIndex(index);
- return base::android::ConvertUTF16ToJavaString(env, name);
-}
-
-// static
-ScopedJavaLocalRef<jobject> GetCachedAvatarForPrimaryAccount(JNIEnv* env,
- jclass clazz,
- jobject jprofile) {
+ return base::android::ConvertUTF16ToJavaString(env, name).Release();
+}
+
+// static
+jobject GetCachedAvatarForPrimaryAccount(JNIEnv* env,
+ jclass clazz,
+ jobject jprofile) {
Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile);
ProfileInfoInterface& info =
g_browser_process->profile_manager()->GetProfileInfoCache();
@@ -173,7 +171,7 @@
}
}
- return jbitmap;
+ return jbitmap.Release();
}
// static
« no previous file with comments | « chrome/browser/android/preferences/pref_service_bridge.cc ('k') | chrome/browser/android/tab_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698