diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 21:23:00 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 21:23:00 +0000 |
commit | 763f848ffbd28b22a6c2aa32bf28184d9c17b366 (patch) | |
tree | c6e662f3b95f1b52866c840a96d8ce02a75032cd /net/base | |
parent | 314feb0bc9a98d6ea9cfb576485bf82dd07ffe84 (diff) | |
download | chromium_src-763f848ffbd28b22a6c2aa32bf28184d9c17b366.zip chromium_src-763f848ffbd28b22a6c2aa32bf28184d9c17b366.tar.gz chromium_src-763f848ffbd28b22a6c2aa32bf28184d9c17b366.tar.bz2 |
FBTF: Another big ctor/dtor cleanup found by automated tools.
(Shaves ~2MB off Linux Debug .a files)
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3563004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/capturing_net_log.cc | 23 | ||||
-rw-r--r-- | net/base/capturing_net_log.h | 16 | ||||
-rw-r--r-- | net/base/cert_database.cc | 3 | ||||
-rw-r--r-- | net/base/cert_database.h | 1 | ||||
-rw-r--r-- | net/base/cookie_monster.cc | 3 | ||||
-rw-r--r-- | net/base/cookie_monster.h | 2 | ||||
-rw-r--r-- | net/base/cookie_store.cc | 36 | ||||
-rw-r--r-- | net/base/cookie_store.h | 20 | ||||
-rw-r--r-- | net/base/mock_host_resolver.cc | 25 | ||||
-rw-r--r-- | net/base/mock_host_resolver.h | 19 | ||||
-rw-r--r-- | net/base/ssl_config_service.cc | 4 | ||||
-rw-r--r-- | net/base/ssl_config_service.h | 3 | ||||
-rw-r--r-- | net/base/x509_certificate.h | 3 |
13 files changed, 119 insertions, 39 deletions
diff --git a/net/base/capturing_net_log.cc b/net/base/capturing_net_log.cc index 08f3b8d..c488e06 100644 --- a/net/base/capturing_net_log.cc +++ b/net/base/capturing_net_log.cc @@ -6,10 +6,23 @@ namespace net { +CapturingNetLog::Entry::Entry(EventType type, + const base::TimeTicks& time, + Source source, + EventPhase phase, + EventParameters* extra_parameters) + : type(type), time(time), source(source), phase(phase), + extra_parameters(extra_parameters) { +} + +CapturingNetLog::Entry::~Entry() {} + CapturingNetLog::CapturingNetLog(size_t max_num_entries) : next_id_(0), max_num_entries_(max_num_entries) { } +CapturingNetLog::~CapturingNetLog() {} + void CapturingNetLog::AddEntry(EventType type, const base::TimeTicks& time, const Source& source, @@ -28,6 +41,16 @@ void CapturingNetLog::Clear() { entries_.clear(); } +CapturingBoundNetLog::CapturingBoundNetLog(const NetLog::Source& source, + CapturingNetLog* net_log) + : source_(source), capturing_net_log_(net_log) { +} + +CapturingBoundNetLog::CapturingBoundNetLog(size_t max_num_entries) + : capturing_net_log_(new CapturingNetLog(max_num_entries)) {} + +CapturingBoundNetLog::~CapturingBoundNetLog() {} + void CapturingBoundNetLog::Clear() { capturing_net_log_->Clear(); } diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h index 9669445..6e0f620 100644 --- a/net/base/capturing_net_log.h +++ b/net/base/capturing_net_log.h @@ -25,10 +25,8 @@ class CapturingNetLog : public NetLog { const base::TimeTicks& time, Source source, EventPhase phase, - EventParameters* extra_parameters) - : type(type), time(time), source(source), phase(phase), - extra_parameters(extra_parameters) { - } + EventParameters* extra_parameters); + ~Entry(); EventType type; base::TimeTicks time; @@ -45,6 +43,7 @@ class CapturingNetLog : public NetLog { // Creates a CapturingNetLog that logs a maximum of |max_num_entries| // messages. explicit CapturingNetLog(size_t max_num_entries); + virtual ~CapturingNetLog(); // NetLog implementation: virtual void AddEntry(EventType type, @@ -75,12 +74,11 @@ class CapturingNetLog : public NetLog { // bound() method. class CapturingBoundNetLog { public: - CapturingBoundNetLog(const NetLog::Source& source, CapturingNetLog* net_log) - : source_(source), capturing_net_log_(net_log) { - } + CapturingBoundNetLog(const NetLog::Source& source, CapturingNetLog* net_log); + + explicit CapturingBoundNetLog(size_t max_num_entries); - explicit CapturingBoundNetLog(size_t max_num_entries) - : capturing_net_log_(new CapturingNetLog(max_num_entries)) {} + ~CapturingBoundNetLog(); // The returned BoundNetLog is only valid while |this| is alive. BoundNetLog bound() const { diff --git a/net/base/cert_database.cc b/net/base/cert_database.cc index 961638c..313a6dd0 100644 --- a/net/base/cert_database.cc +++ b/net/base/cert_database.cc @@ -13,4 +13,7 @@ CertDatabase::ImportCertFailure::ImportCertFailure( : certificate(cert), net_error(err) { } +CertDatabase::ImportCertFailure::~ImportCertFailure() { +} + } // namespace net diff --git a/net/base/cert_database.h b/net/base/cert_database.h index 52888fe..38fb403 100644 --- a/net/base/cert_database.h +++ b/net/base/cert_database.h @@ -65,6 +65,7 @@ class CertDatabase { struct ImportCertFailure { public: ImportCertFailure(X509Certificate* cert, int err); + ~ImportCertFailure(); scoped_refptr<X509Certificate> certificate; int net_error; diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index a75420f..82d35b1 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -1531,6 +1531,9 @@ CookieMonster::ParsedCookie::ParsedCookie(const std::string& cookie_line) } } +CookieMonster::ParsedCookie::~ParsedCookie() { +} + // Returns true if |c| occurs in |chars| // TODO maybe make this take an iterator, could check for end also? static inline bool CharIsA(const char c, const char* chars) { diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h index 80535c2..33953d9 100644 --- a/net/base/cookie_monster.h +++ b/net/base/cookie_monster.h @@ -585,7 +585,7 @@ class CookieMonster::ParsedCookie { // Construct from a cookie string like "BLAH=1; path=/; domain=.google.com" ParsedCookie(const std::string& cookie_line); - ~ParsedCookie() { } + ~ParsedCookie(); // You should not call any other methods on the class if !IsValid bool IsValid() const { return is_valid_; } diff --git a/net/base/cookie_store.cc b/net/base/cookie_store.cc new file mode 100644 index 0000000..4891fdf --- /dev/null +++ b/net/base/cookie_store.cc @@ -0,0 +1,36 @@ +// Copyright (c) 2010 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. + +#include "net/base/cookie_store.h" + +#include "net/base/cookie_options.h" + +namespace net { + +bool CookieStore::SetCookie(const GURL& url, const std::string& cookie_line) { + return SetCookieWithOptions(url, cookie_line, CookieOptions()); +} + +std::string CookieStore::GetCookies(const GURL& url) { + return GetCookiesWithOptions(url, CookieOptions()); +} + +void CookieStore::SetCookiesWithOptions( + const GURL& url, + const std::vector<std::string>& cookie_lines, + const CookieOptions& options) { + for (size_t i = 0; i < cookie_lines.size(); ++i) + SetCookieWithOptions(url, cookie_lines[i], options); +} + +void CookieStore::SetCookies(const GURL& url, + const std::vector<std::string>& cookie_lines) { + SetCookiesWithOptions(url, cookie_lines, CookieOptions()); +} + +CookieStore::CookieStore() {} + +CookieStore::~CookieStore() {} + +} // namespace net diff --git a/net/base/cookie_store.h b/net/base/cookie_store.h index 2360c96..3976169 100644 --- a/net/base/cookie_store.h +++ b/net/base/cookie_store.h @@ -50,30 +50,22 @@ class CookieStore : public base::RefCountedThreadSafe<CookieStore> { // Helpers to make the above interface simpler for some cases. // Sets a cookie for the given URL using default options. - bool SetCookie(const GURL& url, const std::string& cookie_line) { - return SetCookieWithOptions(url, cookie_line, CookieOptions()); - } + bool SetCookie(const GURL& url, const std::string& cookie_line); // Gets cookies for the given URL using default options. - std::string GetCookies(const GURL& url) { - return GetCookiesWithOptions(url, CookieOptions()); - } + std::string GetCookies(const GURL& url); // Sets a vector of response cookie values for the same URL. void SetCookiesWithOptions(const GURL& url, const std::vector<std::string>& cookie_lines, - const CookieOptions& options) { - for (size_t i = 0; i < cookie_lines.size(); ++i) - SetCookieWithOptions(url, cookie_lines[i], options); - } + const CookieOptions& options); void SetCookies(const GURL& url, - const std::vector<std::string>& cookie_lines) { - SetCookiesWithOptions(url, cookie_lines, CookieOptions()); - } + const std::vector<std::string>& cookie_lines); protected: friend class base::RefCountedThreadSafe<CookieStore>; - virtual ~CookieStore() {} + CookieStore(); + virtual ~CookieStore(); }; } // namespace net diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc index f8c53a6..6eae712 100644 --- a/net/base/mock_host_resolver.cc +++ b/net/base/mock_host_resolver.cc @@ -50,6 +50,8 @@ MockHostResolverBase::MockHostResolverBase(bool use_caching) Reset(NULL); } +MockHostResolverBase::~MockHostResolverBase() {} + int MockHostResolverBase::Resolve(const RequestInfo& info, AddressList* addresses, CompletionCallback* callback, @@ -258,6 +260,29 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host, //----------------------------------------------------------------------------- +WaitingHostResolverProc::WaitingHostResolverProc(HostResolverProc* previous) + : HostResolverProc(previous), event_(false, false) {} + +void WaitingHostResolverProc::Signal() { + event_.Signal(); +} + +int WaitingHostResolverProc::Resolve(const std::string& host, + AddressFamily address_family, + HostResolverFlags host_resolver_flags, + AddressList* addrlist, + int* os_error) { + event_.Wait(); + return ResolveUsingPrevious(host, address_family, host_resolver_flags, + addrlist, os_error); +} + +WaitingHostResolverProc::~WaitingHostResolverProc() {} + +//----------------------------------------------------------------------------- + +ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc() {} + ScopedDefaultHostResolverProc::ScopedDefaultHostResolverProc( HostResolverProc* proc) { Init(proc); diff --git a/net/base/mock_host_resolver.h b/net/base/mock_host_resolver.h index 4b185b2..59dd02c 100644 --- a/net/base/mock_host_resolver.h +++ b/net/base/mock_host_resolver.h @@ -68,7 +68,7 @@ class MockHostResolverBase : public HostResolver { protected: MockHostResolverBase(bool use_caching); - virtual ~MockHostResolverBase() {} + virtual ~MockHostResolverBase(); scoped_refptr<HostResolverImpl> impl_; scoped_refptr<RuleBasedHostResolverProc> rules_; @@ -154,26 +154,19 @@ class RuleBasedHostResolverProc : public HostResolverProc { // Using WaitingHostResolverProc you can simulate very long lookups. class WaitingHostResolverProc : public HostResolverProc { public: - explicit WaitingHostResolverProc(HostResolverProc* previous) - : HostResolverProc(previous), event_(false, false) {} + explicit WaitingHostResolverProc(HostResolverProc* previous); - void Signal() { - event_.Signal(); - } + void Signal(); // HostResolverProc methods: virtual int Resolve(const std::string& host, AddressFamily address_family, HostResolverFlags host_resolver_flags, AddressList* addrlist, - int* os_error) { - event_.Wait(); - return ResolveUsingPrevious(host, address_family, host_resolver_flags, - addrlist, os_error); - } + int* os_error); private: - ~WaitingHostResolverProc() {} + virtual ~WaitingHostResolverProc(); base::WaitableEvent event_; }; @@ -189,7 +182,7 @@ class WaitingHostResolverProc : public HostResolverProc { // MockHostResolver. class ScopedDefaultHostResolverProc { public: - ScopedDefaultHostResolverProc() {} + ScopedDefaultHostResolverProc(); explicit ScopedDefaultHostResolverProc(HostResolverProc* proc); ~ScopedDefaultHostResolverProc(); diff --git a/net/base/ssl_config_service.cc b/net/base/ssl_config_service.cc index fc35f5d..b349a76 100644 --- a/net/base/ssl_config_service.cc +++ b/net/base/ssl_config_service.cc @@ -15,6 +15,10 @@ namespace net { +SSLConfig::CertAndStatus::CertAndStatus() {} + +SSLConfig::CertAndStatus::~CertAndStatus() {} + SSLConfig::SSLConfig() : rev_checking_enabled(true), ssl2_enabled(false), ssl3_enabled(true), tls1_enabled(true), dnssec_enabled(false), snap_start_enabled(false), diff --git a/net/base/ssl_config_service.h b/net/base/ssl_config_service.h index 5eb2397..45c5392 100644 --- a/net/base/ssl_config_service.h +++ b/net/base/ssl_config_service.h @@ -44,6 +44,9 @@ struct SSLConfig { // are not SSL configuration settings. struct CertAndStatus { + CertAndStatus(); + ~CertAndStatus(); + scoped_refptr<X509Certificate> cert; int cert_status; }; diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h index ec5105a..5a9e897 100644 --- a/net/base/x509_certificate.h +++ b/net/base/x509_certificate.h @@ -55,8 +55,7 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { typedef std::vector<OSCertHandle> OSCertHandles; // Predicate functor used in maps when X509Certificate is used as the key. - class LessThan - : public std::binary_function<X509Certificate*, X509Certificate*, bool> { + class LessThan { public: bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; }; |