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 | |
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')
-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 | ||||
-rw-r--r-- | net/http/http_request_info.cc | 17 | ||||
-rw-r--r-- | net/http/http_request_info.h | 8 | ||||
-rw-r--r-- | net/net.gyp | 2 | ||||
-rw-r--r-- | net/server/http_server_request_info.h | 2 | ||||
-rw-r--r-- | net/socket/client_socket_pool_histograms.h | 2 | ||||
-rw-r--r-- | net/socket_stream/socket_stream_job.cc | 34 | ||||
-rw-r--r-- | net/socket_stream/socket_stream_job.h | 35 |
20 files changed, 185 insertions, 73 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; }; diff --git a/net/http/http_request_info.cc b/net/http/http_request_info.cc new file mode 100644 index 0000000..8ab3096 --- /dev/null +++ b/net/http/http_request_info.cc @@ -0,0 +1,17 @@ +// 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/http/http_request_info.h" + +namespace net { + +HttpRequestInfo::HttpRequestInfo() + : load_flags(0), + priority(LOWEST), + motivation(NORMAL_MOTIVATION) { +} + +HttpRequestInfo::~HttpRequestInfo() {} + +} // namespace net diff --git a/net/http/http_request_info.h b/net/http/http_request_info.h index 3c072c0..f740d7c 100644 --- a/net/http/http_request_info.h +++ b/net/http/http_request_info.h @@ -16,7 +16,6 @@ namespace net { struct HttpRequestInfo { - public: enum RequestMotivation{ // TODO(mbelshe): move these into Client Socket. PRECONNECT_MOTIVATED, // This request was motivated by a prefetch. @@ -24,11 +23,8 @@ struct HttpRequestInfo { NORMAL_MOTIVATION // No special motivation associated with the request. }; - HttpRequestInfo() - : load_flags(0), - priority(LOWEST), - motivation(NORMAL_MOTIVATION) { - } + HttpRequestInfo(); + ~HttpRequestInfo(); // The requested URL. GURL url; diff --git a/net/net.gyp b/net/net.gyp index 1ce4608..02e1bcd 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -49,6 +49,7 @@ 'base/cookie_monster.h', 'base/cookie_options.h', 'base/cookie_policy.h', + 'base/cookie_store.cc', 'base/cookie_store.h', 'base/data_url.cc', 'base/data_url.h', @@ -432,6 +433,7 @@ 'http/http_network_transaction.h', 'http/http_request_headers.cc', 'http/http_request_headers.h', + 'http/http_request_info.cc', 'http/http_request_info.h', 'http/http_response_body_drainer.cc', 'http/http_response_body_drainer.h', diff --git a/net/server/http_server_request_info.h b/net/server/http_server_request_info.h index 9c362e2..63abab5 100644 --- a/net/server/http_server_request_info.h +++ b/net/server/http_server_request_info.h @@ -9,8 +9,6 @@ #include <string> #include <map> -#include "net/http/http_request_info.h" - // Meta information about an HTTP request. // This is geared toward servers in that it keeps a map of the headers and // values rather than just a list of header strings (which net::HttpRequestInfo diff --git a/net/socket/client_socket_pool_histograms.h b/net/socket/client_socket_pool_histograms.h index 9c12e5d..41aad57 100644 --- a/net/socket/client_socket_pool_histograms.h +++ b/net/socket/client_socket_pool_histograms.h @@ -8,8 +8,8 @@ #include <string> -#include "base/ref_counted.h" #include "base/time.h" +#include "base/ref_counted.h" class Histogram; diff --git a/net/socket_stream/socket_stream_job.cc b/net/socket_stream/socket_stream_job.cc index c8849a5..0913015 100644 --- a/net/socket_stream/socket_stream_job.cc +++ b/net/socket_stream/socket_stream_job.cc @@ -24,4 +24,38 @@ SocketStreamJob* SocketStreamJob::CreateSocketStreamJob( return GetJobManager()->CreateJob(url, delegate); } +SocketStreamJob::SocketStreamJob() {} + +SocketStream::UserData* SocketStreamJob::GetUserData(const void* key) const { + return socket_->GetUserData(key); +} + +void SocketStreamJob::SetUserData(const void* key, + SocketStream::UserData* data) { + socket_->SetUserData(key, data); +} + +void SocketStreamJob::Connect() { + socket_->Connect(); +} + +bool SocketStreamJob::SendData(const char* data, int len) { + return socket_->SendData(data, len); +} + +void SocketStreamJob::Close() { + socket_->Close(); +} + +void SocketStreamJob::RestartWithAuth(const string16& username, + const string16& password) { + socket_->RestartWithAuth(username, password); +} + +void SocketStreamJob::DetachDelegate() { + socket_->DetachDelegate(); +} + +SocketStreamJob::~SocketStreamJob() {} + } // namespace net diff --git a/net/socket_stream/socket_stream_job.h b/net/socket_stream/socket_stream_job.h index 89e0c36..a301709 100644 --- a/net/socket_stream/socket_stream_job.h +++ b/net/socket_stream/socket_stream_job.h @@ -34,17 +34,13 @@ class SocketStreamJob : public base::RefCountedThreadSafe<SocketStreamJob> { static SocketStreamJob* CreateSocketStreamJob( const GURL& url, SocketStream::Delegate* delegate); - SocketStreamJob() {} + SocketStreamJob(); void InitSocketStream(SocketStream* socket) { socket_ = socket; } - virtual SocketStream::UserData *GetUserData(const void* key) const { - return socket_->GetUserData(key); - } - virtual void SetUserData(const void* key, SocketStream::UserData* data) { - socket_->SetUserData(key, data); - } + virtual SocketStream::UserData* GetUserData(const void* key) const; + virtual void SetUserData(const void* key, SocketStream::UserData* data); URLRequestContext* context() const { return socket_->context(); @@ -53,31 +49,20 @@ class SocketStreamJob : public base::RefCountedThreadSafe<SocketStreamJob> { socket_->set_context(context); } - virtual void Connect() { - socket_->Connect(); - } + virtual void Connect(); - virtual bool SendData(const char* data, int len) { - return socket_->SendData(data, len); - } + virtual bool SendData(const char* data, int len); - virtual void Close() { - socket_->Close(); - } + virtual void Close(); - virtual void RestartWithAuth( - const string16& username, - const string16& password) { - socket_->RestartWithAuth(username, password); - } + virtual void RestartWithAuth(const string16& username, + const string16& password); - virtual void DetachDelegate() { - socket_->DetachDelegate(); - } + virtual void DetachDelegate(); protected: friend class base::RefCountedThreadSafe<SocketStreamJob>; - virtual ~SocketStreamJob() {} + virtual ~SocketStreamJob(); scoped_refptr<SocketStream> socket_; |