diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-21 06:13:49 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-21 06:13:49 +0000 |
commit | 1684c609b8b60ddbd9161c42ded842dd1f62a667 (patch) | |
tree | e2ad717655f6230bd4347800fb4d19f203838c25 /chrome/browser/net/chrome_url_request_context.cc | |
parent | dd54818d366e7050298af022a8c913c2262ca64a (diff) | |
download | chromium_src-1684c609b8b60ddbd9161c42ded842dd1f62a667.zip chromium_src-1684c609b8b60ddbd9161c42ded842dd1f62a667.tar.gz chromium_src-1684c609b8b60ddbd9161c42ded842dd1f62a667.tar.bz2 |
Revert 59972 (chromium os leaks) - Reland r59511: Eagerly set the IO loop used for OCSP.
ChromeOS will create a special Profile for login. Previously, OCSP initialization was done for the "default" ChromeURLRequestContext for each Profile. Since we can have multiple profiles, this causes the initialization (and uninitialization) to happen multiple times, which causes problems for OCSP since we use statics. The solution is to identify the "main" Profile. We create said Profile in BrowserMain. I add an "is_main_" variable to URLRequestContextGetter and URLRequestContext, so that only the "main" URLRequestContext will initialize OCSP.
Other than minor plumbing of "is_main_", this changelist is identical to r59511.
BUG=55940
TEST=Startup ChromeOS's Chrome. Should not crash on startup.
Review URL: http://codereview.chromium.org/3470001
TBR=willchan@chromium.org
Review URL: http://codereview.chromium.org/3468005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60025 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 | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 9237928..f14958f 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -313,6 +313,11 @@ ChromeURLRequestContext* FactoryForOriginal::Create() { appcache_service_->set_request_context(context); +#if defined(USE_NSS) + // TODO(ukai): find a better way to set the URLRequestContext for OCSP. + net::SetURLRequestContextForOCSP(context); +#endif + context->set_net_log(io_thread_globals->net_log.get()); return context; } @@ -552,14 +557,6 @@ URLRequestContext* ChromeURLRequestContextGetter::GetURLRequestContext() { if (!url_request_context_) { DCHECK(factory_.get()); url_request_context_ = factory_->Create(); - if (is_main()) { - url_request_context_->set_is_main(true); -#if defined(USE_NSS) - // TODO(ukai): find a better way to set the URLRequestContext for OCSP. - net::SetURLRequestContextForOCSP(url_request_context_); -#endif - } - factory_.reset(); } @@ -774,8 +771,7 @@ ChromeURLRequestContext::~ChromeURLRequestContext() { } #if defined(USE_NSS) - if (is_main()) { - DCHECK_EQ(this, net::GetURLRequestContextForOCSP()); + if (this == net::GetURLRequestContextForOCSP()) { // We are releasing the URLRequestContext used by OCSP handlers. net::SetURLRequestContextForOCSP(NULL); } |