summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 20:41:10 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-28 20:41:10 +0000
commitbe952c3ca6d93968409b246c9439a7d8c2a06bba (patch)
tree501d38ada79c1fddf10f65fe6c88b27a3df4cb1d /net/base
parent86c008e8a7da9c00c5a676eb201ba5d0c976748e (diff)
downloadchromium_src-be952c3ca6d93968409b246c9439a7d8c2a06bba.zip
chromium_src-be952c3ca6d93968409b246c9439a7d8c2a06bba.tar.gz
chromium_src-be952c3ca6d93968409b246c9439a7d8c2a06bba.tar.bz2
Fix a ton of compiler warnings.
Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/directory_lister.cc6
-rw-r--r--net/base/directory_lister.h11
-rw-r--r--net/base/host_cache_unittest.cc22
-rw-r--r--net/base/ssl_client_auth_cache_unittest.cc6
4 files changed, 24 insertions, 21 deletions
diff --git a/net/base/directory_lister.cc b/net/base/directory_lister.cc
index 616fc82..69e301e 100644
--- a/net/base/directory_lister.cc
+++ b/net/base/directory_lister.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -37,7 +37,7 @@ DirectoryLister::DirectoryLister(const FilePath& dir,
: dir_(dir),
delegate_(delegate),
message_loop_(NULL),
- thread_(NULL),
+ thread_(0),
canceled_(false) {
DCHECK(!dir.value().empty());
}
@@ -70,7 +70,7 @@ void DirectoryLister::Cancel() {
if (thread_) {
PlatformThread::Join(thread_);
- thread_ = NULL;
+ thread_ = 0;
}
}
diff --git a/net/base/directory_lister.h b/net/base/directory_lister.h
index cb98da6..58c2cd3 100644
--- a/net/base/directory_lister.h
+++ b/net/base/directory_lister.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
-#ifndef NET_BASE_DIRECTORY_LISTER_H__
-#define NET_BASE_DIRECTORY_LISTER_H__
+#ifndef NET_BASE_DIRECTORY_LISTER_H_
+#define NET_BASE_DIRECTORY_LISTER_H_
#include <string>
@@ -32,6 +32,9 @@ class DirectoryLister : public base::RefCountedThreadSafe<DirectoryLister>,
virtual void OnListFile(
const file_util::FileEnumerator::FindInfo& data) = 0;
virtual void OnListDone(int error) = 0;
+
+ protected:
+ ~DirectoryListerDelegate() {}
};
DirectoryLister(const FilePath& dir, DirectoryListerDelegate* delegate);
@@ -68,4 +71,4 @@ class DirectoryLister : public base::RefCountedThreadSafe<DirectoryLister>,
} // namespace net
-#endif // NET_BASE_DIRECTORY_LISTER_H__
+#endif // NET_BASE_DIRECTORY_LISTER_H_
diff --git a/net/base/host_cache_unittest.cc b/net/base/host_cache_unittest.cc
index fe01e20..bfb1860 100644
--- a/net/base/host_cache_unittest.cc
+++ b/net/base/host_cache_unittest.cc
@@ -28,7 +28,7 @@ TEST(HostCacheTest, Basic) {
EXPECT_EQ(0U, cache.size());
// Add an entry for "foobar.com" at t=0.
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks()));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks()));
cache.Set("foobar.com", OK, AddressList(), now);
entry1 = cache.Lookup("foobar.com", base::TimeTicks());
EXPECT_FALSE(NULL == entry1);
@@ -38,7 +38,7 @@ TEST(HostCacheTest, Basic) {
now += base::TimeDelta::FromSeconds(5);
// Add an entry for "foobar2.com" at t=5.
- EXPECT_EQ(NULL, cache.Lookup("foobar2.com", base::TimeTicks()));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar2.com", base::TimeTicks()));
cache.Set("foobar2.com", OK, AddressList(), now);
entry2 = cache.Lookup("foobar2.com", base::TimeTicks());
EXPECT_FALSE(NULL == entry1);
@@ -54,7 +54,7 @@ TEST(HostCacheTest, Basic) {
// Advance to t=10; entry1 is now expired.
now += base::TimeDelta::FromSeconds(1);
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", now));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now));
EXPECT_EQ(entry2, cache.Lookup("foobar2.com", now));
// Update entry1, so it is no longer expired.
@@ -70,8 +70,8 @@ TEST(HostCacheTest, Basic) {
// Advance to t=20; both entries are now expired.
now += base::TimeDelta::FromSeconds(10);
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", now));
- EXPECT_EQ(NULL, cache.Lookup("foobar2.com", now));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar2.com", now));
}
// Try caching entries for a failed resolve attempt.
@@ -81,19 +81,19 @@ TEST(HostCacheTest, NegativeEntry) {
// Set t=0.
base::TimeTicks now;
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks()));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks()));
cache.Set("foobar.com", ERR_NAME_NOT_RESOLVED, AddressList(), now);
EXPECT_EQ(1U, cache.size());
// We disallow use of negative entries.
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", now));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now));
// Now overwrite with a valid entry, and then overwrite with negative entry
// again -- the valid entry should be kicked out.
cache.Set("foobar.com", OK, AddressList(), now);
EXPECT_FALSE(NULL == cache.Lookup("foobar.com", now));
cache.Set("foobar.com", ERR_NAME_NOT_RESOLVED, AddressList(), now);
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", now));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", now));
}
TEST(HostCacheTest, Compact) {
@@ -185,7 +185,7 @@ TEST(HostCacheTest, SetWithCompact) {
// Adding the fourth entry will cause "expired" to be evicted.
cache.Set("host3", OK, AddressList(), now);
EXPECT_EQ(3U, cache.size());
- EXPECT_EQ(NULL, cache.Lookup("expired", now));
+ EXPECT_TRUE(NULL == cache.Lookup("expired", now));
EXPECT_FALSE(NULL == cache.Lookup("host1", now));
EXPECT_FALSE(NULL == cache.Lookup("host2", now));
EXPECT_FALSE(NULL == cache.Lookup("host3", now));
@@ -208,9 +208,9 @@ TEST(HostCacheTest, NoCache) {
base::TimeTicks now;
// Lookup and Set should have no effect.
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks()));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks()));
cache.Set("foobar.com", OK, AddressList(), now);
- EXPECT_EQ(NULL, cache.Lookup("foobar.com", base::TimeTicks()));
+ EXPECT_TRUE(NULL == cache.Lookup("foobar.com", base::TimeTicks()));
EXPECT_EQ(0U, cache.size());
}
diff --git a/net/base/ssl_client_auth_cache_unittest.cc b/net/base/ssl_client_auth_cache_unittest.cc
index 33eb25f..c0697fc 100644
--- a/net/base/ssl_client_auth_cache_unittest.cc
+++ b/net/base/ssl_client_auth_cache_unittest.cc
@@ -28,7 +28,7 @@ TEST(SSLClientAuthCacheTest, LookupAddRemove) {
new X509Certificate("foo3", "CA", start_date, expiration_date));
// Lookup non-existent client certificate.
- EXPECT_EQ(NULL, cache.Lookup(server1));
+ EXPECT_TRUE(NULL == cache.Lookup(server1));
// Add client certificate for server1.
cache.Add(server1, cert1.get());
@@ -46,12 +46,12 @@ TEST(SSLClientAuthCacheTest, LookupAddRemove) {
// Remove client certificate of server1.
cache.Remove(server1);
- EXPECT_EQ(NULL, cache.Lookup(server1));
+ EXPECT_TRUE(NULL == cache.Lookup(server1));
EXPECT_EQ(cert2.get(), cache.Lookup(server2));
// Remove non-existent client certificate.
cache.Remove(server1);
- EXPECT_EQ(NULL, cache.Lookup(server1));
+ EXPECT_TRUE(NULL == cache.Lookup(server1));
EXPECT_EQ(cert2.get(), cache.Lookup(server2));
}