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

Unified Diff: base/android/jni_string.cc

Issue 109863003: Use StringPiece for UTF string conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/i18n/icu_string_conversions.cc » ('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 d25fed822bc3dbea5d3abd294763335e88acf966..105a902ccc4e0b3972cc85dd24aa0374a3f7fee7 100644
--- a/base/android/jni_string.cc
+++ b/base/android/jni_string.cc
@@ -34,7 +34,7 @@ void ConvertJavaStringToUTF8(JNIEnv* env, jstring str, std::string* result) {
// function that yields plain (non Java-modified) UTF8.
const jchar* chars = env->GetStringChars(str, NULL);
DCHECK(chars);
- UTF16ToUTF8(chars, env->GetStringLength(str), result);
+ UTF16ToUTF8(base::StringPiece(chars, env->GetStringLength(str)), result);
env->ReleaseStringChars(str, chars);
CheckException(env);
}
« no previous file with comments | « no previous file | base/i18n/icu_string_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698