| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" | 5 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 map->SetWebsiteSettingDefaultScope(url, GURL(), | 326 map->SetWebsiteSettingDefaultScope(url, GURL(), |
| 327 CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, | 327 CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, |
| 328 std::string(), std::move(value)); | 328 std::string(), std::move(value)); |
| 329 } | 329 } |
| 330 | 330 |
| 331 void ChromeSSLHostStateDelegate::Clear( | 331 void ChromeSSLHostStateDelegate::Clear( |
| 332 const base::Callback<bool(const std::string&)>& host_filter) { | 332 const base::Callback<bool(const std::string&)>& host_filter) { |
| 333 // Convert host matching to content settings pattern matching. Content | 333 // Convert host matching to content settings pattern matching. Content |
| 334 // settings deletion is done synchronously on the UI thread, so we can use | 334 // settings deletion is done synchronously on the UI thread, so we can use |
| 335 // |host_filter| by reference. | 335 // |host_filter| by reference. |
| 336 base::Callback<bool(const ContentSettingsPattern& primary_pattern, | 336 HostContentSettingsMap::PatternSourcePredicate pattern_filter; |
| 337 const ContentSettingsPattern& secondary_pattern)> | |
| 338 pattern_filter; | |
| 339 if (!host_filter.is_null()) { | 337 if (!host_filter.is_null()) { |
| 340 pattern_filter = | 338 pattern_filter = |
| 341 base::Bind(&HostFilterToPatternFilter, base::ConstRef(host_filter)); | 339 base::Bind(&HostFilterToPatternFilter, base::ConstRef(host_filter)); |
| 342 } | 340 } |
| 343 | 341 |
| 344 HostContentSettingsMapFactory::GetForProfile(profile_) | 342 HostContentSettingsMapFactory::GetForProfile(profile_) |
| 345 ->ClearSettingsForOneTypeWithPredicate( | 343 ->ClearSettingsForOneTypeWithPredicate( |
| 346 CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, pattern_filter); | 344 CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, base::Time(), |
| 345 pattern_filter); |
| 347 } | 346 } |
| 348 | 347 |
| 349 content::SSLHostStateDelegate::CertJudgment | 348 content::SSLHostStateDelegate::CertJudgment |
| 350 ChromeSSLHostStateDelegate::QueryPolicy(const std::string& host, | 349 ChromeSSLHostStateDelegate::QueryPolicy(const std::string& host, |
| 351 const net::X509Certificate& cert, | 350 const net::X509Certificate& cert, |
| 352 net::CertStatus error, | 351 net::CertStatus error, |
| 353 bool* expired_previous_decision) { | 352 bool* expired_previous_decision) { |
| 354 HostContentSettingsMap* map = | 353 HostContentSettingsMap* map = |
| 355 HostContentSettingsMapFactory::GetForProfile(profile_); | 354 HostContentSettingsMapFactory::GetForProfile(profile_); |
| 356 GURL url = GetSecureGURLForHost(host); | 355 GURL url = GetSecureGURLForHost(host); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 case CERT_ERRORS_CONTENT: | 486 case CERT_ERRORS_CONTENT: |
| 488 return !!ran_content_with_cert_errors_hosts_.count( | 487 return !!ran_content_with_cert_errors_hosts_.count( |
| 489 BrokenHostEntry(host, child_id)); | 488 BrokenHostEntry(host, child_id)); |
| 490 } | 489 } |
| 491 NOTREACHED(); | 490 NOTREACHED(); |
| 492 return false; | 491 return false; |
| 493 } | 492 } |
| 494 void ChromeSSLHostStateDelegate::SetClock(std::unique_ptr<base::Clock> clock) { | 493 void ChromeSSLHostStateDelegate::SetClock(std::unique_ptr<base::Clock> clock) { |
| 495 clock_ = std::move(clock); | 494 clock_ = std::move(clock); |
| 496 } | 495 } |
| OLD | NEW |