From b92c77b16690690325be3d8ec045838b894eb333 Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Tue, 20 Oct 2009 00:59:16 +0000 Subject: Remove some unnecessary manual AddRef/Release. These aren't needed since NewRunnableMethod() already holds a reference, ensuring it can't be deleted while tasks are outstanding. BUG=none. TEST=continue to pass existing unit tests, especially when run under valgrind. Review URL: http://codereview.chromium.org/269037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29485 0039d316-1c4b-4281-b951-d872f2087c98 --- net/proxy/single_threaded_proxy_resolver.cc | 9 --------- 1 file changed, 9 deletions(-) (limited to 'net/proxy/single_threaded_proxy_resolver.cc') diff --git a/net/proxy/single_threaded_proxy_resolver.cc b/net/proxy/single_threaded_proxy_resolver.cc index af8d7bf..02afcfc 100644 --- a/net/proxy/single_threaded_proxy_resolver.cc +++ b/net/proxy/single_threaded_proxy_resolver.cc @@ -44,9 +44,6 @@ class SingleThreadedProxyResolver::SetPacScriptTask // Start the SetPacScript request on the worker thread. void Start() { - // TODO(eroman): Are these manual AddRef / Release necessary? - AddRef(); // balanced in RequestComplete - coordinator_->thread()->message_loop()->PostTask( FROM_HERE, NewRunnableMethod(this, &SetPacScriptTask::DoRequest, coordinator_->resolver_.get())); @@ -82,8 +79,6 @@ class SingleThreadedProxyResolver::SetPacScriptTask coordinator_->RemoveOutstandingSetPacScriptTask(this); callback->Run(result_code); } - - Release(); // Balances the AddRef in Start. } // Must only be used on the "origin" thread. @@ -122,7 +117,6 @@ class SingleThreadedProxyResolver::Job // Start the resolve proxy request on the worker thread. void Start() { is_started_ = true; - AddRef(); // balanced in QueryComplete coordinator_->thread()->message_loop()->PostTask( FROM_HERE, NewRunnableMethod(this, &Job::DoQuery, @@ -175,9 +169,6 @@ class SingleThreadedProxyResolver::Job if (!was_cancelled()) coordinator_->RemoveFrontOfJobsQueueAndStartNext(this); } - - Release(); // Balances the AddRef in Start. We may get deleted after - // we return. } // Must only be used on the "origin" thread. -- cgit v1.1