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( ...@@ -83,9 +83,9 @@ ScopedCERTCertificateList NSSCertDatabaseChromeOS::ListCertsImpl(
NSSCertDatabase::ListCertsImpl(crypto::ScopedPK11Slot())); NSSCertDatabase::ListCertsImpl(crypto::ScopedPK11Slot()));
size_t pre_size = certs.size(); size_t pre_size = certs.size();
base::EraseIf(certs, base::EraseIf(certs, [&profile_filter](ScopedCERTCertificate& cert) {
NSSProfileFilterChromeOS::CertNotAllowedForProfilePredicate( return !profile_filter.IsCertAllowed(cert.get());
profile_filter)); });
DVLOG(1) << "filtered " << pre_size - certs.size() << " of " << pre_size DVLOG(1) << "filtered " << pre_size - certs.size() << " of " << pre_size
<< " certs"; << " certs";
return certs; return certs;
......
...@@ -139,15 +139,6 @@ bool NSSProfileFilterChromeOS::IsCertAllowed(CERTCertificate* cert) const { ...@@ -139,15 +139,6 @@ bool NSSProfileFilterChromeOS::IsCertAllowed(CERTCertificate* cert) const {
return false; 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:: NSSProfileFilterChromeOS::ModuleNotAllowedForProfilePredicate::
ModuleNotAllowedForProfilePredicate(const NSSProfileFilterChromeOS& filter) ModuleNotAllowedForProfilePredicate(const NSSProfileFilterChromeOS& filter)
: filter_(filter) {} : filter_(filter) {}
......
...@@ -42,17 +42,7 @@ class NET_EXPORT NSSProfileFilterChromeOS { ...@@ -42,17 +42,7 @@ class NET_EXPORT NSSProfileFilterChromeOS {
bool IsModuleAllowed(PK11SlotInfo* slot) const; bool IsModuleAllowed(PK11SlotInfo* slot) const;
bool IsCertAllowed(CERTCertificate* cert) const; bool IsCertAllowed(CERTCertificate* cert) const;
// TODO(mattm): remove these predicates and use labmdas instead. // TODO(mattm): remove this predicate and use labmda instead.
class CertNotAllowedForProfilePredicate {
public:
explicit CertNotAllowedForProfilePredicate(
const NSSProfileFilterChromeOS& filter);
bool operator()(const ScopedCERTCertificate& cert) const;
private:
const NSSProfileFilterChromeOS& filter_;
};
class ModuleNotAllowedForProfilePredicate { class ModuleNotAllowedForProfilePredicate {
public: public:
explicit ModuleNotAllowedForProfilePredicate( 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