summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-11 03:27:09 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-11 03:27:09 +0000
commitef2bf421b04de3134cd7c02aac40a5565ef24dd9 (patch)
tree5bf90cca0bd015c23e843614ebf2e9f99cb8cd99 /webkit/tools
parent280e9b5d4b2fb0fe14824e526521710a658bce56 (diff)
downloadchromium_src-ef2bf421b04de3134cd7c02aac40a5565ef24dd9.zip
chromium_src-ef2bf421b04de3134cd7c02aac40a5565ef24dd9.tar.gz
chromium_src-ef2bf421b04de3134cd7c02aac40a5565ef24dd9.tar.bz2
Stop refcounting URLRequestContext.
While doing so, fix a few issues with the code like ordering of URLRequestContext to ensure correct destruction order. Also fix const correctness in some places. BUG=58859 TEST=none TBR=willchan Review URL: https://chromiumcodereview.appspot.com/10299002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc4
-rw-r--r--webkit/tools/test_shell/simple_socket_stream_bridge.cc7
-rw-r--r--webkit/tools/test_shell/test_shell_request_context.h6
3 files changed, 6 insertions, 11 deletions
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 074580d..450cbee 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -217,8 +217,6 @@ class IOThread : public base::Thread {
g_request_context = new TestShellRequestContext();
}
- g_request_context->AddRef();
-
g_network_delegate = new TestShellNetworkDelegate();
g_request_context->set_network_delegate(g_network_delegate);
@@ -241,7 +239,7 @@ class IOThread : public base::Thread {
if (g_request_context) {
g_request_context->set_network_delegate(NULL);
- g_request_context->Release();
+ delete g_request_context;
g_request_context = NULL;
}
diff --git a/webkit/tools/test_shell/simple_socket_stream_bridge.cc b/webkit/tools/test_shell/simple_socket_stream_bridge.cc
index 0d52ea2..05c9e74d 100644
--- a/webkit/tools/test_shell/simple_socket_stream_bridge.cc
+++ b/webkit/tools/test_shell/simple_socket_stream_bridge.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -223,14 +223,11 @@ void WebSocketStreamHandleBridgeImpl::DoOnClose() {
void SimpleSocketStreamBridge::InitializeOnIOThread(
net::URLRequestContext* request_context) {
g_io_thread = MessageLoop::current();
- if ((g_request_context = request_context))
- g_request_context->AddRef();
+ g_request_context = request_context;
}
void SimpleSocketStreamBridge::Cleanup() {
g_io_thread = NULL;
- if (g_request_context)
- g_request_context->Release();
g_request_context = NULL;
}
diff --git a/webkit/tools/test_shell/test_shell_request_context.h b/webkit/tools/test_shell/test_shell_request_context.h
index 0eb29cf..946248f 100644
--- a/webkit/tools/test_shell/test_shell_request_context.h
+++ b/webkit/tools/test_shell/test_shell_request_context.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -32,6 +32,8 @@ class TestShellRequestContext : public net::URLRequestContext {
net::HttpCache::Mode cache_mode,
bool no_proxy);
+ virtual ~TestShellRequestContext();
+
virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE;
webkit_blob::BlobStorageController* blob_storage_controller() const {
@@ -43,8 +45,6 @@ class TestShellRequestContext : public net::URLRequestContext {
}
private:
- virtual ~TestShellRequestContext();
-
void Init(const FilePath& cache_path, net::HttpCache::Mode cache_mode,
bool no_proxy);