summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-27 21:37:12 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-27 21:37:12 +0000
commit6104ea5d0b3eb19a923ae94a5f7fcae8e0e091e2 (patch)
tree93a11c09778f638718cd19be3249e54defd1f90f /webkit
parent418e953e7285de2f29f6523c741cbca951f26562 (diff)
downloadchromium_src-6104ea5d0b3eb19a923ae94a5f7fcae8e0e091e2.zip
chromium_src-6104ea5d0b3eb19a923ae94a5f7fcae8e0e091e2.tar.gz
chromium_src-6104ea5d0b3eb19a923ae94a5f7fcae8e0e091e2.tar.bz2
Stop refcounting ProxyService.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6873096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.cc35
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.h2
2 files changed, 19 insertions, 18 deletions
diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc
index 7840afa..932d8c6 100644
--- a/webkit/tools/test_shell/test_shell_request_context.cc
+++ b/webkit/tools/test_shell/test_shell_request_context.cc
@@ -6,6 +6,7 @@
#include "build/build_config.h"
+#include "base/compiler_specific.h"
#include "base/file_path.h"
#include "net/base/cert_verifier.h"
#include "net/base/cookie_monster.h"
@@ -25,14 +26,16 @@
#include "webkit/tools/test_shell/simple_file_system.h"
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
-TestShellRequestContext::TestShellRequestContext() {
+TestShellRequestContext::TestShellRequestContext()
+ : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
Init(FilePath(), net::HttpCache::NORMAL, false);
}
TestShellRequestContext::TestShellRequestContext(
const FilePath& cache_path,
net::HttpCache::Mode cache_mode,
- bool no_proxy) {
+ bool no_proxy)
+ : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
Init(cache_path, cache_mode, no_proxy);
}
@@ -40,8 +43,8 @@ void TestShellRequestContext::Init(
const FilePath& cache_path,
net::HttpCache::Mode cache_mode,
bool no_proxy) {
- set_cookie_store(new net::CookieMonster(NULL, NULL));
- set_cookie_policy(new net::StaticCookiePolicy());
+ storage_.set_cookie_store(new net::CookieMonster(NULL, NULL));
+ storage_.set_cookie_policy(new net::StaticCookiePolicy());
// hard-code A-L and A-C for test shells
set_accept_language("en-us,en");
@@ -64,16 +67,17 @@ void TestShellRequestContext::Init(
net::ProxyService::CreateSystemProxyConfigService(
MessageLoop::current(), NULL));
#endif
- set_host_resolver(
+ storage_.set_host_resolver(
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
NULL));
- set_cert_verifier(new net::CertVerifier);
- set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver(
+ storage_.set_cert_verifier(new net::CertVerifier);
+ storage_.set_proxy_service(net::ProxyService::CreateUsingSystemProxyResolver(
proxy_config_service.release(), 0, NULL));
- set_ssl_config_service(net::SSLConfigService::CreateSystemSSLConfigService());
+ storage_.set_ssl_config_service(
+ net::SSLConfigService::CreateSystemSSLConfigService());
- set_http_auth_handler_factory(net::HttpAuthHandlerFactory::CreateDefault(
- host_resolver()));
+ storage_.set_http_auth_handler_factory(
+ net::HttpAuthHandlerFactory::CreateDefault(host_resolver()));
net::HttpCache::DefaultBackend* backend = new net::HttpCache::DefaultBackend(
cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE,
@@ -85,9 +89,10 @@ void TestShellRequestContext::Init(
http_auth_handler_factory(), NULL, NULL, backend);
cache->set_mode(cache_mode);
- set_http_transaction_factory(cache);
+ storage_.set_http_transaction_factory(cache);
- set_ftp_transaction_factory(new net::FtpNetworkLayer(host_resolver()));
+ storage_.set_ftp_transaction_factory(
+ new net::FtpNetworkLayer(host_resolver()));
blob_storage_controller_.reset(new webkit_blob::BlobStorageController());
file_system_context_ = static_cast<SimpleFileSystem*>(
@@ -95,12 +100,6 @@ void TestShellRequestContext::Init(
}
TestShellRequestContext::~TestShellRequestContext() {
- delete ftp_transaction_factory();
- delete http_transaction_factory();
- delete http_auth_handler_factory();
- delete cookie_policy();
- delete cert_verifier();
- delete host_resolver();
}
const std::string& TestShellRequestContext::GetUserAgent(
diff --git a/webkit/tools/test_shell/test_shell_request_context.h b/webkit/tools/test_shell/test_shell_request_context.h
index 0f6c4e2..cc74803 100644
--- a/webkit/tools/test_shell/test_shell_request_context.h
+++ b/webkit/tools/test_shell/test_shell_request_context.h
@@ -8,6 +8,7 @@
#include "base/threading/thread.h"
#include "net/http/http_cache.h"
#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_context_storage.h"
class FilePath;
@@ -47,6 +48,7 @@ class TestShellRequestContext : public net::URLRequestContext {
void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode,
bool no_proxy);
+ net::URLRequestContextStorage storage_;
scoped_ptr<webkit_blob::BlobStorageController> blob_storage_controller_;
scoped_refptr<fileapi::FileSystemContext> file_system_context_;
};