Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Unified Diff: net/proxy/proxy_script_decider_unittest.cc

Issue 10407060: RefCounted types should not have public destructors, net/ redux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/dhcp_proxy_script_fetcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_script_decider_unittest.cc
diff --git a/net/proxy/proxy_script_decider_unittest.cc b/net/proxy/proxy_script_decider_unittest.cc
index 03bda5212ef2c75e1379768667e8e8a26f79764c..cece80585e53aaefbf054ee40c8a9cbf14edc628 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);
« no previous file with comments | « net/proxy/dhcp_proxy_script_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698