Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: net/http/transport_security_state.cc

Issue 19269012: Don't persist HPKP if PrivacyMode is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address codereview nit and fix compilation error in OFFICIAL_BUILD. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {
}

Powered by Google App Engine
This is Rietveld 408576698