summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:34:24 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:34:24 +0000
commit5389bc7ba5360633af04b9cf15497d56ce640ead (patch)
tree4518c05f3bad18a5b2f4739fc1a1c187651f9799 /net/proxy
parent4070a6b1efcb2dbea12508a0b912cfa3bc86f47e (diff)
downloadchromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.zip
chromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.tar.gz
chromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.tar.bz2
Second patch in making destructors of refcounted objects private.
BUG=26749 Review URL: http://codereview.chromium.org/368001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/mock_proxy_resolver.h4
-rw-r--r--net/proxy/proxy_config_service_linux.h4
-rw-r--r--net/proxy/proxy_resolver_js_bindings.cc4
-rw-r--r--net/proxy/proxy_resolver_js_bindings_unittest.cc2
-rw-r--r--net/proxy/proxy_script_fetcher_unittest.cc2
-rw-r--r--net/proxy/proxy_service.cc4
-rw-r--r--net/proxy/proxy_service.h10
-rw-r--r--net/proxy/single_threaded_proxy_resolver.cc11
8 files changed, 39 insertions, 2 deletions
diff --git a/net/proxy/mock_proxy_resolver.h b/net/proxy/mock_proxy_resolver.h
index 4c56124..67eb925 100644
--- a/net/proxy/mock_proxy_resolver.h
+++ b/net/proxy/mock_proxy_resolver.h
@@ -46,6 +46,10 @@ class MockAsyncProxyResolverBase : public ProxyResolver {
}
private:
+ friend class base::RefCounted<Request>;
+
+ ~Request() {}
+
MockAsyncProxyResolverBase* resolver_;
const GURL url_;
ProxyInfo* results_;
diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h
index ef6519a..a55ba35 100644
--- a/net/proxy/proxy_config_service_linux.h
+++ b/net/proxy/proxy_config_service_linux.h
@@ -139,6 +139,10 @@ class ProxyConfigServiceLinux : public ProxyConfigService {
void OnDestroy();
private:
+ friend class base::RefCountedThreadSafe<Delegate>;
+
+ ~Delegate() {}
+
// Obtains an environment variable's value. Parses a proxy server
// specification from it and puts it in result. Returns true if the
// requested variable is defined and the value valid.
diff --git a/net/proxy/proxy_resolver_js_bindings.cc b/net/proxy/proxy_resolver_js_bindings.cc
index 077e5c6..1b01651 100644
--- a/net/proxy/proxy_resolver_js_bindings.cc
+++ b/net/proxy/proxy_resolver_js_bindings.cc
@@ -61,6 +61,10 @@ class SyncHostResolverBridge
}
private:
+ friend class base::RefCountedThreadSafe<SyncHostResolverBridge>;
+
+ ~SyncHostResolverBridge() {}
+
// Called on host_resolver_loop_.
void StartResolve(const HostResolver::RequestInfo& info,
net::AddressList* addresses) {
diff --git a/net/proxy/proxy_resolver_js_bindings_unittest.cc b/net/proxy/proxy_resolver_js_bindings_unittest.cc
index 4e0f6a6..1a36d3d 100644
--- a/net/proxy/proxy_resolver_js_bindings_unittest.cc
+++ b/net/proxy/proxy_resolver_js_bindings_unittest.cc
@@ -48,6 +48,8 @@ class MockHostResolverWithMultipleResults : public HostResolver {
virtual void Shutdown() {}
private:
+ ~MockHostResolverWithMultipleResults() {}
+
// Resolves an IP literal to an address list.
AddressList ResolveIPLiteral(const char* ip_literal) {
AddressList result;
diff --git a/net/proxy/proxy_script_fetcher_unittest.cc b/net/proxy/proxy_script_fetcher_unittest.cc
index ad28c10..ff78e33 100644
--- a/net/proxy/proxy_script_fetcher_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_unittest.cc
@@ -41,6 +41,8 @@ class RequestContext : public URLRequestContext {
host_resolver_, proxy_service_, ssl_config_service_),
disk_cache::CreateInMemoryCacheBackend(0));
}
+
+ private:
~RequestContext() {
delete http_transaction_factory_;
}
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index c74f6de..91a6133 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -170,6 +170,10 @@ class ProxyService::PacRequest
LoadLog* load_log() const { return load_log_; }
private:
+ friend class base::RefCounted<ProxyService::PacRequest>;
+
+ ~PacRequest() {}
+
// Callback for when the ProxyResolver request has completed.
void QueryComplete(int result_code) {
result_code = QueryDidComplete(result_code);
diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h
index d7ed7ab..194ad7b 100644
--- a/net/proxy/proxy_service.h
+++ b/net/proxy/proxy_service.h
@@ -36,8 +36,6 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService> {
// The instance takes ownership of |config_service| and |resolver|.
ProxyService(ProxyConfigService* config_service, ProxyResolver* resolver);
- ~ProxyService();
-
// Used internally to handle PAC queries.
// TODO(eroman): consider naming this simply "Request".
class PacRequest;
@@ -154,16 +152,20 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService> {
MessageLoop* io_loop, MessageLoop* file_loop);
private:
+ friend class base::RefCountedThreadSafe<ProxyService>;
FRIEND_TEST(ProxyServiceTest, IsLocalName);
FRIEND_TEST(ProxyServiceTest, UpdateConfigAfterFailedAutodetect);
FRIEND_TEST(ProxyServiceTest, UpdateConfigFromPACToDirect);
friend class PacRequest;
+
// TODO(eroman): change this to a std::set. Note that this requires updating
// some tests in proxy_service_unittest.cc such as:
// ProxyServiceTest.InitialPACScriptDownload
// which expects requests to finish in the order they were added.
typedef std::vector<scoped_refptr<PacRequest> > PendingRequests;
+ ~ProxyService();
+
// Creates a proxy resolver appropriate for this platform that doesn't rely
// on V8.
static ProxyResolver* CreateNonV8ProxyResolver();
@@ -283,6 +285,10 @@ class SyncProxyServiceHelper
ProxyInfo* proxy_info, LoadLog* load_log);
private:
+ friend class base::RefCountedThreadSafe<SyncProxyServiceHelper>;
+
+ ~SyncProxyServiceHelper() {}
+
void StartAsyncResolve(const GURL& url, LoadLog* load_log);
void StartAsyncReconsider(const GURL& url, LoadLog* load_log);
diff --git a/net/proxy/single_threaded_proxy_resolver.cc b/net/proxy/single_threaded_proxy_resolver.cc
index ab13fa1..ad5fdba 100644
--- a/net/proxy/single_threaded_proxy_resolver.cc
+++ b/net/proxy/single_threaded_proxy_resolver.cc
@@ -18,6 +18,8 @@ class PurgeMemoryTask : public base::RefCountedThreadSafe<PurgeMemoryTask> {
explicit PurgeMemoryTask(ProxyResolver* resolver) : resolver_(resolver) {}
void PurgeMemory() { resolver_->PurgeMemory(); }
private:
+ friend class base::RefCountedThreadSafe<PurgeMemoryTask>;
+ ~PurgeMemoryTask() {}
ProxyResolver* resolver_;
};
@@ -60,6 +62,11 @@ class SingleThreadedProxyResolver::SetPacScriptTask
bool was_cancelled() const { return callback_ == NULL; }
private:
+ friend class base::RefCountedThreadSafe<
+ SingleThreadedProxyResolver::SetPacScriptTask>;
+
+ ~SetPacScriptTask() {}
+
// Runs on the worker thread.
void DoRequest(ProxyResolver* resolver) {
int rv = resolver->expects_pac_bytes() ?
@@ -137,6 +144,10 @@ class SingleThreadedProxyResolver::Job
bool was_cancelled() const { return callback_ == NULL; }
private:
+ friend class base::RefCountedThreadSafe<SingleThreadedProxyResolver::Job>;
+
+ ~Job() {}
+
// Runs on the worker thread.
void DoQuery(ProxyResolver* resolver) {
LoadLog* worker_log = new LoadLog;