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

Side by Side Diff: android_webview/browser/token_binding_manager_bridge.cc

Issue 2863233002: [WebView] Move files from native to browser (Closed)
Patch Set: Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "android_webview/native/token_binding_manager_bridge.h" 5 #include "android_webview/browser/token_binding_manager_bridge.h"
6 6
7 #include "android_webview/browser/net/token_binding_manager.h" 7 #include "android_webview/browser/net/token_binding_manager.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/android/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "crypto/ec_private_key.h" 13 #include "crypto/ec_private_key.h"
14 #include "jni/AwTokenBindingManager_jni.h" 14 #include "jni/AwTokenBindingManager_jni.h"
15 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
(...skipping 21 matching lines...) Expand all
37 return; 37 return;
38 } 38 }
39 39
40 std::vector<uint8_t> private_key; 40 std::vector<uint8_t> private_key;
41 key->ExportPrivateKey(&private_key); 41 key->ExportPrivateKey(&private_key);
42 ScopedJavaLocalRef<jbyteArray> jprivate_key = base::android::ToJavaByteArray( 42 ScopedJavaLocalRef<jbyteArray> jprivate_key = base::android::ToJavaByteArray(
43 env, private_key.data(), private_key.size()); 43 env, private_key.data(), private_key.size());
44 44
45 std::vector<uint8_t> public_key; 45 std::vector<uint8_t> public_key;
46 key->ExportPublicKey(&public_key); 46 key->ExportPublicKey(&public_key);
47 ScopedJavaLocalRef<jbyteArray> jpublic_key = base::android::ToJavaByteArray( 47 ScopedJavaLocalRef<jbyteArray> jpublic_key =
48 env, public_key.data(), public_key.size()); 48 base::android::ToJavaByteArray(env, public_key.data(), public_key.size());
49 49
50 Java_AwTokenBindingManager_onKeyReady(env, callback, jprivate_key, 50 Java_AwTokenBindingManager_onKeyReady(env, callback, jprivate_key,
51 jpublic_key); 51 jpublic_key);
52 } 52 }
53 53
54 // Indicates webview client that key deletion is complete. 54 // Indicates webview client that key deletion is complete.
55 void OnDeletionComplete(const ScopedJavaGlobalRef<jobject>& callback) { 55 void OnDeletionComplete(const ScopedJavaGlobalRef<jobject>& callback) {
56 DCHECK_CURRENTLY_ON(BrowserThread::UI); 56 DCHECK_CURRENTLY_ON(BrowserThread::UI);
57 if (callback.is_null()) 57 if (callback.is_null())
58 return; 58 return;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 TokenBindingManager::DeletionCompleteCallback complete_callback = 110 TokenBindingManager::DeletionCompleteCallback complete_callback =
111 base::Bind(&OnDeletionComplete, j_callback); 111 base::Bind(&OnDeletionComplete, j_callback);
112 TokenBindingManager::GetInstance()->DeleteAllKeys(complete_callback); 112 TokenBindingManager::GetInstance()->DeleteAllKeys(complete_callback);
113 } 113 }
114 114
115 bool RegisterTokenBindingManager(JNIEnv* env) { 115 bool RegisterTokenBindingManager(JNIEnv* env) {
116 return RegisterNativesImpl(env); 116 return RegisterNativesImpl(env);
117 } 117 }
118 118
119 } // android_webview namespace 119 } // android_webview namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698