Chromium Code Reviews| Index: chrome/browser/ssl/chrome_ssl_host_state_delegate.cc |
| diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc |
| index e179edb926b9ef8df5a97c152f88933e09be8c57..d82a47ab7327babf90eb3a9f80ebb7d93d4e2e48 100644 |
| --- a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc |
| +++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc |
| @@ -22,7 +22,9 @@ |
| #include "components/content_settings/core/browser/host_content_settings_map.h" |
| #include "components/content_settings/core/common/content_settings_types.h" |
| #include "components/variations/variations_associated_data.h" |
| +#include "content/public/common/content_switches.h" |
| #include "net/base/hash_value.h" |
| +#include "net/base/net_util.h" |
| #include "net/cert/x509_certificate.h" |
| #include "net/http/http_transaction_factory.h" |
| #include "net/url_request/url_request_context.h" |
| @@ -327,6 +329,15 @@ ChromeSSLHostStateDelegate::QueryPolicy(const std::string& host, |
| scoped_ptr<base::Value> value(map->GetWebsiteSetting( |
| url, url, CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, std::string(), NULL)); |
| + // If the appropriate flag is set, let requests on localhost go |
| + // through even if there are certificate errors. Errors on localhost |
| + // are unlikely to indicate actual security problems. |
| + bool allow_localhost = base::CommandLine::ForCurrentProcess()-> |
|
jww
2015/02/09 19:29:38
The "*expired_previous_decision = false;" line sho
estark
2015/02/09 20:48:40
Done.
|
| + HasSwitch(switches::kAllowInsecureLocalhost); |
| + if (allow_localhost && net::IsLocalhost(url.host())) { |
| + return ALLOWED; |
| + } |
|
Ryan Sleevi
2015/02/09 19:31:34
Note: Consistent with the style in the rest of thi
estark
2015/02/09 20:48:40
Done.
|
| + |
| // Set a default value in case this method is short circuited and doesn't do a |
| // full query. |
| *expired_previous_decision = false; |