diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-16 22:18:55 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-16 22:18:55 +0000 |
commit | cfc06f12ec93799d758164c22b4e53125eaade8d (patch) | |
tree | 720f317999df1744da54485efabc2d559f8f4d75 /chrome | |
parent | 370368ecdb0ba2b15caf52aa525385642fd4d4cf (diff) | |
download | chromium_src-cfc06f12ec93799d758164c22b4e53125eaade8d.zip chromium_src-cfc06f12ec93799d758164c22b4e53125eaade8d.tar.gz chromium_src-cfc06f12ec93799d758164c22b4e53125eaade8d.tar.bz2 |
Move NULLing of OCSP context from UI thread to IO thread, to avoid possible races.
Review URL: http://codereview.chromium.org/391062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.cc | 7 | ||||
-rw-r--r-- | chrome/browser/profile.cc | 9 |
2 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index c75243c..f9ae5e4 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -646,6 +646,13 @@ ChromeURLRequestContext::~ChromeURLRequestContext() { if (appcache_service_.get() && appcache_service_->request_context() == this) appcache_service_->set_request_context(NULL); +#if defined(OS_LINUX) + if (this == net::GetURLRequestContextForOCSP()) { + // We are releasing the URLRequestContext used by OCSP handlers. + net::SetURLRequestContextForOCSP(NULL); + } +#endif + NotificationService::current()->Notify( NotificationType::URL_REQUEST_CONTEXT_RELEASED, Source<URLRequestContext>(this), diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 2b6eb4e..75ba5c0 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -58,7 +58,6 @@ #include "webkit/database/database_tracker.h" #if defined(OS_LINUX) -#include "net/ocsp/nss_ocsp.h" #include "chrome/browser/gtk/gtk_theme_provider.h" #endif @@ -776,14 +775,8 @@ ProfileImpl::~ProfileImpl() { #endif DeleteSpellCheckerImpl(false); - if (default_request_context_ == request_context_) { -#if defined(OS_LINUX) - // We use default_request_context_ for OCSP. - // Release URLRequestContext used in OCSP handlers. - net::SetURLRequestContextForOCSP(NULL); -#endif + if (default_request_context_ == request_context_) default_request_context_ = NULL; - } CleanupRequestContext(request_context_); CleanupRequestContext(media_request_context_); |