diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-23 17:01:10 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-23 17:01:10 +0000 |
commit | 8f261180d35bd2217510ae862da6b38d7cf8034f (patch) | |
tree | c0a89be66f44ace1ca61bbc3c96ca5205eaabda4 /chrome/browser/net | |
parent | 3851cfc8bbc0b5d35761e459fc1bd2cf6b8ca34f (diff) | |
download | chromium_src-8f261180d35bd2217510ae862da6b38d7cf8034f.zip chromium_src-8f261180d35bd2217510ae862da6b38d7cf8034f.tar.gz chromium_src-8f261180d35bd2217510ae862da6b38d7cf8034f.tar.bz2 |
Revert "Hide ChromeDnsCertProvenanceChecker behind a factory."
This reverts commit r67098. This is a preemptive revert because we have
no idea what broke ControlFlowErrorUpdate on Chronos.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
5 files changed, 46 insertions, 140 deletions
diff --git a/chrome/browser/net/chrome_dns_cert_provenance_checker.cc b/chrome/browser/net/chrome_dns_cert_provenance_checker.cc deleted file mode 100644 index 2f6ebc5..0000000 --- a/chrome/browser/net/chrome_dns_cert_provenance_checker.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2010 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 "chrome/browser/net/chrome_dns_cert_provenance_checker.h" - -namespace { - -class ChromeDnsCertProvenanceChecker : - public net::DnsCertProvenanceChecker, - public net::DnsCertProvenanceChecker::Delegate { - public: - ChromeDnsCertProvenanceChecker( - net::DnsRRResolver* dnsrr_resolver, - ChromeURLRequestContext* url_req_context) - : dnsrr_resolver_(dnsrr_resolver), - url_req_context_(url_req_context) { - } - - // DnsCertProvenanceChecker interface - virtual void DoAsyncVerification( - const std::string& hostname, - const std::vector<base::StringPiece>& der_certs) { - net::DnsCertProvenanceChecker::DoAsyncLookup(hostname, der_certs, - dnsrr_resolver_, this); - } - - // DnsCertProvenanceChecker::Delegate interface - virtual void OnDnsCertLookupFailed( - const std::string& hostname, - const std::vector<std::string>& der_certs) { - // Currently unimplemented. - } - - private: - net::DnsRRResolver* const dnsrr_resolver_; - ChromeURLRequestContext* const url_req_context_; -}; - -} // namespace - -net::DnsCertProvenanceChecker* CreateChromeDnsCertProvenanceChecker( - net::DnsRRResolver* dnsrr_resolver, - ChromeURLRequestContext* url_req_context) { - return new ChromeDnsCertProvenanceChecker(dnsrr_resolver, url_req_context); -} diff --git a/chrome/browser/net/chrome_dns_cert_provenance_checker.h b/chrome/browser/net/chrome_dns_cert_provenance_checker.h deleted file mode 100644 index 304a5ef..0000000 --- a/chrome/browser/net/chrome_dns_cert_provenance_checker.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2010 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 CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER -#define CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER -#pragma once - -#include "net/socket/dns_cert_provenance_checker.h" - -#include <string> -#include <vector> - -#include "base/string_piece.h" - -namespace net { -class DnsRRResolver; -} - -class ChromeURLRequestContext; - -// Factory function which creates ChromeDnsCertProvenanceChecker objects. -// -// WARNING: do not use this with anything other than the main -// ChromeURLRequestContext. Eventually we'll want to have the other contexts -// point to the main ChromeURLRequestContext, which then causes lifetime -// ordering issues wrt ChromeURLRequestContexts, since we're using a raw -// pointer, and we'll get shutdown ordering problems. -net::DnsCertProvenanceChecker* CreateChromeDnsCertProvenanceChecker( - net::DnsRRResolver* dnsrr_resolver, - ChromeURLRequestContext* url_req_context); - -#endif // CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER diff --git a/chrome/browser/net/chrome_dns_cert_provenance_checker_factory.cc b/chrome/browser/net/chrome_dns_cert_provenance_checker_factory.cc deleted file mode 100644 index 5206a24..0000000 --- a/chrome/browser/net/chrome_dns_cert_provenance_checker_factory.cc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2010 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 "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" - -static DnsCertProvenanceCheckerFactory g_factory; - -net::DnsCertProvenanceChecker* CreateDnsCertProvenanceChecker( - net::DnsRRResolver* dnsrr_resolver, - ChromeURLRequestContext* url_req_context) { - if (!g_factory) - return NULL; - - return g_factory(dnsrr_resolver, url_req_context); -} - -void SetDnsCertProvenanceCheckerFactory(DnsCertProvenanceCheckerFactory f) { - g_factory = f; -} diff --git a/chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h b/chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h deleted file mode 100644 index 36cdc59..0000000 --- a/chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2010 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 CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER_FACTORY -#define CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER_FACTORY -#pragma once - -#include "net/socket/dns_cert_provenance_checker.h" - -// WARNING: This factory abstraction is needed because we cannot link NSS code -// into a .cc file which is included by both Chrome and Chrome Frame. This -// factory exists so that common code links only against the factory code. -// Chrome specific code will link against the NSS using code in -// chrome_dns_cert_provenance_checker.cc and hand a function pointer to this -// code. - -namespace net { -class DnsRRResolver; -} - -class ChromeURLRequestContext; - -// A DnsCertProvenanceCheckerFactory is a function pointer to a factory -// function for DnsCertProvenanceCheckerFactory objects. -typedef net::DnsCertProvenanceChecker* (*DnsCertProvenanceCheckerFactory) ( - net::DnsRRResolver* dnsrr_resolver, - ChromeURLRequestContext* url_req_context); - -// Return a new DnsCertProvenanceChecker. Caller takes ownership. May return -// NULL if no factory function has been set. -net::DnsCertProvenanceChecker* CreateDnsCertProvenanceChecker( - net::DnsRRResolver* dnsrr_resolver, - ChromeURLRequestContext* url_req_context); - -void SetDnsCertProvenanceCheckerFactory(DnsCertProvenanceCheckerFactory); - -#endif // CHROME_BROWSER_NET_CHROME_DNS_CERT_PROVENANCE_CHECKER_FACTORY diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index e5c1c92..4ec3939 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -16,7 +16,6 @@ #include "chrome/browser/io_thread.h" #include "chrome/browser/net/chrome_cookie_notification_details.h" #include "chrome/browser/net/chrome_net_log.h" -#include "chrome/browser/net/chrome_dns_cert_provenance_checker_factory.h" #include "chrome/browser/net/sqlite_persistent_cookie_store.h" #include "chrome/browser/net/predictor_api.h" #include "chrome/browser/profile.h" @@ -34,6 +33,7 @@ #include "net/proxy/proxy_config_service_fixed.h" #include "net/proxy/proxy_script_fetcher.h" #include "net/proxy/proxy_service.h" +#include "net/socket/dns_cert_provenance_checker.h" #include "net/url_request/url_request.h" #include "webkit/glue/webkit_glue.h" @@ -224,6 +224,47 @@ class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { }; // ---------------------------------------------------------------------------- +// Implementation of DnsCertProvenanceChecker +// ---------------------------------------------------------------------------- + +// WARNING: do not use this with anything other than the main +// ChromeURLRequestContext. Eventually we'll want to have the other contexts +// point to the main ChromeURLRequestContext, which then causes lifetime +// ordering issues wrt ChromeURLRequestContexts, since we're using a raw +// pointer, and we'll get shutdown ordering problems. + +class ChromeDnsCertProvenanceChecker : + public net::DnsCertProvenanceChecker, + public net::DnsCertProvenanceChecker::Delegate { + public: + ChromeDnsCertProvenanceChecker( + net::DnsRRResolver* dnsrr_resolver, + ChromeURLRequestContext* url_req_context) + : dnsrr_resolver_(dnsrr_resolver), + url_req_context_(url_req_context) { + } + + // DnsCertProvenanceChecker interface + virtual void DoAsyncVerification( + const std::string& hostname, + const std::vector<base::StringPiece>& der_certs) { + net::DnsCertProvenanceChecker::DoAsyncLookup(hostname, der_certs, + dnsrr_resolver_, this); + } + + // DnsCertProvenanceChecker::Delegate interface + virtual void OnDnsCertLookupFailed( + const std::string& hostname, + const std::vector<std::string>& der_certs) { + // Currently unimplemented. + } + + private: + net::DnsRRResolver* const dnsrr_resolver_; + ChromeURLRequestContext* const url_req_context_; +}; + +// ---------------------------------------------------------------------------- // Helper factories // ---------------------------------------------------------------------------- @@ -266,9 +307,11 @@ ChromeURLRequestContext* FactoryForOriginal::Create() { context->set_http_auth_handler_factory( io_thread_globals->http_auth_handler_factory.get()); + /* Disabled for now due to Chrome Frame linking issues on Windows. context->set_dns_cert_checker( - CreateDnsCertProvenanceChecker(io_thread_globals->dnsrr_resolver.get(), - context)); + new ChromeDnsCertProvenanceChecker( + io_thread_globals->dnsrr_resolver.get(), + context)); */ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |