diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-23 14:59:59 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-23 14:59:59 +0000 |
commit | 20f570c7cf8cd224676d4ae0f1d84d21d284f67e (patch) | |
tree | e27e1ce3726a1ac6677998bf637acf0559230dae /chrome/browser/net/chrome_url_request_context.cc | |
parent | bcb0213abec72573f26ba1fe6b7d7bf33dc0930f (diff) | |
download | chromium_src-20f570c7cf8cd224676d4ae0f1d84d21d284f67e.zip chromium_src-20f570c7cf8cd224676d4ae0f1d84d21d284f67e.tar.gz chromium_src-20f570c7cf8cd224676d4ae0f1d84d21d284f67e.tar.bz2 |
Hide ChromeDnsCertProvenanceChecker behind a factory.
Directly calling NSS code from a .cc file which is linked into both
Chrome and Chrome Frame causes a bad reference to libnspr.dll to be
emitted on Windows. wtc informs me that the `solution' to this is to
break the code up so that there's no direct chain from common code to
NSS code.
This change puts ChromeDnsCertProvenanceChecker into its own file and
adds a factory for it. The factory is modeled after the SSLClientSocket
factory in net/socket (which was added for the some of the same
reasons).
BUG=none
TEST=compiles on Chrome Frame builders.
http://codereview.chromium.org/5260001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_url_request_context.cc')
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.cc | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 4ec3939..e5c1c92 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -16,6 +16,7 @@ #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" @@ -33,7 +34,6 @@ #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,47 +224,6 @@ 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 // ---------------------------------------------------------------------------- @@ -307,11 +266,9 @@ 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( - new ChromeDnsCertProvenanceChecker( - io_thread_globals->dnsrr_resolver.get(), - context)); */ + CreateDnsCertProvenanceChecker(io_thread_globals->dnsrr_resolver.get(), + context)); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |