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_array.cc

Issue 8368009: Replace most LOG statements with DLOG statements in base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « base/allocator/allocator_unittests.cc ('k') | base/base_paths_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_array.h" 5 #include "base/android/jni_array.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 11
12 namespace base { 12 namespace base {
13 namespace android { 13 namespace android {
14 14
15 jbyteArray ToJavaByteArray(JNIEnv* env, 15 jbyteArray ToJavaByteArray(JNIEnv* env,
16 const unsigned char* bytes, 16 const unsigned char* bytes,
17 size_t len) { 17 size_t len) {
18 jbyteArray byte_array = env->NewByteArray(len); 18 jbyteArray byte_array = env->NewByteArray(len);
19 CheckException(env); 19 CheckException(env);
20 CHECK(byte_array); 20 DCHECK(byte_array);
21 21
22 jbyte* elements = env->GetByteArrayElements(byte_array, NULL); 22 jbyte* elements = env->GetByteArrayElements(byte_array, NULL);
23 memcpy(elements, bytes, len); 23 memcpy(elements, bytes, len);
24 env->ReleaseByteArrayElements(byte_array, elements, 0); 24 env->ReleaseByteArrayElements(byte_array, elements, 0);
25 CheckException(env); 25 CheckException(env);
26 26
27 return byte_array; 27 return byte_array;
28 } 28 }
29 29
30 jobjectArray ToJavaArrayOfByteArray(JNIEnv* env, 30 jobjectArray ToJavaArrayOfByteArray(JNIEnv* env,
(...skipping 21 matching lines...) Expand all
52 for (size_t i = 0; i < v.size(); ++i) { 52 for (size_t i = 0; i < v.size(); ++i) {
53 ScopedJavaLocalRef<jstring> item(env, 53 ScopedJavaLocalRef<jstring> item(env,
54 ConvertUTF8ToJavaString(env, v[i])); 54 ConvertUTF8ToJavaString(env, v[i]));
55 env->SetObjectArrayElement(joa, i, item.obj()); 55 env->SetObjectArrayElement(joa, i, item.obj());
56 } 56 }
57 return joa; 57 return joa;
58 } 58 }
59 59
60 } // namespace android 60 } // namespace android
61 } // namespace base 61 } // namespace base
OLDNEW
« no previous file with comments | « base/allocator/allocator_unittests.cc ('k') | base/base_paths_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698