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

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

Issue 981803003: base: Add/Fix namespace closing comments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
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 #include "base/android/jni_string.h" 5 #include "base/android/jni_string.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 10
11 namespace { 11 namespace {
12 12
13 // Internal version that does not use a scoped local pointer. 13 // Internal version that does not use a scoped local pointer.
14 jstring ConvertUTF16ToJavaStringImpl(JNIEnv* env, 14 jstring ConvertUTF16ToJavaStringImpl(JNIEnv* env,
15 const base::StringPiece16& str) { 15 const base::StringPiece16& str) {
16 jstring result = env->NewString(str.data(), str.length()); 16 jstring result = env->NewString(str.data(), str.length());
17 base::android::CheckException(env); 17 base::android::CheckException(env);
18 return result; 18 return result;
19 } 19 }
20 20
21 } 21 } // namespace
22 22
23 namespace base { 23 namespace base {
24 namespace android { 24 namespace android {
25 25
26 void ConvertJavaStringToUTF8(JNIEnv* env, jstring str, std::string* result) { 26 void ConvertJavaStringToUTF8(JNIEnv* env, jstring str, std::string* result) {
27 if (!str) { 27 if (!str) {
28 LOG(WARNING) << "ConvertJavaStringToUTF8 called with null string."; 28 LOG(WARNING) << "ConvertJavaStringToUTF8 called with null string.";
29 result->clear(); 29 result->clear();
30 return; 30 return;
31 } 31 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 ScopedJavaLocalRef<jstring> ConvertUTF16ToJavaString( 91 ScopedJavaLocalRef<jstring> ConvertUTF16ToJavaString(
92 JNIEnv* env, 92 JNIEnv* env,
93 const base::StringPiece16& str) { 93 const base::StringPiece16& str) {
94 return ScopedJavaLocalRef<jstring>(env, 94 return ScopedJavaLocalRef<jstring>(env,
95 ConvertUTF16ToJavaStringImpl(env, str)); 95 ConvertUTF16ToJavaStringImpl(env, str));
96 } 96 }
97 97
98 } // namespace android 98 } // namespace android
99 } // namespace base 99 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/atomicops_internals_arm64_gcc.h » ('j') | base/atomicops_internals_portable.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698