Chromium Code Reviews| Index: android_webview/browser/aw_ssl_host_state_delegate.cc |
| diff --git a/android_webview/browser/aw_ssl_host_state_delegate.cc b/android_webview/browser/aw_ssl_host_state_delegate.cc |
| index a3a4119a3efb10b137942c13d8067de5a126e9d8..9fc8b812ad949b9b90730b1693a5996d8ee0103b 100644 |
| --- a/android_webview/browser/aw_ssl_host_state_delegate.cc |
| +++ b/android_webview/browser/aw_ssl_host_state_delegate.cc |
| @@ -4,6 +4,7 @@ |
| #include "android_webview/browser/aw_ssl_host_state_delegate.h" |
| +#include "base/callback.h" |
| #include "net/base/hash_value.h" |
| using content::SSLHostStateDelegate; |
| @@ -76,8 +77,21 @@ void AwSSLHostStateDelegate::AllowCert(const std::string& host, |
| cert_policy_for_host_[host].Allow(cert, error); |
| } |
| -void AwSSLHostStateDelegate::Clear() { |
| - cert_policy_for_host_.clear(); |
| +void AwSSLHostStateDelegate::Clear( |
| + const base::Callback<bool(const std::string&)>& host_filter) { |
| + if (host_filter.IsNull()) { |
| + cert_policy_for_host_.clear(); |
| + return; |
| + } |
| + |
| + for (auto it = cert_policy_for_host_.begin(); it != cert_policy_map_.end();) { |
|
estark
2016/08/30 01:52:15
|cert_policy_map_| doesn't appear to be a thing; g
msramek
2016/08/30 14:39:41
Done. Of course I didn't get a compilation error s
|
| + auto next_it = std::next(it); |
| + |
| + if (host_filter.Run(it->first)) |
| + cert_policy_for_host_.erase(it); |
| + |
| + it = next_it; |
| + } |
| } |
| SSLHostStateDelegate::CertJudgment AwSSLHostStateDelegate::QueryPolicy( |