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

Unified Diff: net/ssl/client_key_store.cc

Issue 2937553003: Make CertificateProviderService vend ClientCertIdentities directly. (Closed)
Patch Set: review changes for comments 11 & 12 Created 3 years, 6 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 | « net/ssl/client_key_store.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/client_key_store.cc
diff --git a/net/ssl/client_key_store.cc b/net/ssl/client_key_store.cc
deleted file mode 100644
index b448a6652d845d53d0f26b841dcbd6b4aa5346ee..0000000000000000000000000000000000000000
--- a/net/ssl/client_key_store.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2015 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 "net/ssl/client_key_store.h"
-
-#include <algorithm>
-#include <utility>
-
-#include "net/cert/x509_certificate.h"
-#include "net/ssl/ssl_private_key.h"
-
-namespace net {
-
-namespace {
-static base::LazyInstance<ClientKeyStore>::Leaky g_client_key_store =
- LAZY_INSTANCE_INITIALIZER;
-} // namespace
-
-ClientKeyStore::ClientKeyStore() {}
-
-ClientKeyStore::~ClientKeyStore() {}
-
-// static
-ClientKeyStore* ClientKeyStore::GetInstance() {
- return g_client_key_store.Pointer();
-}
-
-void ClientKeyStore::AddProvider(CertKeyProvider* provider) {
- base::AutoLock auto_lock(lock_);
- providers_.push_back(provider);
-}
-
-void ClientKeyStore::RemoveProvider(const CertKeyProvider* provider) {
- base::AutoLock auto_lock(lock_);
-
- const auto& it = std::find(providers_.begin(), providers_.end(), provider);
- if (it != providers_.end())
- providers_.erase(it);
-}
-
-scoped_refptr<SSLPrivateKey> ClientKeyStore::FetchClientCertPrivateKey(
- const X509Certificate& certificate) {
- base::AutoLock auto_lock(lock_);
-
- for (auto* provider : providers_) {
- scoped_refptr<SSLPrivateKey> key;
- if (provider->GetCertificateKey(certificate, &key))
- return key;
- }
- return nullptr;
-}
-
-} // namespace net
« no previous file with comments | « net/ssl/client_key_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698