Commit c59bbc74 authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Remove CertNotAllowedForProfilePredicate and use labmda instead.

As the comment in nss_profile_filter_chromeos.h by mattm@,
remove CertNotAllowedForProfilePredicate and use labmda in the
client.
Signed-off-by: default avatarZhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: I601067a66f04827e5da361b90e939f67468a8b24
Reviewed-on: https://chromium-review.googlesource.com/1165262Reviewed-by: default avatarMatt Mueller <mattm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581980}
parent c3a5368a
......@@ -83,9 +83,9 @@ ScopedCERTCertificateList NSSCertDatabaseChromeOS::ListCertsImpl(
NSSCertDatabase::ListCertsImpl(crypto::ScopedPK11Slot()));
size_t pre_size = certs.size();
base::EraseIf(certs,
NSSProfileFilterChromeOS::CertNotAllowedForProfilePredicate(
profile_filter));
base::EraseIf(certs, [&profile_filter](ScopedCERTCertificate& cert) {
return !profile_filter.IsCertAllowed(cert.get());
});
DVLOG(1) << "filtered " << pre_size - certs.size() << " of " << pre_size
<< " certs";
return certs;
......
......@@ -139,15 +139,6 @@ bool NSSProfileFilterChromeOS::IsCertAllowed(CERTCertificate* cert) const {
return false;
}
NSSProfileFilterChromeOS::CertNotAllowedForProfilePredicate::
CertNotAllowedForProfilePredicate(const NSSProfileFilterChromeOS& filter)
: filter_(filter) {}
bool NSSProfileFilterChromeOS::CertNotAllowedForProfilePredicate::operator()(
const ScopedCERTCertificate& cert) const {
return !filter_.IsCertAllowed(cert.get());
}
NSSProfileFilterChromeOS::ModuleNotAllowedForProfilePredicate::
ModuleNotAllowedForProfilePredicate(const NSSProfileFilterChromeOS& filter)
: filter_(filter) {}
......
......@@ -42,17 +42,7 @@ class NET_EXPORT NSSProfileFilterChromeOS {
bool IsModuleAllowed(PK11SlotInfo* slot) const;
bool IsCertAllowed(CERTCertificate* cert) const;
// TODO(mattm): remove these predicates and use labmdas instead.
class CertNotAllowedForProfilePredicate {
public:
explicit CertNotAllowedForProfilePredicate(
const NSSProfileFilterChromeOS& filter);
bool operator()(const ScopedCERTCertificate& cert) const;
private:
const NSSProfileFilterChromeOS& filter_;
};
// TODO(mattm): remove this predicate and use labmda instead.
class ModuleNotAllowedForProfilePredicate {
public:
explicit ModuleNotAllowedForProfilePredicate(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment