Index: net/http/transport_security_state.cc |
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc |
index d238e9955680066a0b71711d4a21847c1326ce4f..9f12ba0252503378cf523978fec7820b85ddb5f7 100644 |
--- a/net/http/transport_security_state.cc |
+++ b/net/http/transport_security_state.cc |
@@ -137,6 +137,7 @@ bool TransportSecurityState::DeleteDynamicDataForHost(const std::string& host) { |
bool TransportSecurityState::GetDomainState(const std::string& host, |
bool sni_enabled, |
+ bool allow_dynamic, |
DomainState* result) { |
DCHECK(CalledOnValidThread()); |
@@ -147,6 +148,12 @@ bool TransportSecurityState::GetDomainState(const std::string& host, |
bool has_preload = GetStaticDomainState(canonicalized_host, sni_enabled, |
&state); |
+ // If |allow_dynamic| is false, then return static state to the caller. |
+ if (!allow_dynamic) { |
+ if (has_preload) |
+ *result = state; |
+ return has_preload; |
+ } |
std::string canonicalized_preload = CanonicalizeHost(state.domain); |
GetDynamicDomainState(host, &state); |
@@ -836,8 +843,7 @@ TransportSecurityState::DomainState::DomainState() |
: upgrade_mode(MODE_DEFAULT), |
created(base::Time::Now()), |
sts_include_subdomains(false), |
- pkp_include_subdomains(false) { |
-} |
+ pkp_include_subdomains(false) {} |
TransportSecurityState::DomainState::~DomainState() { |
} |