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

Unified Diff: net/cert/nss_cert_database_chromeos.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/cert/nss_cert_database_chromeos.h ('k') | net/cert/nss_cert_database_chromeos_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_cert_database_chromeos.cc
diff --git a/net/cert/nss_cert_database_chromeos.cc b/net/cert/nss_cert_database_chromeos.cc
deleted file mode 100644
index 63d969cd7ea291ae2f152c189f4cb971f575721f..0000000000000000000000000000000000000000
--- a/net/cert/nss_cert_database_chromeos.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-// 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 "net/cert/nss_cert_database_chromeos.h"
-
-#include <cert.h>
-#include <pk11pub.h>
-
-#include <algorithm>
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/location.h"
-#include "base/task_runner.h"
-#include "net/base/crypto_module.h"
-#include "net/cert/x509_certificate.h"
-
-namespace net {
-
-NSSCertDatabaseChromeOS::NSSCertDatabaseChromeOS(
- crypto::ScopedPK11Slot public_slot,
- crypto::ScopedPK11Slot private_slot)
- : NSSCertDatabase(public_slot.Pass(), private_slot.Pass()) {
- // By default, don't use a system slot. Only if explicitly set by
- // SetSystemSlot, the system slot will be used.
- profile_filter_.Init(GetPublicSlot(),
- GetPrivateSlot(),
- crypto::ScopedPK11Slot() /* no system slot */);
-}
-
-NSSCertDatabaseChromeOS::~NSSCertDatabaseChromeOS() {}
-
-void NSSCertDatabaseChromeOS::SetSystemSlot(
- crypto::ScopedPK11Slot system_slot) {
- system_slot_ = system_slot.Pass();
- profile_filter_.Init(GetPublicSlot(), GetPrivateSlot(), GetSystemSlot());
-}
-
-void NSSCertDatabaseChromeOS::ListCertsSync(CertificateList* certs) {
- ListCertsImpl(profile_filter_, certs);
-}
-
-void NSSCertDatabaseChromeOS::ListCerts(
- const base::Callback<void(scoped_ptr<CertificateList> certs)>& callback) {
- scoped_ptr<CertificateList> certs(new CertificateList());
-
- // base::Pased will NULL out |certs|, so cache the underlying pointer here.
- CertificateList* raw_certs = certs.get();
- GetSlowTaskRunner()->PostTaskAndReply(
- FROM_HERE,
- base::Bind(&NSSCertDatabaseChromeOS::ListCertsImpl,
- profile_filter_,
- base::Unretained(raw_certs)),
- base::Bind(callback, base::Passed(&certs)));
-}
-
-crypto::ScopedPK11Slot NSSCertDatabaseChromeOS::GetSystemSlot() const {
- if (system_slot_)
- return crypto::ScopedPK11Slot(PK11_ReferenceSlot(system_slot_.get()));
- return crypto::ScopedPK11Slot();
-}
-
-void NSSCertDatabaseChromeOS::ListModules(CryptoModuleList* modules,
- bool need_rw) const {
- NSSCertDatabase::ListModules(modules, need_rw);
-
- size_t pre_size = modules->size();
- modules->erase(
- std::remove_if(
- modules->begin(),
- modules->end(),
- NSSProfileFilterChromeOS::ModuleNotAllowedForProfilePredicate(
- profile_filter_)),
- modules->end());
- DVLOG(1) << "filtered " << pre_size - modules->size() << " of " << pre_size
- << " modules";
-}
-
-void NSSCertDatabaseChromeOS::ListCertsImpl(
- const NSSProfileFilterChromeOS& profile_filter,
- CertificateList* certs) {
- NSSCertDatabase::ListCertsImpl(crypto::ScopedPK11Slot(), certs);
-
- size_t pre_size = certs->size();
- certs->erase(std::remove_if(
- certs->begin(),
- certs->end(),
- NSSProfileFilterChromeOS::CertNotAllowedForProfilePredicate(
- profile_filter)),
- certs->end());
- DVLOG(1) << "filtered " << pre_size - certs->size() << " of " << pre_size
- << " certs";
-}
-
-} // namespace net
« no previous file with comments | « net/cert/nss_cert_database_chromeos.h ('k') | net/cert/nss_cert_database_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698