Chromium Code Reviews| Index: base/android/jni_local_ref_extensions.h |
| diff --git a/base/android/jni_local_ref_extensions.h b/base/android/jni_local_ref_extensions.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1e95e19d20f70b5987f5bdfbd95910ea3db5961e |
| --- /dev/null |
| +++ b/base/android/jni_local_ref_extensions.h |
| @@ -0,0 +1,28 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_ANDROID_JNI_LOCAL_REF_EXTENSIONS_H_ |
| +#define BASE_ANDROID_JNI_LOCAL_REF_EXTENSIONS_H_ |
| + |
| +#include "base/android/jni_android.h" |
| +#include "base/android/jni_array.h" |
| +#include "base/android/jni_string.h" |
| + |
| +namespace base { |
| +namespace android { |
| + |
| +// Returns empty string if java string is null, |
|
Ilya Sherman
2013/03/05 00:42:38
nit: "Returns and empty string if the Java string
apiccion
2013/03/09 00:53:41
Done.
|
| +// otherwise converts and returns the string. |
| +string16 SafeJavaStringToUTF16(ScopedJavaLocalRef<jstring> jstring); |
| + |
| +// Checks if java array is null and copies contents into stringVector |
|
Ilya Sherman
2013/03/05 00:42:38
nit: Perhaps something like "Fills |string_vector|
apiccion
2013/03/09 00:53:41
Done.
|
| +void SafeJavaStringArrayToStringVector( |
| + ScopedJavaLocalRef<jobjectArray> jarray, |
| + JNIEnv* env, |
| + std::vector<string16>* stringVector); |
|
Ilya Sherman
2013/03/05 00:42:38
nit: Use hacker_case, not camelCase.
apiccion
2013/03/09 00:53:41
Done.
|
| + |
| +} // namespace android |
| +} // namespace base |
| + |
| +#endif // BASE_ANDROID_JNI_LOCAL_REF_EXTENSIONS_H_ |