summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-10 04:52:20 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-10 04:52:20 +0000
commit945a25941ed4de145a5041cccbe5908c92aa0c3b (patch)
treed2682973318368507b05183ef78fdc7e3c205b22 /chrome/browser
parentbd8127e04c9cb0ec1a74408b6a10dc8d19f937e6 (diff)
downloadchromium_src-945a25941ed4de145a5041cccbe5908c92aa0c3b.zip
chromium_src-945a25941ed4de145a5041cccbe5908c92aa0c3b.tar.gz
chromium_src-945a25941ed4de145a5041cccbe5908c92aa0c3b.tar.bz2
Test change to fix a leak. Will revert after getting in a run on ChromiumOS valgrind bots.
Revert "Revert 60739 (still leaks on ChromiumOS!) - Reland r59972: Eagerly set the IO loop used for OCSP." Review URL: http://codereview.chromium.org/3681003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/io_thread.cc12
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc16
-rw-r--r--chrome/browser/net/chrome_url_request_context.h1
-rw-r--r--chrome/browser/profile_impl.cc1
4 files changed, 23 insertions, 7 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index b76e895..8c17fc65 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -26,6 +26,10 @@
#include "net/base/net_util.h"
#include "net/http/http_auth_filter.h"
#include "net/http/http_auth_handler_factory.h"
+#if defined(USE_NSS)
+#include "net/ocsp/nss_ocsp.h"
+#endif // defined(USE_NSS)
+#include "net/proxy/proxy_script_fetcher.h"
namespace {
@@ -159,6 +163,12 @@ void IOThread::ChangedToOnTheRecord() {
void IOThread::Init() {
BrowserProcessSubThread::Init();
+ DCHECK_EQ(MessageLoop::TYPE_IO, message_loop()->type());
+
+#if defined(USE_NSS)
+ net::SetMessageLoopForOCSP();
+#endif // defined(USE_NSS)
+
DCHECK(!globals_);
globals_ = new Globals;
@@ -206,6 +216,8 @@ void IOThread::CleanUp() {
globals_->host_resolver.get()->GetAsHostResolverImpl()->Shutdown();
}
+ net::EnsureNoProxyScriptFetches();
+
// We will delete the NetLog as part of CleanUpAfterMessageLoopDestruction()
// in case any of the message loop destruction observers try to access it.
deferred_net_log_to_delete_.reset(globals_->net_log.release());
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 9f053f3..28f7621 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -314,11 +314,6 @@ 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;
}
@@ -559,6 +554,14 @@ 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();
}
@@ -756,7 +759,8 @@ ChromeURLRequestContext::~ChromeURLRequestContext() {
}
#if defined(USE_NSS)
- if (this == net::GetURLRequestContextForOCSP()) {
+ if (is_main()) {
+ DCHECK_EQ(this, net::GetURLRequestContextForOCSP());
// We are releasing the URLRequestContext used by OCSP handlers.
net::SetURLRequestContextForOCSP(NULL);
}
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index 183ad4a..a580282 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -211,7 +211,6 @@ class ChromeURLRequestContext : public URLRequestContext {
bool is_off_the_record_;
private:
-
DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext);
};
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index 899e068daa..4ef4363 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -713,6 +713,7 @@ URLRequestContextGetter* ProfileImpl::GetRequestContext() {
// created first.
if (!default_request_context_) {
default_request_context_ = request_context_;
+ request_context_->set_is_main(true);
// TODO(eroman): this isn't terribly useful anymore now that the
// URLRequestContext is constructed by the IO thread...
NotificationService::current()->Notify(