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

Unified Diff: base/android/path_utils.cc

Issue 7491099: Update base/android to use new ScopedJava(Global)Reference (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Also fix license headers Created 9 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 | « base/android/jni_array.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/path_utils.cc
diff --git a/base/android/path_utils.cc b/base/android/path_utils.cc
index b3065d57bf981294fc45ea1b5c6900681d58b639..623e030cb10dc3361df02fab1027f72f87bf4926 100644
--- a/base/android/path_utils.cc
+++ b/base/android/path_utils.cc
@@ -4,9 +4,9 @@
#include "base/android/path_utils.h"
-#include "base/android/auto_jobject.h"
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
+#include "base/android/scoped_java_reference.h"
#include "jni/path_utils_jni.h"
@@ -15,20 +15,16 @@ namespace android {
std::string GetDataDirectory() {
JNIEnv* env = AttachCurrentThread();
- AutoJObject path = AutoJObject::FromLocalRef(
- env, Java_PathUtils_getDataDirectory(
- env, base::android::GetApplicationContext()));
- return base::android::ConvertJavaStringToUTF8(
- env, static_cast<jstring>(path.obj()));
+ ScopedJavaReference<jstring> path(env, Java_PathUtils_getDataDirectory(
+ env, base::android::GetApplicationContext()));
+ return base::android::ConvertJavaStringToUTF8(env, path.obj());
}
std::string GetCacheDirectory() {
JNIEnv* env = AttachCurrentThread();
- AutoJObject path = AutoJObject::FromLocalRef(
- env, Java_PathUtils_getCacheDirectory(
- env, base::android::GetApplicationContext()));
- return base::android::ConvertJavaStringToUTF8(
- env, static_cast<jstring>(path.obj()));
+ ScopedJavaReference<jstring> path(env, Java_PathUtils_getCacheDirectory(
+ env, base::android::GetApplicationContext()));
+ return base::android::ConvertJavaStringToUTF8(env, path.obj());
}
bool RegisterPathUtils(JNIEnv* env) {
« no previous file with comments | « base/android/jni_array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698