naiveproxy/net/cert/x509_util_android.cc
2018-01-28 13:32:06 -05:00

32 lines
1.0 KiB
C++

// Copyright 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.
#include "base/android/build_info.h"
#include "base/metrics/histogram_macros.h"
#include "jni/X509Util_jni.h"
#include "net/cert/cert_database.h"
using base::android::JavaParamRef;
namespace net {
void JNI_X509Util_NotifyKeyChainChanged(JNIEnv* env,
const JavaParamRef<jclass>& clazz) {
CertDatabase::GetInstance()->OnAndroidKeyChainChanged();
}
void JNI_X509Util_RecordCertVerifyCapabilitiesHistogram(
JNIEnv* env,
const JavaParamRef<jclass>& clazz,
jboolean found_system_trust_roots) {
// Only record the histogram for 4.2 and up. Before 4.2, the platform doesn't
// return the certificate chain anyway.
if (base::android::BuildInfo::GetInstance()->sdk_int() >= 17) {
UMA_HISTOGRAM_BOOLEAN("Net.FoundSystemTrustRootsAndroid",
found_system_trust_roots);
}
}
} // namespace net