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

Side by Side Diff: base/android/jni_string.h

Issue 10532081: replace string16 with StringPiece16 in ConvertUTF16ToJavaString() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove redundant header files" Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/android/jni_string.cc » ('j') | base/android/jni_string.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_ANDROID_JNI_STRING_H_ 5 #ifndef BASE_ANDROID_JNI_STRING_H_
6 #define BASE_ANDROID_JNI_STRING_H_ 6 #define BASE_ANDROID_JNI_STRING_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/android/scoped_java_ref.h" 11 #include "base/android/scoped_java_ref.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
joth 2012/06/11 23:39:38 I think this can be removed now?
Wei James(wistoch) 2012/06/12 01:25:29 fixed. thanks
13 #include "base/string_piece.h" 13 #include "base/string_piece.h"
14 14
15 namespace base { 15 namespace base {
16 namespace android { 16 namespace android {
17 17
18 // Convert a Java string to UTF8. Returns a std string. 18 // Convert a Java string to UTF8. Returns a std string.
19 std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str); 19 std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str);
20 std::string ConvertJavaStringToUTF8(const JavaRef<jstring>& str); 20 std::string ConvertJavaStringToUTF8(const JavaRef<jstring>& str);
21 21
22 // Convert a std string to Java string. 22 // Convert a std string to Java string.
23 ScopedJavaLocalRef<jstring> ConvertUTF8ToJavaString( 23 ScopedJavaLocalRef<jstring> ConvertUTF8ToJavaString(
24 JNIEnv* env, const base::StringPiece& str); 24 JNIEnv* env, const base::StringPiece& str);
25 25
26 // Convert a Java string to UTF16. Returns a string16. 26 // Convert a Java string to UTF16. Returns a string16.
27 string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str); 27 string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str);
28 string16 ConvertJavaStringToUTF16(const JavaRef<jstring>& str); 28 string16 ConvertJavaStringToUTF16(const JavaRef<jstring>& str);
29 29
30 // Convert a string16 to a Java string. 30 // Convert a string16 to a Java string.
31 ScopedJavaLocalRef<jstring> ConvertUTF16ToJavaString( 31 ScopedJavaLocalRef<jstring> ConvertUTF16ToJavaString(
32 JNIEnv* env, const string16& str); 32 JNIEnv* env, const base::StringPiece16& str);
joth 2012/06/11 23:39:38 nit: one param per line (see "OK3" in http://www.c
Wei James(wistoch) 2012/06/12 01:25:29 fixed. thanks
33 33
34 } // namespace android 34 } // namespace android
35 } // namespace base 35 } // namespace base
36 36
37 #endif // BASE_ANDROID_JNI_STRING_H_ 37 #endif // BASE_ANDROID_JNI_STRING_H_
OLDNEW
« no previous file with comments | « no previous file | base/android/jni_string.cc » ('j') | base/android/jni_string.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698