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

Unified Diff: chrome/browser/ui/android/ssl_client_certificate_request.cc

Issue 168313002: Fix threading of certificate cache clearing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/SSLClientCertificateRequest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/ssl_client_certificate_request.cc
diff --git a/chrome/browser/ui/android/ssl_client_certificate_request.cc b/chrome/browser/ui/android/ssl_client_certificate_request.cc
index 468b53b21b3661e4ce8b0083ef20307604b4773d..f752dbb922fa01c54e20a0daee67aac2de04e48d 100644
--- a/chrome/browser/ui/android/ssl_client_certificate_request.cc
+++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc
@@ -17,11 +17,13 @@
#include "jni/SSLClientCertificateRequest_jni.h"
#include "net/android/keystore_openssl.h"
#include "net/base/host_port_pair.h"
+#include "net/cert/cert_database.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/openssl_client_key_store.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_client_cert_type.h"
+
namespace chrome {
namespace {
@@ -195,6 +197,21 @@ static void OnSystemRequestCompletion(
base::Bind(*callback, client_cert));
}
+static void NotifyClientCertificatesChanged() {
+ net::CertDatabase::GetInstance()->OnAndroidKeyStoreChanged();
+}
+
+static void NotifyClientCertificatesChangedOnIOThread(JNIEnv* env, jclass) {
+ if (content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
+ NotifyClientCertificatesChanged();
+ } else {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&NotifyClientCertificatesChanged));
+ }
+}
+
bool RegisterSSLClientCertificateRequestAndroid(JNIEnv* env) {
return RegisterNativesImpl(env);
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/SSLClientCertificateRequest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698