| 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 | 10 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 success = it.value().GetAsInteger(&policy_decision); | 429 success = it.value().GetAsInteger(&policy_decision); |
| 430 if (success && (static_cast<CertJudgment>(policy_decision) == ALLOWED)) | 430 if (success && (static_cast<CertJudgment>(policy_decision) == ALLOWED)) |
| 431 return true; | 431 return true; |
| 432 } | 432 } |
| 433 | 433 |
| 434 return false; | 434 return false; |
| 435 } | 435 } |
| 436 | 436 |
| 437 void ChromeSSLHostStateDelegate::HostRanInsecureContent( | 437 void ChromeSSLHostStateDelegate::HostRanInsecureContent( |
| 438 const std::string& host, | 438 const std::string& host, |
| 439 int pid, | 439 int child_id, |
| 440 InsecureContentType content_type) { | 440 InsecureContentType content_type) { |
| 441 switch (content_type) { | 441 switch (content_type) { |
| 442 case MIXED_CONTENT: | 442 case MIXED_CONTENT: |
| 443 ran_mixed_content_hosts_.insert(BrokenHostEntry(host, pid)); | 443 ran_mixed_content_hosts_.insert(BrokenHostEntry(host, child_id)); |
| 444 return; | 444 return; |
| 445 case CERT_ERRORS_CONTENT: | 445 case CERT_ERRORS_CONTENT: |
| 446 ran_content_with_cert_errors_hosts_.insert(BrokenHostEntry(host, pid)); | 446 ran_content_with_cert_errors_hosts_.insert( |
| 447 BrokenHostEntry(host, child_id)); |
| 447 return; | 448 return; |
| 448 } | 449 } |
| 449 } | 450 } |
| 450 | 451 |
| 451 bool ChromeSSLHostStateDelegate::DidHostRunInsecureContent( | 452 bool ChromeSSLHostStateDelegate::DidHostRunInsecureContent( |
| 452 const std::string& host, | 453 const std::string& host, |
| 453 int pid, | 454 int child_id, |
| 454 InsecureContentType content_type) const { | 455 InsecureContentType content_type) const { |
| 455 switch (content_type) { | 456 switch (content_type) { |
| 456 case MIXED_CONTENT: | 457 case MIXED_CONTENT: |
| 457 return !!ran_mixed_content_hosts_.count(BrokenHostEntry(host, pid)); | 458 return !!ran_mixed_content_hosts_.count(BrokenHostEntry(host, child_id)); |
| 458 case CERT_ERRORS_CONTENT: | 459 case CERT_ERRORS_CONTENT: |
| 459 return !!ran_content_with_cert_errors_hosts_.count( | 460 return !!ran_content_with_cert_errors_hosts_.count( |
| 460 BrokenHostEntry(host, pid)); | 461 BrokenHostEntry(host, child_id)); |
| 461 } | 462 } |
| 462 NOTREACHED(); | 463 NOTREACHED(); |
| 463 return false; | 464 return false; |
| 464 } | 465 } |
| 465 void ChromeSSLHostStateDelegate::SetClock(std::unique_ptr<base::Clock> clock) { | 466 void ChromeSSLHostStateDelegate::SetClock(std::unique_ptr<base::Clock> clock) { |
| 466 clock_.reset(clock.release()); | 467 clock_.reset(clock.release()); |
| 467 } | 468 } |
| OLD | NEW |