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

Unified Diff: net/socket_stream/socket_stream.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/socket_stream/socket_stream.cc
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index 699c8204aea0f2fe91980fa17d9305fb2451e34c..e50d09c5b726472cbcfc2046b130d88eeb334df6 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -132,6 +132,14 @@ bool SocketStream::is_secure() const {
return url_.SchemeIs("wss");
}
+GURL SocketStream::GetURLForCookies(const GURL& url) {
+ std::string scheme = url.SchemeIs("wss") ? "https" : "http";
+ url_canon::Replacements<char> replacements;
+ replacements.SetScheme(scheme.c_str(),
+ url_parse::Component(0, scheme.length()));
+ return url.ReplaceComponents(replacements);
+}
+
void SocketStream::set_context(URLRequestContext* context) {
const URLRequestContext* prev_context = context_;
@@ -1327,9 +1335,12 @@ int SocketStream::HandleCertificateError(int result) {
ssl_socket->GetSSLInfo(&ssl_info);
TransportSecurityState::DomainState domain_state;
- const bool fatal = context_->transport_security_state() &&
- context_->transport_security_state()->GetDomainState(url_.host(),
+ const bool fatal =
+ context_->transport_security_state() &&
+ context_->transport_security_state()->GetDomainState(
+ url_.host(),
SSLConfigService::IsSNIAvailable(context_->ssl_config_service()),
+ delegate_->CanGetCookies(this, url_for_cookies()),
&domain_state) &&
domain_state.ShouldSSLErrorsBeFatal();

Powered by Google App Engine
This is Rietveld 408576698