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 /webkit/appcache | |
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 'webkit/appcache')
-rw-r--r-- | webkit/appcache/appcache_backend_impl.cc | 6 | ||||
-rw-r--r-- | webkit/appcache/appcache_backend_impl.h | 2 | ||||
-rw-r--r-- | webkit/appcache/appcache_interfaces.cc | 25 | ||||
-rw-r--r-- | webkit/appcache/appcache_interfaces.h | 10 | ||||
-rw-r--r-- | webkit/appcache/appcache_response.cc | 9 | ||||
-rw-r--r-- | webkit/appcache/appcache_response.h | 11 | ||||
-rw-r--r-- | webkit/appcache/appcache_service.cc | 4 | ||||
-rw-r--r-- | webkit/appcache/appcache_service.h | 4 | ||||
-rw-r--r-- | webkit/appcache/appcache_storage.cc | 15 | ||||
-rw-r--r-- | webkit/appcache/appcache_storage.h | 12 | ||||
-rw-r--r-- | webkit/appcache/appcache_update_job.cc | 11 | ||||
-rw-r--r-- | webkit/appcache/appcache_update_job.h | 5 | ||||
-rw-r--r-- | webkit/appcache/appcache_working_set.cc | 2 | ||||
-rw-r--r-- | webkit/appcache/appcache_working_set.h | 2 | ||||
-rw-r--r-- | webkit/appcache/manifest_parser.cc | 4 | ||||
-rw-r--r-- | webkit/appcache/manifest_parser.h | 5 |
16 files changed, 100 insertions, 27 deletions
diff --git a/webkit/appcache/appcache_backend_impl.cc b/webkit/appcache/appcache_backend_impl.cc index e077a33..a9349fa 100644 --- a/webkit/appcache/appcache_backend_impl.cc +++ b/webkit/appcache/appcache_backend_impl.cc @@ -12,6 +12,12 @@ namespace appcache { +AppCacheBackendImpl::AppCacheBackendImpl() + : service_(NULL), + frontend_(NULL), + process_id_(0) { +} + AppCacheBackendImpl::~AppCacheBackendImpl() { STLDeleteValues(&hosts_); if (service_) diff --git a/webkit/appcache/appcache_backend_impl.h b/webkit/appcache/appcache_backend_impl.h index d299641..ac563ff 100644 --- a/webkit/appcache/appcache_backend_impl.h +++ b/webkit/appcache/appcache_backend_impl.h @@ -14,7 +14,7 @@ class AppCacheService; class AppCacheBackendImpl { public: - AppCacheBackendImpl() : service_(NULL), frontend_(NULL), process_id_(0) {} + AppCacheBackendImpl(); ~AppCacheBackendImpl(); void Initialize(AppCacheService* service, diff --git a/webkit/appcache/appcache_interfaces.cc b/webkit/appcache/appcache_interfaces.cc index a818bb9..4ed0f09 100644 --- a/webkit/appcache/appcache_interfaces.cc +++ b/webkit/appcache/appcache_interfaces.cc @@ -23,6 +23,29 @@ const char kHttpHEADMethod[] = "HEAD"; const FilePath::CharType kAppCacheDatabaseName[] = FILE_PATH_LITERAL("Index"); +AppCacheInfo::AppCacheInfo() + : cache_id(kNoCacheId), + status(UNCACHED), + size(0), + is_complete(false) { +} + +AppCacheInfo::~AppCacheInfo() { +} + +AppCacheResourceInfo::AppCacheResourceInfo() + : url(), + size(0), + is_master(0), + is_manifest(0), + is_fallback(0), + is_foreign(0), + is_explicit(0) { +} + +AppCacheResourceInfo::~AppCacheResourceInfo() { +} + bool IsSchemeSupported(const GURL& url) { bool supported = url.SchemeIs(kHttpScheme) || url.SchemeIs(kHttpsScheme); #ifndef NDEBUG @@ -85,4 +108,4 @@ COMPILE_ASSERT((int)WebConsoleMessage::LevelWarning == COMPILE_ASSERT((int)WebConsoleMessage::LevelError == (int)LOG_ERROR, LevelError); -} // namespace +} // namespace appcache diff --git a/webkit/appcache/appcache_interfaces.h b/webkit/appcache/appcache_interfaces.h index 1dfd326..973f795 100644 --- a/webkit/appcache/appcache_interfaces.h +++ b/webkit/appcache/appcache_interfaces.h @@ -53,6 +53,9 @@ enum LogLevel { }; struct AppCacheInfo { + AppCacheInfo(); + ~AppCacheInfo(); + GURL manifest_url; base::Time creation_time; base::Time last_update_time; @@ -61,14 +64,15 @@ struct AppCacheInfo { Status status; int64 size; bool is_complete; - AppCacheInfo() : cache_id(kNoCacheId), status(UNCACHED), - size(0), is_complete(false) { } }; typedef std::vector<AppCacheInfo> AppCacheInfoVector; -// POD type to hold information about a single appcache resource. +// Type to hold information about a single appcache resource. struct AppCacheResourceInfo { + AppCacheResourceInfo(); + ~AppCacheResourceInfo(); + GURL url; int64 size; bool is_master; diff --git a/webkit/appcache/appcache_response.cc b/webkit/appcache/appcache_response.cc index c44eac6..54bba14 100644 --- a/webkit/appcache/appcache_response.cc +++ b/webkit/appcache/appcache_response.cc @@ -63,6 +63,15 @@ AppCacheResponseInfo::~AppCacheResponseInfo() { service_->storage()->working_set()->RemoveResponseInfo(this); } +// HttpResponseInfoIOBuffer ------------------------------------------ + +HttpResponseInfoIOBuffer::HttpResponseInfoIOBuffer() + : response_data_size(kUnkownResponseDataSize) {} + +HttpResponseInfoIOBuffer::HttpResponseInfoIOBuffer(net::HttpResponseInfo* info) + : http_info(info), response_data_size(kUnkownResponseDataSize) {} + +HttpResponseInfoIOBuffer::~HttpResponseInfoIOBuffer() {} // AppCacheResponseIO ---------------------------------------------- diff --git a/webkit/appcache/appcache_response.h b/webkit/appcache/appcache_response.h index 1f8ecce..5f62b14 100644 --- a/webkit/appcache/appcache_response.h +++ b/webkit/appcache/appcache_response.h @@ -48,7 +48,7 @@ class AppCacheResponseInfo private: friend class base::RefCounted<AppCacheResponseInfo>; - ~AppCacheResponseInfo(); + virtual ~AppCacheResponseInfo(); const GURL manifest_url_; const int64 response_id_; @@ -64,15 +64,12 @@ struct HttpResponseInfoIOBuffer scoped_ptr<net::HttpResponseInfo> http_info; int response_data_size; - HttpResponseInfoIOBuffer() - : response_data_size(kUnkownResponseDataSize) {} - explicit HttpResponseInfoIOBuffer(net::HttpResponseInfo* info) - : http_info(info), response_data_size(kUnkownResponseDataSize) {} + HttpResponseInfoIOBuffer(); + explicit HttpResponseInfoIOBuffer(net::HttpResponseInfo* info); private: friend class base::RefCountedThreadSafe<HttpResponseInfoIOBuffer>; - - ~HttpResponseInfoIOBuffer() {} + virtual ~HttpResponseInfoIOBuffer(); }; // Common base class for response reader and writer. diff --git a/webkit/appcache/appcache_service.cc b/webkit/appcache/appcache_service.cc index bf8fba2..c6bba28 100644 --- a/webkit/appcache/appcache_service.cc +++ b/webkit/appcache/appcache_service.cc @@ -12,6 +12,10 @@ namespace appcache { +AppCacheInfoCollection::AppCacheInfoCollection() {} + +AppCacheInfoCollection::~AppCacheInfoCollection() {} + // AsyncHelper ------- class AppCacheService::AsyncHelper diff --git a/webkit/appcache/appcache_service.h b/webkit/appcache/appcache_service.h index fe5ec60..ebd8fb7 100644 --- a/webkit/appcache/appcache_service.h +++ b/webkit/appcache/appcache_service.h @@ -32,7 +32,9 @@ class AppCachePolicy; // Refcounted container to avoid copying the collection in callbacks. struct AppCacheInfoCollection : public base::RefCountedThreadSafe<AppCacheInfoCollection> { - virtual ~AppCacheInfoCollection() {} + AppCacheInfoCollection(); + virtual ~AppCacheInfoCollection(); + std::map<GURL, AppCacheInfoVector> infos_by_origin; }; diff --git a/webkit/appcache/appcache_storage.cc b/webkit/appcache/appcache_storage.cc index 445b965..01c18f1 100644 --- a/webkit/appcache/appcache_storage.cc +++ b/webkit/appcache/appcache_storage.cc @@ -22,6 +22,18 @@ AppCacheStorage::~AppCacheStorage() { DCHECK(delegate_references_.empty()); } +AppCacheStorage::DelegateReference::DelegateReference( + Delegate* delegate, AppCacheStorage* storage) + : delegate(delegate), storage(storage) { + storage->delegate_references_.insert( + DelegateReferenceMap::value_type(delegate, this)); +} + +AppCacheStorage::DelegateReference::~DelegateReference() { + if (delegate) + storage->delegate_references_.erase(delegate); +} + AppCacheStorage::ResponseInfoLoadTask::ResponseInfoLoadTask( const GURL& manifest_url, int64 response_id, @@ -36,6 +48,9 @@ AppCacheStorage::ResponseInfoLoadTask::ResponseInfoLoadTask( PendingResponseInfoLoads::value_type(response_id, this)); } +AppCacheStorage::ResponseInfoLoadTask::~ResponseInfoLoadTask() { +} + void AppCacheStorage::ResponseInfoLoadTask::StartIfNeeded() { if (reader_.get()) return; diff --git a/webkit/appcache/appcache_storage.h b/webkit/appcache/appcache_storage.h index 559237c..20fbffe 100644 --- a/webkit/appcache/appcache_storage.h +++ b/webkit/appcache/appcache_storage.h @@ -206,11 +206,7 @@ class AppCacheStorage { Delegate* delegate; AppCacheStorage* storage; - DelegateReference(Delegate* delegate, AppCacheStorage* storage) - : delegate(delegate), storage(storage) { - storage->delegate_references_.insert( - DelegateReferenceMap::value_type(delegate, this)); - } + DelegateReference(Delegate* delegate, AppCacheStorage* storage); void CancelReference() { storage->delegate_references_.erase(delegate); @@ -221,10 +217,7 @@ class AppCacheStorage { private: friend class base::RefCounted<DelegateReference>; - ~DelegateReference() { - if (delegate) - storage->delegate_references_.erase(delegate); - } + virtual ~DelegateReference(); }; typedef std::map<Delegate*, DelegateReference*> DelegateReferenceMap; typedef std::vector<scoped_refptr<DelegateReference> > @@ -236,6 +229,7 @@ class AppCacheStorage { public: ResponseInfoLoadTask(const GURL& manifest_url, int64 response_id, AppCacheStorage* storage); + ~ResponseInfoLoadTask(); int64 response_id() const { return response_id_; } const GURL& manifest_url() const { return manifest_url_; } diff --git a/webkit/appcache/appcache_update_job.cc b/webkit/appcache/appcache_update_job.cc index 5433e55..7d48a3a 100644 --- a/webkit/appcache/appcache_update_job.cc +++ b/webkit/appcache/appcache_update_job.cc @@ -123,6 +123,17 @@ class HostNotifier { NotifyHostMap hosts_to_notify; }; +AppCacheUpdateJob::UrlToFetch::UrlToFetch(const GURL& url, + bool checked, + AppCacheResponseInfo* info) + : url(url), + storage_checked(checked), + existing_response_info(info) { +} + +AppCacheUpdateJob::UrlToFetch::~UrlToFetch() { +} + AppCacheUpdateJob::AppCacheUpdateJob(AppCacheService* service, AppCacheGroup* group) : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), diff --git a/webkit/appcache/appcache_update_job.h b/webkit/appcache/appcache_update_job.h index 9d82e68..b0a683c 100644 --- a/webkit/appcache/appcache_update_job.h +++ b/webkit/appcache/appcache_update_job.h @@ -83,11 +83,12 @@ class AppCacheUpdateJob : public URLRequest::Delegate, }; struct UrlToFetch { + UrlToFetch(const GURL& url, bool checked, AppCacheResponseInfo* info); + ~UrlToFetch(); + GURL url; bool storage_checked; scoped_refptr<AppCacheResponseInfo> existing_response_info; - UrlToFetch(const GURL& url, bool checked, AppCacheResponseInfo* info) - : url(url), storage_checked(checked), existing_response_info(info) {} }; UpdateJobInfo* GetUpdateJobInfo(URLRequest* request); diff --git a/webkit/appcache/appcache_working_set.cc b/webkit/appcache/appcache_working_set.cc index 1c3f40b..e7bdf53 100644 --- a/webkit/appcache/appcache_working_set.cc +++ b/webkit/appcache/appcache_working_set.cc @@ -11,6 +11,8 @@ namespace appcache { +AppCacheWorkingSet::AppCacheWorkingSet() : is_disabled_(false) {} + AppCacheWorkingSet::~AppCacheWorkingSet() { DCHECK(caches_.empty()); DCHECK(groups_.empty()); diff --git a/webkit/appcache/appcache_working_set.h b/webkit/appcache/appcache_working_set.h index 15221d12..d7e4fc9 100644 --- a/webkit/appcache/appcache_working_set.h +++ b/webkit/appcache/appcache_working_set.h @@ -22,7 +22,7 @@ class AppCacheWorkingSet { public: typedef std::map<GURL, AppCacheGroup*> GroupMap; - AppCacheWorkingSet() : is_disabled_(false) {} + AppCacheWorkingSet(); ~AppCacheWorkingSet(); void Disable(); diff --git a/webkit/appcache/manifest_parser.cc b/webkit/appcache/manifest_parser.cc index cbd1c68..68b37d8 100644 --- a/webkit/appcache/manifest_parser.cc +++ b/webkit/appcache/manifest_parser.cc @@ -45,6 +45,10 @@ enum Mode { UNKNOWN, }; +Manifest::Manifest() : online_whitelist_all(false) {} + +Manifest::~Manifest() {} + bool ParseManifest(const GURL& manifest_url, const char* data, int length, Manifest& manifest) { static const std::wstring kSignature(L"CACHE MANIFEST"); diff --git a/webkit/appcache/manifest_parser.h b/webkit/appcache/manifest_parser.h index e9f80d9..19d5cac 100644 --- a/webkit/appcache/manifest_parser.h +++ b/webkit/appcache/manifest_parser.h @@ -44,12 +44,13 @@ namespace appcache { typedef std::pair<GURL, GURL> FallbackNamespace; struct Manifest { + Manifest(); + ~Manifest(); + base::hash_set<std::string> explicit_urls; std::vector<FallbackNamespace> fallback_namespaces; std::vector<GURL> online_whitelist_namespaces; bool online_whitelist_all; - - Manifest() : online_whitelist_all(false) {} }; bool ParseManifest(const GURL& manifest_url, const char* data, int length, |