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

Unified Diff: ios/web/net/certificate_policy_cache.cc

Issue 986743003: Upstream (most of) ios/web/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace comment Created 5 years, 9 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
« no previous file with comments | « ios/web/net/cert_policy_unittest.cc ('k') | ios/web/public/browser_url_rewriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/net/certificate_policy_cache.cc
diff --git a/ios/web/net/certificate_policy_cache.cc b/ios/web/net/certificate_policy_cache.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5a0ef07443cb7f5884126f5da6d2fe8a82e739a3
--- /dev/null
+++ b/ios/web/net/certificate_policy_cache.cc
@@ -0,0 +1,38 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/web/public/certificate_policy_cache.h"
+
+#include "base/logging.h"
+#include "ios/web/public/web_thread.h"
+
+namespace web {
+
+CertificatePolicyCache::CertificatePolicyCache() {
+}
+
+CertificatePolicyCache::~CertificatePolicyCache() {
+}
+
+void CertificatePolicyCache::AllowCertForHost(net::X509Certificate* cert,
+ const std::string& host,
+ net::CertStatus error) {
+ DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO);
+ cert_policy_for_host_[host].Allow(cert, error);
+}
+
+CertPolicy::Judgment CertificatePolicyCache::QueryPolicy(
+ net::X509Certificate* cert,
+ const std::string& host,
+ net::CertStatus error) {
+ DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO);
+ return cert_policy_for_host_[host].Check(cert, error);
+}
+
+void CertificatePolicyCache::ClearCertificatePolicies() {
+ DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO);
+ cert_policy_for_host_.clear();
+}
+
+} // namespace web
« no previous file with comments | « ios/web/net/cert_policy_unittest.cc ('k') | ios/web/public/browser_url_rewriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698