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

Side by Side Diff: net/android/keystore.cc

Issue 2237943002: Remove now-unnecessary .obj() in Java method calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@switch-context
Patch Set: Rebase *again* :( Created 4 years, 4 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
« no previous file with comments | « net/android/http_auth_negotiate_android.cc ('k') | net/android/keystore_unittest.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/android/keystore.h" 5 #include "net/android/keystore.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 JNIEnv* env = AttachCurrentThread(); 52 JNIEnv* env = AttachCurrentThread();
53 53
54 // Convert message to byte[] array. 54 // Convert message to byte[] array.
55 ScopedJavaLocalRef<jbyteArray> digest_ref = ToJavaByteArray( 55 ScopedJavaLocalRef<jbyteArray> digest_ref = ToJavaByteArray(
56 env, reinterpret_cast<const uint8_t*>(digest.data()), digest.length()); 56 env, reinterpret_cast<const uint8_t*>(digest.data()), digest.length());
57 DCHECK(!digest_ref.is_null()); 57 DCHECK(!digest_ref.is_null());
58 58
59 // Invoke platform API 59 // Invoke platform API
60 ScopedJavaLocalRef<jbyteArray> signature_ref = 60 ScopedJavaLocalRef<jbyteArray> signature_ref =
61 Java_AndroidKeyStore_rawSignDigestWithPrivateKey(env, private_key_ref, 61 Java_AndroidKeyStore_rawSignDigestWithPrivateKey(env, private_key_ref,
62 digest_ref.obj()); 62 digest_ref);
63 if (HasException(env) || signature_ref.is_null()) 63 if (HasException(env) || signature_ref.is_null())
64 return false; 64 return false;
65 65
66 // Write signature to string. 66 // Write signature to string.
67 JavaByteArrayToByteVector(env, signature_ref.obj(), signature); 67 JavaByteArrayToByteVector(env, signature_ref.obj(), signature);
68 return true; 68 return true;
69 } 69 }
70 70
71 PrivateKeyType GetPrivateKeyType(jobject private_key_ref) { 71 PrivateKeyType GetPrivateKeyType(jobject private_key_ref) {
72 JNIEnv* env = AttachCurrentThread(); 72 JNIEnv* env = AttachCurrentThread();
(...skipping 19 matching lines...) Expand all
92 ScopedJavaLocalRef<jobject> GetOpenSSLEngineForPrivateKey( 92 ScopedJavaLocalRef<jobject> GetOpenSSLEngineForPrivateKey(
93 jobject private_key_ref) { 93 jobject private_key_ref) {
94 JNIEnv* env = AttachCurrentThread(); 94 JNIEnv* env = AttachCurrentThread();
95 ScopedJavaLocalRef<jobject> engine = 95 ScopedJavaLocalRef<jobject> engine =
96 Java_AndroidKeyStore_getOpenSSLEngineForPrivateKey(env, private_key_ref); 96 Java_AndroidKeyStore_getOpenSSLEngineForPrivateKey(env, private_key_ref);
97 return engine; 97 return engine;
98 } 98 }
99 99
100 } // namespace android 100 } // namespace android
101 } // namespace net 101 } // namespace net
OLDNEW
« no previous file with comments | « net/android/http_auth_negotiate_android.cc ('k') | net/android/keystore_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698