summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_script_decider_unittest.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-28 22:19:05 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-28 22:19:05 +0000
commitd1601e59e588003b7b7eeecd77a40ae55a3bc5ad (patch)
treed67ee2561c7e3f8cdb862bd82c677ebab2b7be16 /net/proxy/proxy_script_decider_unittest.cc
parent263ecf8e50aeba1fb670b97737f1976fb1f10339 (diff)
downloadchromium_src-d1601e59e588003b7b7eeecd77a40ae55a3bc5ad.zip
chromium_src-d1601e59e588003b7b7eeecd77a40ae55a3bc5ad.tar.gz
chromium_src-d1601e59e588003b7b7eeecd77a40ae55a3bc5ad.tar.bz2
RefCounted types should not have public destructors, net/ redux
BUG=123295 TEST=it compiles Review URL: https://chromiumcodereview.appspot.com/10407060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_script_decider_unittest.cc')
-rw-r--r--net/proxy/proxy_script_decider_unittest.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/proxy/proxy_script_decider_unittest.cc b/net/proxy/proxy_script_decider_unittest.cc
index 03bda52..cece805 100644
--- a/net/proxy/proxy_script_decider_unittest.cc
+++ b/net/proxy/proxy_script_decider_unittest.cc
@@ -5,6 +5,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/time.h"
@@ -532,15 +533,16 @@ TEST(ProxyScriptDeciderTest, AutodetectDhcpFailParse) {
class AsyncFailDhcpFetcher
: public DhcpProxyScriptFetcher,
- public base::RefCountedThreadSafe<AsyncFailDhcpFetcher> {
+ public base::SupportsWeakPtr<AsyncFailDhcpFetcher> {
public:
AsyncFailDhcpFetcher() {}
+ ~AsyncFailDhcpFetcher() {}
int Fetch(string16* utf16_text, const CompletionCallback& callback) OVERRIDE {
callback_ = callback;
MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(&AsyncFailDhcpFetcher::CallbackWithFailure, this));
+ base::Bind(&AsyncFailDhcpFetcher::CallbackWithFailure, AsWeakPtr()));
return ERR_IO_PENDING;
}
@@ -558,9 +560,6 @@ class AsyncFailDhcpFetcher
}
private:
- friend class base::RefCountedThreadSafe<AsyncFailDhcpFetcher>;
- ~AsyncFailDhcpFetcher() {}
-
GURL dummy_gurl_;
CompletionCallback callback_;
};
@@ -573,7 +572,7 @@ TEST(ProxyScriptDeciderTest, DhcpCancelledByDestructor) {
Rules rules;
RuleBasedProxyScriptFetcher fetcher(&rules);
- scoped_refptr<AsyncFailDhcpFetcher> dhcp_fetcher(new AsyncFailDhcpFetcher());
+ scoped_ptr<AsyncFailDhcpFetcher> dhcp_fetcher(new AsyncFailDhcpFetcher());
ProxyConfig config;
config.set_auto_detect(true);