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

Unified Diff: net/base/mock_cert_verifier.h

Issue 13006020: net: extract net/cert out of net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | « net/base/ev_root_ca_metadata_unittest.cc ('k') | net/base/mock_cert_verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mock_cert_verifier.h
diff --git a/net/base/mock_cert_verifier.h b/net/base/mock_cert_verifier.h
deleted file mode 100644
index d0537c1f33c5ef920f0c3f4825ebdaa2ed7c4295..0000000000000000000000000000000000000000
--- a/net/base/mock_cert_verifier.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 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.
-
-#ifndef NET_BASE_MOCK_CERT_VERIFIER_H_
-#define NET_BASE_MOCK_CERT_VERIFIER_H_
-
-#include <list>
-
-#include "net/base/cert_verifier.h"
-#include "net/base/cert_verify_result.h"
-
-namespace net {
-
-class MockCertVerifier : public CertVerifier {
- public:
- // Creates a new MockCertVerifier. By default, any call to Verify() will
- // result in the cert status being flagged as CERT_STATUS_INVALID and return
- // an ERR_CERT_INVALID network error code. This behaviour can be overridden
- // by calling set_default_result() to change the default return value for
- // Verify() or by calling one of the AddResult*() methods to specifically
- // handle a certificate or certificate and host.
- MockCertVerifier();
-
- virtual ~MockCertVerifier();
-
- // CertVerifier implementation
- virtual int Verify(X509Certificate* cert,
- const std::string& hostname,
- int flags,
- CRLSet* crl_set,
- CertVerifyResult* verify_result,
- const CompletionCallback& callback,
- RequestHandle* out_req,
- const BoundNetLog& net_log) OVERRIDE;
- virtual void CancelRequest(RequestHandle req) OVERRIDE;
-
- // Sets the default return value for Verify() for certificates/hosts that do
- // not have explicit results added via the AddResult*() methods.
- void set_default_result(int default_result) {
- default_result_ = default_result;
- }
-
- // Adds a rule that will cause any call to Verify() for |cert| to return rv,
- // copying |verify_result| into the verified result.
- // Note: Only the primary certificate of |cert| is checked. Any intermediate
- // certificates will be ignored.
- void AddResultForCert(X509Certificate* cert,
- const CertVerifyResult& verify_result,
- int rv);
-
- // Same as AddResultForCert(), but further restricts it to only return for
- // hostnames that match |host_pattern|.
- void AddResultForCertAndHost(X509Certificate* cert,
- const std::string& host_pattern,
- const CertVerifyResult& verify_result,
- int rv);
-
- private:
- struct Rule;
- typedef std::list<Rule> RuleList;
-
- int default_result_;
- RuleList rules_;
-};
-
-} // namespace net
-
-#endif // NET_BASE_MOCK_CERT_VERIFIER_H_
« no previous file with comments | « net/base/ev_root_ca_metadata_unittest.cc ('k') | net/base/mock_cert_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698