Home | History | Annotate | Download | only in base
      1 // Copyright (c) 2008 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef NET_BASE_SCOPED_CERT_CHAIN_CONTEXT_H_
      6 #define NET_BASE_SCOPED_CERT_CHAIN_CONTEXT_H_
      7 
      8 #include <windows.h>
      9 #include <wincrypt.h>
     10 
     11 #include "base/scoped_ptr.h"
     12 
     13 namespace net {
     14 
     15 // This class wraps the CertFreeCertificateChain function in a class that can
     16 // be passed as a template argument to scoped_ptr_malloc.
     17 class ScopedPtrMallocFreeCertChain {
     18  public:
     19   void operator()(const CERT_CHAIN_CONTEXT* x) const {
     20     CertFreeCertificateChain(x);
     21   }
     22 };
     23 
     24 typedef scoped_ptr_malloc<const CERT_CHAIN_CONTEXT,
     25                           ScopedPtrMallocFreeCertChain> ScopedCertChainContext;
     26 
     27 }  // namespace net
     28 
     29 #endif  // NET_BASE_SCOPED_CERT_CHAIN_CONTEXT_H_
     30