| Index: content/test/mock_ssl_host_state_delegate.cc
|
| diff --git a/content/test/mock_ssl_host_state_delegate.cc b/content/test/mock_ssl_host_state_delegate.cc
|
| index 68383d37596d24b5d6ae75cbb6820ef763af6a71..590eaf5172a675d23c5768bf1a6bfd6b3cddc35c 100644
|
| --- a/content/test/mock_ssl_host_state_delegate.cc
|
| +++ b/content/test/mock_ssl_host_state_delegate.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/callback.h"
|
| #include "content/test/mock_ssl_host_state_delegate.h"
|
|
|
| namespace content {
|
| @@ -16,8 +17,20 @@ void MockSSLHostStateDelegate::AllowCert(const std::string& host,
|
| exceptions_.insert(host);
|
| }
|
|
|
| -void MockSSLHostStateDelegate::Clear() {
|
| - exceptions_.clear();
|
| +void MockSSLHostStateDelegate::Clear(
|
| + const base::Callback<bool(const std::string&)>& host_filter) {
|
| + if (host_filter.is_null()) {
|
| + exceptions_.clear();
|
| + } else {
|
| + for (auto it = exceptions_.begin(); it != exceptions_.end();) {
|
| + auto next_it = std::next(it);
|
| +
|
| + if (host_filter.Run(*it))
|
| + exceptions_.erase(it);
|
| +
|
| + it = next_it;
|
| + }
|
| + }
|
| }
|
|
|
| SSLHostStateDelegate::CertJudgment MockSSLHostStateDelegate::QueryPolicy(
|
|
|