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

Unified Diff: base/android/jni_string.cc

Issue 9584014: Remove env() getter from JavaRef<> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-applied downstream patch after it was re-worked Created 8 years, 9 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 | « no previous file | base/android/scoped_java_ref.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_string.cc
diff --git a/base/android/jni_string.cc b/base/android/jni_string.cc
index 94ec0df4323d7b078bc761302962fdc81551bab9..d0ffeecc418fa410095a56a6dbc879a5ba06da20 100644
--- a/base/android/jni_string.cc
+++ b/base/android/jni_string.cc
@@ -29,7 +29,7 @@ std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str) {
}
std::string ConvertJavaStringToUTF8(const JavaRef<jstring>& str) {
- return ConvertJavaStringToUTF8(str.env(), str.obj());
+ return ConvertJavaStringToUTF8(AttachCurrentThread(), str.obj());
}
ScopedJavaLocalRef<jstring> ConvertUTF8ToJavaString(
@@ -57,7 +57,7 @@ string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str) {
}
string16 ConvertJavaStringToUTF16(const JavaRef<jstring>& str) {
- return ConvertJavaStringToUTF16(str.env(), str.obj());
+ return ConvertJavaStringToUTF16(AttachCurrentThread(), str.obj());
}
// TODO(joth): change this to accept const StringPiece16&.
« no previous file with comments | « no previous file | base/android/scoped_java_ref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698