1 // Copyright (c) 2010 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 CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER_FACTORY 6 #define CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER_FACTORY 7 #pragma once 8 9 #include "net/socket/dns_cert_provenance_checker.h" 10 11 // WARNING: This factory abstraction is needed because we cannot link NSS code 12 // into a .cc file which is included by both Chrome and Chrome Frame. This 13 // factory exists so that common code links only against the factory code. 14 // Chrome specific code will link against the NSS using code in 15 // chrome_dns_cert_provenance_checker.cc and hand a function pointer to this 16 // code. 17 18 namespace net { 19 class DnsRRResolver; 20 } 21 22 class ChromeURLRequestContext; 23 24 // A DnsCertProvenanceCheckerFactory is a function pointer to a factory 25 // function for DnsCertProvenanceCheckerFactory objects. 26 typedef net::DnsCertProvenanceChecker* (*DnsCertProvenanceCheckerFactory) ( 27 net::DnsRRResolver* dnsrr_resolver, 28 ChromeURLRequestContext* url_req_context); 29 30 // Return a new DnsCertProvenanceChecker. Caller takes ownership. May return 31 // NULL if no factory function has been set. 32 net::DnsCertProvenanceChecker* CreateDnsCertProvenanceChecker( 33 net::DnsRRResolver* dnsrr_resolver, 34 ChromeURLRequestContext* url_req_context); 35 36 void SetDnsCertProvenanceCheckerFactory(DnsCertProvenanceCheckerFactory); 37 38 #endif // CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER_FACTORY 39