diff options
Diffstat (limited to 'src/core/net/ssl_host_state_delegate_qt.cpp')
-rw-r--r-- | src/core/net/ssl_host_state_delegate_qt.cpp | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/src/core/net/ssl_host_state_delegate_qt.cpp b/src/core/net/ssl_host_state_delegate_qt.cpp index 2c64132f3..41967f14e 100644 --- a/src/core/net/ssl_host_state_delegate_qt.cpp +++ b/src/core/net/ssl_host_state_delegate_qt.cpp @@ -3,7 +3,7 @@ #include "ssl_host_state_delegate_qt.h" -#include "base/callback.h" +#include "base/functional/callback.h" namespace QtWebEngineCore { @@ -39,7 +39,7 @@ SSLHostStateDelegateQt::SSLHostStateDelegateQt() {} SSLHostStateDelegateQt::~SSLHostStateDelegateQt() {} -void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509Certificate &cert, int error, content::WebContents *) +void SSLHostStateDelegateQt::AllowCert(const std::string &host, const net::X509Certificate &cert, int error, content::StoragePartition *) { m_certPolicyforHost[host].Allow(cert, error); } @@ -67,7 +67,7 @@ void SSLHostStateDelegateQt::Clear(base::RepeatingCallback<bool(const std::strin // prior to this query, otherwise false. content::SSLHostStateDelegate::CertJudgment SSLHostStateDelegateQt::QueryPolicy(const std::string &host, const net::X509Certificate &cert, - int error, content::WebContents *) + int error, content::StoragePartition *) { return m_certPolicyforHost[host].Check(cert, error) ? SSLHostStateDelegate::ALLOWED : SSLHostStateDelegate::DENIED; } @@ -83,12 +83,12 @@ bool SSLHostStateDelegateQt::DidHostRunInsecureContent(const std::string &host, return false; } -void SSLHostStateDelegateQt::AllowHttpForHost(const std::string &host, content::WebContents *web_contents) +void SSLHostStateDelegateQt::AllowHttpForHost(const std::string &host, content::StoragePartition *web_contents) { // Intentional no-op see aw_ssl_host_state_delegate } -bool SSLHostStateDelegateQt::IsHttpAllowedForHost(const std::string &host, content::WebContents *web_contents) +bool SSLHostStateDelegateQt::IsHttpAllowedForHost(const std::string &host, content::StoragePartition *web_contents) { return false; } @@ -104,12 +104,33 @@ void SSLHostStateDelegateQt::RevokeUserAllowExceptions(const std::string &host) // |host|. This does not mean that *all* certificate errors are allowed, just // that there exists an exception. To see if a particular certificate and // error combination exception is allowed, use QueryPolicy(). -bool SSLHostStateDelegateQt::HasAllowException(const std::string &host, content::WebContents *) +bool SSLHostStateDelegateQt::HasAllowException(const std::string &host, content::StoragePartition *) { auto policy_iterator = m_certPolicyforHost.find(host); return policy_iterator != m_certPolicyforHost.end() && policy_iterator->second.HasAllowException(); } +bool SSLHostStateDelegateQt::HasAllowExceptionForAnyHost(content::StoragePartition *storage_partition) +{ + for (auto const &it : m_certPolicyforHost) { + if (it.second.HasAllowException()) { + return true; + } + } + return false; +} + +void SSLHostStateDelegateQt::SetHttpsEnforcementForHost(const std::string &host, bool enforce, + content::StoragePartition *storage_partition) +{ + // Intentional no-op see aw_ssl_host_state_delegate +} + +bool SSLHostStateDelegateQt::IsHttpsEnforcedForHost(const std::string &host, content::StoragePartition *storage_partition) +{ + // Intentional no-op + return false; +} } // namespace QtWebEngineCore |