| 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..10b1227c3135f6b5705e15b73491e3190c0df347 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,22 @@ 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.is_null()) {
|
| + cert_policy_for_host_.clear();
|
| + return;
|
| + }
|
| +
|
| + for (auto it = cert_policy_for_host_.begin();
|
| + it != cert_policy_for_host_.end();) {
|
| + 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(
|
|
|