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

Side by Side Diff: chrome/browser/ssl/chrome_ssl_host_state_delegate.cc

Issue 2225213004: Teach SSLHostStateDelegate about subresources with cert errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { 427 for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) {
428 int policy_decision; // Owned by dict 428 int policy_decision; // Owned by dict
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(const std::string& host, 437 void ChromeSSLHostStateDelegate::HostRanInsecureContent(
438 int pid) { 438 const std::string& host,
439 ran_insecure_content_hosts_.insert(BrokenHostEntry(host, pid)); 439 int pid,
440 InsecureContentType content_type) {
441 switch (content_type) {
442 case MIXED_CONTENT:
443 ran_mixed_content_hosts_.insert(BrokenHostEntry(host, pid));
444 return;
445 case CERT_ERRORS_CONTENT:
446 ran_content_with_cert_errors_hosts_.insert(BrokenHostEntry(host, pid));
447 return;
448 }
440 } 449 }
441 450
442 bool ChromeSSLHostStateDelegate::DidHostRunInsecureContent( 451 bool ChromeSSLHostStateDelegate::DidHostRunInsecureContent(
443 const std::string& host, 452 const std::string& host,
444 int pid) const { 453 int pid,
445 return !!ran_insecure_content_hosts_.count(BrokenHostEntry(host, pid)); 454 InsecureContentType content_type) const {
455 switch (content_type) {
456 case MIXED_CONTENT:
457 return !!ran_mixed_content_hosts_.count(BrokenHostEntry(host, pid));
458 case CERT_ERRORS_CONTENT:
459 return !!ran_content_with_cert_errors_hosts_.count(
460 BrokenHostEntry(host, pid));
461 }
462 NOTREACHED();
463 return false;
446 } 464 }
447 void ChromeSSLHostStateDelegate::SetClock(std::unique_ptr<base::Clock> clock) { 465 void ChromeSSLHostStateDelegate::SetClock(std::unique_ptr<base::Clock> clock) {
448 clock_.reset(clock.release()); 466 clock_.reset(clock.release());
449 } 467 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/chrome_ssl_host_state_delegate.h ('k') | chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698