diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-25 15:09:31 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-03-01 12:06:20 +0000 |
commit | ab94349cb2fa073e8aec661a797de1cfc3819752 (patch) | |
tree | d3525f63aa9b3ff041989d5cf981e0ee8b07d77d /src/core/ssl_host_state_delegate_qt.cpp | |
parent | cb6564b11ea0a81155b59ab178ff75148017a952 (diff) |
Simple adaptations to Chromium 55
The simplest adaptations to API and build changes in Chromium 55
Change-Id: I923fa188690a04902492317807f72f006bcab9c6
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/ssl_host_state_delegate_qt.cpp')
-rw-r--r-- | src/core/ssl_host_state_delegate_qt.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/core/ssl_host_state_delegate_qt.cpp b/src/core/ssl_host_state_delegate_qt.cpp index 506172aaa..72aec2bff 100644 --- a/src/core/ssl_host_state_delegate_qt.cpp +++ b/src/core/ssl_host_state_delegate_qt.cpp @@ -34,6 +34,8 @@ ** ****************************************************************************/ +#include "base/callback.h" + #include "ssl_host_state_delegate_qt.h" #include "type_conversion.h" @@ -86,9 +88,21 @@ void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509C } // Clear all allow preferences. -void SSLHostStateDelegateQt::Clear() +void SSLHostStateDelegateQt::Clear(const base::Callback<bool(const std::string&)>& host_filter) { - m_certPolicyforHost.clear(); + if (host_filter.is_null()) { + m_certPolicyforHost.clear(); + return; + } + + for (auto it = m_certPolicyforHost.begin(); it != m_certPolicyforHost.end();) { + auto next_it = std::next(it); + + if (host_filter.Run(it->first)) + m_certPolicyforHost.erase(it); + + it = next_it; + } } // Queries whether |cert| is allowed for |host| and |error|. Returns true in @@ -102,12 +116,12 @@ content::SSLHostStateDelegate::CertJudgment SSLHostStateDelegateQt::QueryPolicy( } // Records that a host has run insecure content. -void SSLHostStateDelegateQt::HostRanInsecureContent(const std::string &host, int pid) +void SSLHostStateDelegateQt::HostRanInsecureContent(const std::string &host, int pid, InsecureContentType content_type) { } // Returns whether the specified host ran insecure content. -bool SSLHostStateDelegateQt::DidHostRunInsecureContent(const std::string &host, int pid) const +bool SSLHostStateDelegateQt::DidHostRunInsecureContent(const std::string &host, int pid, InsecureContentType content_type) const { return false; } |