diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 20:06:30 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 20:06:30 +0000 |
commit | 20f0487a5b73e8071af2612150301b0942cbf0e2 (patch) | |
tree | ecee69b28f16712bdc1558ac0a015ac80095c761 /net | |
parent | 167b0dd17d5ed57ff293b6480ccaed706e0bc9cb (diff) | |
download | chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.zip chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.tar.gz chromium_src-20f0487a5b73e8071af2612150301b0942cbf0e2.tar.bz2 |
FBTF: Move ctors/dtors into implementation files. Adds ctors/dtors to non-POD structs.
Cuts ~2MB off our .a files (Debug, Linux). Also added the "virtual" keyword on
a whole bunch of virtual dtors that were missing it.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3522004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/ssl_client_auth_cache.cc | 4 | ||||
-rw-r--r-- | net/base/ssl_client_auth_cache.h | 4 | ||||
-rw-r--r-- | net/disk_cache/in_flight_backend_io.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/in_flight_backend_io.h | 2 | ||||
-rw-r--r-- | net/ftp/ftp_auth_cache.cc | 14 | ||||
-rw-r--r-- | net/ftp/ftp_auth_cache.h | 11 | ||||
-rw-r--r-- | net/http/http_auth_cache.cc | 9 | ||||
-rw-r--r-- | net/http/http_auth_cache.h | 5 | ||||
-rw-r--r-- | net/proxy/proxy_config_service_common_unittest.cc | 20 | ||||
-rw-r--r-- | net/proxy/proxy_config_service_common_unittest.h | 12 | ||||
-rw-r--r-- | net/proxy/proxy_list.cc | 7 | ||||
-rw-r--r-- | net/proxy/proxy_list.h | 6 | ||||
-rw-r--r-- | net/proxy/proxy_list_unittest.cc | 2 | ||||
-rw-r--r-- | net/proxy/proxy_service.cc | 2 | ||||
-rw-r--r-- | net/proxy/proxy_service.h | 4 | ||||
-rw-r--r-- | net/socket/client_socket_pool.cc | 4 | ||||
-rw-r--r-- | net/socket/client_socket_pool.h | 4 | ||||
-rw-r--r-- | net/socket/client_socket_pool_histograms.h | 4 | ||||
-rw-r--r-- | net/socket/socket_test_util.cc | 12 | ||||
-rw-r--r-- | net/socket/socket_test_util.h | 8 | ||||
-rw-r--r-- | net/socket/ssl_client_socket_pool.cc | 1 | ||||
-rw-r--r-- | net/socket/tcp_client_socket_pool.cc | 1 |
22 files changed, 105 insertions, 33 deletions
diff --git a/net/base/ssl_client_auth_cache.cc b/net/base/ssl_client_auth_cache.cc index b0deec9..d2f47cc 100644 --- a/net/base/ssl_client_auth_cache.cc +++ b/net/base/ssl_client_auth_cache.cc @@ -6,6 +6,10 @@ namespace net { +SSLClientAuthCache::SSLClientAuthCache() {} + +SSLClientAuthCache::~SSLClientAuthCache() {} + X509Certificate* SSLClientAuthCache::Lookup(const std::string& server) { AuthCacheMap::iterator iter = cache_.find(server); return (iter == cache_.end()) ? NULL : iter->second; diff --git a/net/base/ssl_client_auth_cache.h b/net/base/ssl_client_auth_cache.h index 3c8ed99..023480b 100644 --- a/net/base/ssl_client_auth_cache.h +++ b/net/base/ssl_client_auth_cache.h @@ -23,8 +23,8 @@ namespace net { // code to a template class. class SSLClientAuthCache { public: - SSLClientAuthCache() {} - ~SSLClientAuthCache() {} + SSLClientAuthCache(); + ~SSLClientAuthCache(); // Check if we have a client certificate for SSL server at |server|. // Returns the client certificate (if found) or NULL (if not found). diff --git a/net/disk_cache/in_flight_backend_io.cc b/net/disk_cache/in_flight_backend_io.cc index e400ac3..fe53829 100644 --- a/net/disk_cache/in_flight_backend_io.cc +++ b/net/disk_cache/in_flight_backend_io.cc @@ -181,6 +181,8 @@ void BackendIO::ReadyForSparseIO(EntryImpl* entry) { entry_ = entry; } +BackendIO::~BackendIO() {} + // Runs on the background thread. void BackendIO::ExecuteBackendOperation() { switch (operation_) { diff --git a/net/disk_cache/in_flight_backend_io.h b/net/disk_cache/in_flight_backend_io.h index 889fb20..5eba131 100644 --- a/net/disk_cache/in_flight_backend_io.h +++ b/net/disk_cache/in_flight_backend_io.h @@ -104,7 +104,7 @@ class BackendIO : public BackgroundIO { OP_IS_READY }; - ~BackendIO() {} + ~BackendIO(); void ExecuteBackendOperation(); void ExecuteEntryOperation(); diff --git a/net/ftp/ftp_auth_cache.cc b/net/ftp/ftp_auth_cache.cc index caa2b8a..a67c2e0 100644 --- a/net/ftp/ftp_auth_cache.cc +++ b/net/ftp/ftp_auth_cache.cc @@ -12,6 +12,20 @@ namespace net { // static const size_t FtpAuthCache::kMaxEntries = 10; +FtpAuthCache::Entry::Entry(const GURL& origin, + const string16& username, + const string16& password) + : origin(origin), + username(username), + password(password) { +} + +FtpAuthCache::Entry::~Entry() {} + +FtpAuthCache::FtpAuthCache() {} + +FtpAuthCache::~FtpAuthCache() {} + FtpAuthCache::Entry* FtpAuthCache::Lookup(const GURL& origin) { for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) { if (it->origin == origin) diff --git a/net/ftp/ftp_auth_cache.h b/net/ftp/ftp_auth_cache.h index 36156da..f935fe9 100644 --- a/net/ftp/ftp_auth_cache.h +++ b/net/ftp/ftp_auth_cache.h @@ -28,19 +28,16 @@ class FtpAuthCache { struct Entry { Entry(const GURL& origin, const string16& username, - const string16& password) - : origin(origin), - username(username), - password(password) { - } + const string16& password); + ~Entry(); const GURL origin; string16 username; string16 password; }; - FtpAuthCache() {} - ~FtpAuthCache() {} + FtpAuthCache(); + ~FtpAuthCache(); // Return Entry corresponding to given |origin| or NULL if not found. Entry* Lookup(const GURL& origin); diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc index 7423115..cc80861 100644 --- a/net/http/http_auth_cache.cc +++ b/net/http/http_auth_cache.cc @@ -59,6 +59,12 @@ struct IsEnclosedBy { namespace net { +HttpAuthCache::HttpAuthCache() { +} + +HttpAuthCache::~HttpAuthCache() { +} + // Performance: O(n), where n is the number of realm entries. HttpAuthCache::Entry* HttpAuthCache::Lookup(const GURL& origin, const std::string& realm, @@ -134,6 +140,9 @@ HttpAuthCache::Entry* HttpAuthCache::Add(const GURL& origin, return entry; } +HttpAuthCache::Entry::~Entry() { +} + HttpAuthCache::Entry::Entry() : nonce_count_(0) { } diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h index 764a563..707288c 100644 --- a/net/http/http_auth_cache.h +++ b/net/http/http_auth_cache.h @@ -28,6 +28,9 @@ class HttpAuthCache { public: class Entry; + HttpAuthCache(); + ~HttpAuthCache(); + // Find the realm entry on server |origin| for realm |realm| and // scheme |scheme|. // |origin| - the {scheme, host, port} of the server. @@ -140,6 +143,8 @@ class HttpAuthCache::Entry { void UpdateStaleChallenge(const std::string& auth_challenge); + ~Entry(); + private: friend class HttpAuthCache; FRIEND_TEST_ALL_PREFIXES(HttpAuthCacheTest, AddPath); diff --git a/net/proxy/proxy_config_service_common_unittest.cc b/net/proxy/proxy_config_service_common_unittest.cc index b233bb6..429abc5 100644 --- a/net/proxy/proxy_config_service_common_unittest.cc +++ b/net/proxy/proxy_config_service_common_unittest.cc @@ -49,6 +49,26 @@ std::string FlattenProxyBypass(const ProxyBypassRules& bypass_rules) { } // namespace +ProxyRulesExpectation::ProxyRulesExpectation( + ProxyConfig::ProxyRules::Type type, + const char* single_proxy, + const char* proxy_for_http, + const char* proxy_for_https, + const char* proxy_for_ftp, + const char* fallback_proxy, + const char* flattened_bypass_rules, + bool reverse_bypass) + : type(type), + single_proxy(single_proxy), + proxy_for_http(proxy_for_http), + proxy_for_https(proxy_for_https), + proxy_for_ftp(proxy_for_ftp), + fallback_proxy(fallback_proxy), + flattened_bypass_rules(flattened_bypass_rules), + reverse_bypass(reverse_bypass) { +} + + ::testing::AssertionResult ProxyRulesExpectation::Matches( const ProxyConfig::ProxyRules& rules) const { ::testing::AssertionResult failure_details = ::testing::AssertionFailure(); diff --git a/net/proxy/proxy_config_service_common_unittest.h b/net/proxy/proxy_config_service_common_unittest.h index b64cd6b..724e1de 100644 --- a/net/proxy/proxy_config_service_common_unittest.h +++ b/net/proxy/proxy_config_service_common_unittest.h @@ -24,17 +24,7 @@ struct ProxyRulesExpectation { const char* proxy_for_ftp, const char* fallback_proxy, const char* flattened_bypass_rules, - bool reverse_bypass) - : type(type), - single_proxy(single_proxy), - proxy_for_http(proxy_for_http), - proxy_for_https(proxy_for_https), - proxy_for_ftp(proxy_for_ftp), - fallback_proxy(fallback_proxy), - flattened_bypass_rules(flattened_bypass_rules), - reverse_bypass(reverse_bypass) { - } - + bool reverse_bypass); // Call this within an EXPECT_TRUE(), to assert that |rules| matches // our expected values |*this|. diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc index b119b13..236e707 100644 --- a/net/proxy/proxy_list.cc +++ b/net/proxy/proxy_list.cc @@ -7,12 +7,19 @@ #include "base/logging.h" #include "base/string_tokenizer.h" #include "base/time.h" +#include "net/proxy/proxy_server.h" using base::TimeDelta; using base::TimeTicks; namespace net { +ProxyList::ProxyList() { +} + +ProxyList::~ProxyList() { +} + void ProxyList::Set(const std::string& proxy_uri_list) { proxies_.clear(); StringTokenizer str_tok(proxy_uri_list, ";"); diff --git a/net/proxy/proxy_list.h b/net/proxy/proxy_list.h index 26265d0..e5c41c6 100644 --- a/net/proxy/proxy_list.h +++ b/net/proxy/proxy_list.h @@ -10,15 +10,19 @@ #include <vector> #include "net/proxy/proxy_retry_info.h" -#include "net/proxy/proxy_server.h" namespace net { +class ProxyServer; + // This class is used to hold a list of proxies returned by GetProxyForUrl or // manually configured. It handles proxy fallback if multiple servers are // specified. class ProxyList { public: + ProxyList(); + ~ProxyList(); + // Initializes the proxy list to a string containing one or more proxy servers // delimited by a semicolon. void Set(const std::string& proxy_uri_list); diff --git a/net/proxy/proxy_list_unittest.cc b/net/proxy/proxy_list_unittest.cc index 397bb7c..04d9268 100644 --- a/net/proxy/proxy_list_unittest.cc +++ b/net/proxy/proxy_list_unittest.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "net/proxy/proxy_list.h" + +#include "net/proxy/proxy_server.h" #include "testing/gtest/include/gtest/gtest.h" namespace net { diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index ee4a403..dfdacde 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -877,6 +877,8 @@ int SyncProxyServiceHelper::ReconsiderProxyAfterError( return result_; } +SyncProxyServiceHelper::~SyncProxyServiceHelper() {} + void SyncProxyServiceHelper::StartAsyncResolve(const GURL& url, const BoundNetLog& net_log) { result_ = proxy_service_->ResolveProxy( diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h index d8d2e6c..da0013f 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h @@ -217,7 +217,7 @@ class ProxyService : public base::RefCountedThreadSafe<ProxyService>, STATE_READY, }; - ~ProxyService(); + virtual ~ProxyService(); // Resets all the variables associated with the current proxy configuration, // and rewinds the current state to |STATE_NONE|. Returns the previous value @@ -341,7 +341,7 @@ class SyncProxyServiceHelper private: friend class base::RefCountedThreadSafe<SyncProxyServiceHelper>; - ~SyncProxyServiceHelper() {} + virtual ~SyncProxyServiceHelper(); void StartAsyncResolve(const GURL& url, const BoundNetLog& net_log); void StartAsyncReconsider(const GURL& url, const BoundNetLog& net_log); diff --git a/net/socket/client_socket_pool.cc b/net/socket/client_socket_pool.cc index 4cefe8d..a54109e 100644 --- a/net/socket/client_socket_pool.cc +++ b/net/socket/client_socket_pool.cc @@ -26,4 +26,8 @@ void ClientSocketPool::set_unused_idle_socket_timeout(int timeout) { g_unused_idle_socket_timeout = timeout;
}
+ClientSocketPool::ClientSocketPool() {}
+
+ClientSocketPool::~ClientSocketPool() {}
+
} // namespace net
diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h index c727345..ad5f1ae 100644 --- a/net/socket/client_socket_pool.h +++ b/net/socket/client_socket_pool.h @@ -124,8 +124,8 @@ class ClientSocketPool { static void set_unused_idle_socket_timeout(int timeout); protected: - ClientSocketPool() {} - virtual ~ClientSocketPool() {} + ClientSocketPool(); + virtual ~ClientSocketPool(); // Return the connection timeout for this pool. virtual base::TimeDelta ConnectionTimeout() const = 0; diff --git a/net/socket/client_socket_pool_histograms.h b/net/socket/client_socket_pool_histograms.h index 74be341..9c12e5d 100644 --- a/net/socket/client_socket_pool_histograms.h +++ b/net/socket/client_socket_pool_histograms.h @@ -8,8 +8,10 @@ #include <string> -#include "base/histogram.h" #include "base/ref_counted.h" +#include "base/time.h" + +class Histogram; namespace net { diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 0c181b6..32623de 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -989,6 +989,18 @@ SSLClientSocket* DeterministicMockClientSocketFactory::CreateSSLClientSocket( return socket; } +TestSocketRequest::TestSocketRequest( + std::vector<TestSocketRequest*>* request_order, + size_t* completion_count) + : request_order_(request_order), + completion_count_(completion_count) { + DCHECK(request_order); + DCHECK(completion_count); +} + +TestSocketRequest::~TestSocketRequest() { +} + int TestSocketRequest::WaitForResult() { return callback_.WaitForResult(); } diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index 7f83a70..c76dfae 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -683,12 +683,8 @@ class TestSocketRequest : public CallbackRunner< Tuple1<int> > { public: TestSocketRequest( std::vector<TestSocketRequest*>* request_order, - size_t* completion_count) - : request_order_(request_order), - completion_count_(completion_count) { - DCHECK(request_order); - DCHECK(completion_count); - } + size_t* completion_count); + virtual ~TestSocketRequest(); ClientSocketHandle* handle() { return &handle_; } diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc index c065658..6069f4d 100644 --- a/net/socket/ssl_client_socket_pool.cc +++ b/net/socket/ssl_client_socket_pool.cc @@ -4,6 +4,7 @@ #include "net/socket/ssl_client_socket_pool.h" +#include "base/histogram.h" #include "base/values.h" #include "net/base/net_errors.h" #include "net/base/ssl_cert_request_info.h" diff --git a/net/socket/tcp_client_socket_pool.cc b/net/socket/tcp_client_socket_pool.cc index 89b000e..bea4dff 100644 --- a/net/socket/tcp_client_socket_pool.cc +++ b/net/socket/tcp_client_socket_pool.cc @@ -5,6 +5,7 @@ #include "net/socket/tcp_client_socket_pool.h" #include "base/compiler_specific.h" +#include "base/histogram.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/string_util.h" |