diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 22:54:58 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-28 22:54:58 +0000 |
commit | d4799a3bf70ecc62ab702150cae1d1e925b14938 (patch) | |
tree | fae21bc09ddaa68dfc709e0d6abc55a43fe99333 | |
parent | 7176ef1c7ada2da66a47ed38987c92a06f3bfb4a (diff) | |
download | chromium_src-d4799a3bf70ecc62ab702150cae1d1e925b14938.zip chromium_src-d4799a3bf70ecc62ab702150cae1d1e925b14938.tar.gz chromium_src-d4799a3bf70ecc62ab702150cae1d1e925b14938.tar.bz2 |
FBTF: Moves code to the headers.
One of the big things is starting to move/declare ctors/dtors that derive from RefCounted<> to/in the implementation file.
(Saves 4 megabytes from libglue.a alone. 1 meg off libbrowser.a. Hundred of kilobyte savings in a large number of .a files; only libmedia.a grew and it's only 100k.)
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3452030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60863 0039d316-1c4b-4281-b951-d872f2087c98
53 files changed, 274 insertions, 72 deletions
diff --git a/app/active_window_watcher_x.cc b/app/active_window_watcher_x.cc index 04cb3d0..9b861e6 100644 --- a/app/active_window_watcher_x.cc +++ b/app/active_window_watcher_x.cc @@ -24,6 +24,9 @@ ActiveWindowWatcherX::ActiveWindowWatcherX() { Init(); } +ActiveWindowWatcherX::~ActiveWindowWatcherX() { +} + void ActiveWindowWatcherX::Init() { GdkAtom kNetActiveWindow = gdk_atom_intern("_NET_ACTIVE_WINDOW", FALSE); kNetActiveWindowAtom = gdk_x11_atom_to_xatom_for_display( diff --git a/app/active_window_watcher_x.h b/app/active_window_watcher_x.h index e2612ec..e93ea1c 100644 --- a/app/active_window_watcher_x.h +++ b/app/active_window_watcher_x.h @@ -33,6 +33,7 @@ class ActiveWindowWatcherX { friend struct DefaultSingletonTraits<ActiveWindowWatcherX>; ActiveWindowWatcherX(); + ~ActiveWindowWatcherX(); void Init(); diff --git a/app/resource_bundle.cc b/app/resource_bundle.cc index 4b97c90..ec28581 100644 --- a/app/resource_bundle.cc +++ b/app/resource_bundle.cc @@ -214,6 +214,9 @@ ResourceBundle::LoadedDataPack::LoadedDataPack(const FilePath& path) Load(); } +ResourceBundle::LoadedDataPack::~LoadedDataPack() { +} + void ResourceBundle::LoadedDataPack::Load() { DCHECK(!data_pack_.get()); data_pack_.reset(new base::DataPack); diff --git a/app/resource_bundle.h b/app/resource_bundle.h index 49ca359..44237e2 100644 --- a/app/resource_bundle.h +++ b/app/resource_bundle.h @@ -161,6 +161,7 @@ class ResourceBundle { class LoadedDataPack { public: explicit LoadedDataPack(const FilePath& path); + ~LoadedDataPack(); bool GetStringPiece(int resource_id, base::StringPiece* data) const; RefCountedStaticMemory* GetStaticMemory(int resource_id) const; diff --git a/app/sql/connection.cc b/app/sql/connection.cc index b52655a..6691252 100644 --- a/app/sql/connection.cc +++ b/app/sql/connection.cc @@ -49,6 +49,12 @@ bool StatementID::operator<(const StatementID& other) const { return strcmp(str_, other.str_) < 0; } +ErrorDelegate::ErrorDelegate() { +} + +ErrorDelegate::~ErrorDelegate() { +} + Connection::StatementRef::StatementRef() : connection_(NULL), stmt_(NULL) { diff --git a/app/sql/connection.h b/app/sql/connection.h index 680cf1d..0b685cc 100644 --- a/app/sql/connection.h +++ b/app/sql/connection.h @@ -78,6 +78,8 @@ class Connection; // corruption, low-level IO errors or locking violations. class ErrorDelegate : public base::RefCounted<ErrorDelegate> { public: + ErrorDelegate(); + // |error| is an sqlite result code as seen in sqlite\preprocessed\sqlite3.h // |connection| is db connection where the error happened and |stmt| is // our best guess at the statement that triggered the error. Do not store @@ -94,7 +96,7 @@ class ErrorDelegate : public base::RefCounted<ErrorDelegate> { protected: friend class base::RefCounted<ErrorDelegate>; - virtual ~ErrorDelegate() {} + virtual ~ErrorDelegate(); }; class Connection { diff --git a/app/text_elider.cc b/app/text_elider.cc index 5a4d9d0..ec44057 100644 --- a/app/text_elider.cc +++ b/app/text_elider.cc @@ -396,6 +396,12 @@ SortedDisplayURL::SortedDisplayURL(const GURL& url, } } +SortedDisplayURL::SortedDisplayURL() { +} + +SortedDisplayURL::~SortedDisplayURL() { +} + int SortedDisplayURL::Compare(const SortedDisplayURL& other, icu::Collator* collator) const { // Compare on hosts first. The host won't contain 'www.'. diff --git a/app/text_elider.h b/app/text_elider.h index d2a6a73..06ebbf0 100644 --- a/app/text_elider.h +++ b/app/text_elider.h @@ -63,7 +63,8 @@ std::wstring ElideFilename(const FilePath& filename, class SortedDisplayURL { public: SortedDisplayURL(const GURL& url, const std::wstring& languages); - SortedDisplayURL() {} + SortedDisplayURL(); + ~SortedDisplayURL(); // Compares this SortedDisplayURL to |url| using |collator|. Returns a value // < 0, = 1 or > 0 as to whether this url is less then, equal to or greater diff --git a/base/base.gypi b/base/base.gypi index 3c5e1a0..7c66586 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -128,9 +128,11 @@ 'memory_debug.h', 'message_loop.cc', 'message_loop.h', + 'message_loop_proxy.cc', 'message_loop_proxy.h', 'message_loop_proxy_impl.cc', 'message_loop_proxy_impl.h', + 'message_pump.cc', 'message_pump.h', 'message_pump_default.cc', 'message_pump_default.h', diff --git a/base/histogram.cc b/base/histogram.cc index add7954..e045d81 100644 --- a/base/histogram.cc +++ b/base/histogram.cc @@ -503,6 +503,9 @@ Histogram::SampleSet::SampleSet() square_sum_(0) { } +Histogram::SampleSet::~SampleSet() { +} + void Histogram::SampleSet::Resize(const Histogram& histogram) { counts_.resize(histogram.bucket_count(), 0); } @@ -625,6 +628,9 @@ scoped_refptr<Histogram> LinearHistogram::FactoryTimeGet( bucket_count, flags); } +LinearHistogram::~LinearHistogram() { +} + LinearHistogram::LinearHistogram(const std::string& name, Sample minimum, Sample maximum, size_t bucket_count) : Histogram(name, minimum >= 1 ? minimum : 1, maximum, bucket_count) { diff --git a/base/histogram.h b/base/histogram.h index adf673c..0287d37 100644 --- a/base/histogram.h +++ b/base/histogram.h @@ -272,6 +272,8 @@ class Histogram : public base::RefCountedThreadSafe<Histogram> { class SampleSet { public: explicit SampleSet(); + ~SampleSet(); + // Adjust size of counts_ for use with given histogram. void Resize(const Histogram& histogram); void CheckSize(const Histogram& histogram) const; @@ -490,6 +492,8 @@ class LinearHistogram : public Histogram { base::TimeDelta minimum, base::TimeDelta maximum, size_t bucket_count, Flags flags); + virtual ~LinearHistogram(); + protected: LinearHistogram(const std::string& name, Sample minimum, Sample maximum, size_t bucket_count); diff --git a/base/message_loop_proxy.cc b/base/message_loop_proxy.cc new file mode 100644 index 0000000..bc7088d --- /dev/null +++ b/base/message_loop_proxy.cc @@ -0,0 +1,19 @@ +// 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 "base/message_loop_proxy.h" + +namespace base { + +MessageLoopProxy::MessageLoopProxy() { +} + +MessageLoopProxy::~MessageLoopProxy() { +} + +void MessageLoopProxy::OnDestruct() { + delete this; +} + +} // namespace base diff --git a/base/message_loop_proxy.h b/base/message_loop_proxy.h index df50485..20e9e10 100644 --- a/base/message_loop_proxy.h +++ b/base/message_loop_proxy.h @@ -57,13 +57,12 @@ class MessageLoopProxy protected: friend struct MessageLoopProxyTraits; - virtual ~MessageLoopProxy() { } + MessageLoopProxy(); + virtual ~MessageLoopProxy(); // Called when the proxy is about to be deleted. Subclasses can override this // to provide deletion on specific threads. - virtual void OnDestruct() { - delete this; - } + virtual void OnDestruct(); }; struct MessageLoopProxyTraits { diff --git a/base/message_pump.cc b/base/message_pump.cc new file mode 100644 index 0000000..de7c517 --- /dev/null +++ b/base/message_pump.cc @@ -0,0 +1,15 @@ +// 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 "base/message_pump.h" + +namespace base { + +MessagePump::MessagePump() { +} + +MessagePump::~MessagePump() { +} + +} // namespace base diff --git a/base/message_pump.h b/base/message_pump.h index 0cf1420..f8a097d 100644 --- a/base/message_pump.h +++ b/base/message_pump.h @@ -40,7 +40,8 @@ class MessagePump : public RefCountedThreadSafe<MessagePump> { virtual bool DoIdleWork() = 0; }; - virtual ~MessagePump() {} + MessagePump(); + virtual ~MessagePump(); // The Run method is called to enter the message pump's run loop. // diff --git a/base/ref_counted_memory.cc b/base/ref_counted_memory.cc index 6b6328c..0a4a613 100644 --- a/base/ref_counted_memory.cc +++ b/base/ref_counted_memory.cc @@ -4,6 +4,12 @@ #include "base/ref_counted_memory.h" +RefCountedMemory::RefCountedMemory() { +} + +RefCountedMemory::~RefCountedMemory() { +} + const unsigned char* RefCountedStaticMemory::front() const { return data_; } diff --git a/base/ref_counted_memory.h b/base/ref_counted_memory.h index 418405a..08400ec 100644 --- a/base/ref_counted_memory.h +++ b/base/ref_counted_memory.h @@ -27,8 +27,8 @@ class RefCountedMemory : public base::RefCountedThreadSafe<RefCountedMemory> { protected: friend class base::RefCountedThreadSafe<RefCountedMemory>; - - virtual ~RefCountedMemory() {} + RefCountedMemory(); + virtual ~RefCountedMemory(); }; // An implementation of RefCountedMemory, where the ref counting does not diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc index a3c125b..4831e4a 100644 --- a/base/tracked_objects.cc +++ b/base/tracked_objects.cc @@ -91,6 +91,8 @@ ThreadData::Status ThreadData::status_ = ThreadData::UNINITIALIZED; ThreadData::ThreadData() : next_(NULL), message_loop_(MessageLoop::current()) {} +ThreadData::~ThreadData() {} + // static ThreadData* ThreadData::current() { if (!tls_index_.initialized()) @@ -584,6 +586,9 @@ DataCollector::DataCollector() { } } +DataCollector::~DataCollector() { +} + void DataCollector::Append(const ThreadData& thread_data) { // Get copy of data (which is done under ThreadData's lock). ThreadData::BirthMap birth_map; @@ -627,6 +632,13 @@ void DataCollector::AddListOfLivingObjects() { //------------------------------------------------------------------------------ // Aggregation +Aggregation::Aggregation() + : birth_count_(0) { +} + +Aggregation::~Aggregation() { +} + void Aggregation::AddDeathSnapshot(const Snapshot& snapshot) { AddBirth(snapshot.birth()); death_threads_[snapshot.death_thread()]++; diff --git a/base/tracked_objects.h b/base/tracked_objects.h index 5392b9a..b76a295 100644 --- a/base/tracked_objects.h +++ b/base/tracked_objects.h @@ -293,6 +293,7 @@ class DataCollector { // Construct with a list of how many threads should contribute. This helps us // determine (in the async case) when we are done with all contributions. DataCollector(); + ~DataCollector(); // Add all stats from the indicated thread into our arrays. This function is // mutex protected, and *could* be called from any threads (although current @@ -333,7 +334,8 @@ class DataCollector { class Aggregation: public DeathData { public: - Aggregation() : birth_count_(0) {} + Aggregation(); + ~Aggregation(); void AddDeathSnapshot(const Snapshot& snapshot); void AddBirths(const Births& births); @@ -469,6 +471,7 @@ class ThreadData { typedef std::map<const Births*, DeathData> DeathMap; ThreadData(); + ~ThreadData(); // Using Thread Local Store, find the current instance for collecting data. // If an instance does not exist, construct one (and remember it for use on diff --git a/base/waitable_event.h b/base/waitable_event.h index 0a82655..081ad66 100644 --- a/base/waitable_event.h +++ b/base/waitable_event.h @@ -144,10 +144,8 @@ class WaitableEvent { struct WaitableEventKernel : public RefCountedThreadSafe<WaitableEventKernel> { public: - WaitableEventKernel(bool manual_reset, bool initially_signaled) - : manual_reset_(manual_reset), - signaled_(initially_signaled) { - } + WaitableEventKernel(bool manual_reset, bool initially_signaled); + virtual ~WaitableEventKernel(); bool Dequeue(Waiter* waiter, void* tag); diff --git a/base/waitable_event_posix.cc b/base/waitable_event_posix.cc index 793f635..adc521e 100644 --- a/base/waitable_event_posix.cc +++ b/base/waitable_event_posix.cc @@ -335,6 +335,15 @@ size_t WaitableEvent::EnqueueMany // ----------------------------------------------------------------------------- // Private functions... +WaitableEvent::WaitableEventKernel::WaitableEventKernel(bool manual_reset, + bool initially_signaled) + : manual_reset_(manual_reset), + signaled_(initially_signaled) { +} + +WaitableEvent::WaitableEventKernel::~WaitableEventKernel() { +} + // ----------------------------------------------------------------------------- // Wake all waiting waiters. Called with lock held. // ----------------------------------------------------------------------------- diff --git a/chrome/common/message_router.cc b/chrome/common/message_router.cc index b73f2d0..6bd6e95 100644 --- a/chrome/common/message_router.cc +++ b/chrome/common/message_router.cc @@ -4,6 +4,12 @@ #include "chrome/common/message_router.h" +MessageRouter::MessageRouter() { +} + +MessageRouter::~MessageRouter() { +} + void MessageRouter::OnControlMessageReceived(const IPC::Message& msg) { NOTREACHED() << "should override in subclass if you care about control messages"; diff --git a/chrome/common/message_router.h b/chrome/common/message_router.h index 13f763c..6a61091 100644 --- a/chrome/common/message_router.h +++ b/chrome/common/message_router.h @@ -30,8 +30,8 @@ class MessageRouter : public IPC::Channel::Listener, public IPC::Message::Sender { public: - MessageRouter() {} - virtual ~MessageRouter() {} + MessageRouter(); + virtual ~MessageRouter(); // Implemented by subclasses to handle control messages virtual void OnControlMessageReceived(const IPC::Message& msg); diff --git a/media/base/buffers.cc b/media/base/buffers.cc index 4247e39..18401d4 100644 --- a/media/base/buffers.cc +++ b/media/base/buffers.cc @@ -10,4 +10,11 @@ namespace media { const base::TimeDelta StreamSample::kInvalidTimestamp = base::TimeDelta::FromMicroseconds(kint64min); +StreamSample::StreamSample() + : discontinuous_(false) { +} + +StreamSample::~StreamSample() { +} + } // namespace media diff --git a/media/base/buffers.h b/media/base/buffers.h index 438799b2..1b33415 100644 --- a/media/base/buffers.h +++ b/media/base/buffers.h @@ -76,10 +76,8 @@ class StreamSample : public base::RefCountedThreadSafe<StreamSample> { protected: friend class base::RefCountedThreadSafe<StreamSample>; - StreamSample() - : discontinuous_(false) { - } - virtual ~StreamSample() {} + StreamSample(); + virtual ~StreamSample(); base::TimeDelta timestamp_; base::TimeDelta duration_; diff --git a/media/base/factory.cc b/media/base/factory.cc new file mode 100644 index 0000000..685d1e7 --- /dev/null +++ b/media/base/factory.cc @@ -0,0 +1,33 @@ +// 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 "media/base/factory.h" + +namespace media { + +FilterFactory::FilterFactory() {} + +FilterFactory::~FilterFactory() {} + +FilterFactoryCollection::FilterFactoryCollection() {} + +void FilterFactoryCollection::AddFactory(FilterFactory* factory) { + factories_.push_back(factory); +} + +MediaFilter* FilterFactoryCollection::Create(FilterType filter_type, + const MediaFormat& media_format) { + MediaFilter* filter = NULL; + for (FactoryVector::iterator factory = factories_.begin(); + !filter && factory != factories_.end(); + ++factory) { + filter = (*factory)->Create(filter_type, media_format); + } + return filter; +} + +FilterFactoryCollection::~FilterFactoryCollection() {} + + +} // namespace media diff --git a/media/base/factory.h b/media/base/factory.h index b9e637d..d5dd9a7 100644 --- a/media/base/factory.h +++ b/media/base/factory.h @@ -67,34 +67,25 @@ class FilterFactory : public base::RefCountedThreadSafe<FilterFactory> { const MediaFormat& media_format) = 0; friend class base::RefCountedThreadSafe<FilterFactory>; - virtual ~FilterFactory() {} + FilterFactory(); + virtual ~FilterFactory(); }; // Maintains a collection of FilterFactories. class FilterFactoryCollection : public FilterFactory { public: - FilterFactoryCollection() {} + FilterFactoryCollection(); // Adds a factory to the end of the collection. - void AddFactory(FilterFactory* factory) { - factories_.push_back(factory); - } + void AddFactory(FilterFactory* factory); protected: // Attempts to create a filter by walking down the list of filter factories. - MediaFilter* Create(FilterType filter_type, const MediaFormat& media_format) { - MediaFilter* filter = NULL; - for (FactoryVector::iterator factory = factories_.begin(); - !filter && factory != factories_.end(); - ++factory) { - filter = (*factory)->Create(filter_type, media_format); - } - return filter; - } + MediaFilter* Create(FilterType filter_type, const MediaFormat& media_format); private: - ~FilterFactoryCollection() {} + ~FilterFactoryCollection(); typedef std::vector< scoped_refptr<FilterFactory> > FactoryVector; FactoryVector factories_; diff --git a/media/base/filters.cc b/media/base/filters.cc index 0a428b9..d6fb31e 100644 --- a/media/base/filters.cc +++ b/media/base/filters.cc @@ -77,4 +77,6 @@ void MediaFilter::OnAudioRendererDisabled() { MediaFilter::~MediaFilter() {} +DemuxerStream::~DemuxerStream() {} + } // namespace media diff --git a/media/base/filters.h b/media/base/filters.h index 30e86a6..65a33ee 100644 --- a/media/base/filters.h +++ b/media/base/filters.h @@ -226,7 +226,7 @@ class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> { virtual void* QueryInterface(const char* interface_id) { return NULL; } friend class base::RefCountedThreadSafe<DemuxerStream>; - virtual ~DemuxerStream() {} + virtual ~DemuxerStream(); }; diff --git a/media/media.gyp b/media/media.gyp index 5685729..618bfcb 100644 --- a/media/media.gyp +++ b/media/media.gyp @@ -73,6 +73,7 @@ 'base/data_buffer.h', 'base/djb2.cc', 'base/djb2.h', + 'base/factory.cc', 'base/factory.h', 'base/filter_host.h', 'base/filters.cc', diff --git a/net/base/host_resolver.cc b/net/base/host_resolver.cc index abef6f5..fbd63bd 100644 --- a/net/base/host_resolver.cc +++ b/net/base/host_resolver.cc @@ -19,6 +19,12 @@ HostResolver::RequestInfo::RequestInfo(const HostPortPair& host_port_pair) priority_(MEDIUM) { } +HostResolver::HostResolver() { +} + +HostResolver::~HostResolver() { +} + SingleRequestHostResolver::SingleRequestHostResolver(HostResolver* resolver) : resolver_(resolver), cur_request_(NULL), diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h index 58ea8bd..1c0982d 100644 --- a/net/base/host_resolver.h +++ b/net/base/host_resolver.h @@ -176,12 +176,12 @@ class HostResolver : public base::RefCounted<HostResolver> { protected: friend class base::RefCounted<HostResolver>; - HostResolver() { } + HostResolver(); // If any completion callbacks are pending when the resolver is destroyed, // the host resolutions are cancelled, and the completion callbacks will not // be called. - virtual ~HostResolver() {} + virtual ~HostResolver(); private: DISALLOW_COPY_AND_ASSIGN(HostResolver); diff --git a/net/base/x509_cert_types.h b/net/base/x509_cert_types.h index 43d05dd..7723c22 100644 --- a/net/base/x509_cert_types.h +++ b/net/base/x509_cert_types.h @@ -42,8 +42,7 @@ struct SHA1Fingerprint { unsigned char data[20]; }; -class SHA1FingerprintLessThan - : public std::binary_function<SHA1Fingerprint, SHA1Fingerprint, bool> { +class SHA1FingerprintLessThan { public: bool operator() (const SHA1Fingerprint& lhs, const SHA1Fingerprint& rhs) const { diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index e0021a8..7936b8f 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -184,6 +184,10 @@ bool NeedToGrowBlockFile(const disk_cache::BlockFileHeader* header, namespace disk_cache { +BlockFiles::BlockFiles(const FilePath& path) + : init_(false), zero_buffer_(NULL), path_(path) { +} + BlockFiles::~BlockFiles() { if (zero_buffer_) delete[] zero_buffer_; diff --git a/net/disk_cache/block_files.h b/net/disk_cache/block_files.h index 2e41750..5427a58 100644 --- a/net/disk_cache/block_files.h +++ b/net/disk_cache/block_files.h @@ -23,8 +23,7 @@ namespace disk_cache { // This class handles the set of block-files open by the disk cache. class BlockFiles { public: - explicit BlockFiles(const FilePath& path) - : init_(false), zero_buffer_(NULL), path_(path) {} + explicit BlockFiles(const FilePath& path); ~BlockFiles(); // Performs the object initialization. create_files indicates if the backing diff --git a/net/disk_cache/in_flight_io.cc b/net/disk_cache/in_flight_io.cc index 6112a9c..5c859af 100644 --- a/net/disk_cache/in_flight_io.cc +++ b/net/disk_cache/in_flight_io.cc @@ -8,6 +8,10 @@ namespace disk_cache { +BackgroundIO::BackgroundIO(InFlightIO* controller) + : controller_(controller), result_(-1), io_completed_(true, false) { +} + // Runs on the primary thread. void BackgroundIO::OnIOSignalled() { if (controller_) @@ -19,6 +23,8 @@ void BackgroundIO::Cancel() { controller_ = NULL; } +BackgroundIO::~BackgroundIO() {} + // Runs on the background thread. void BackgroundIO::NotifyController() { controller_->OnIOComplete(this); @@ -26,6 +32,14 @@ void BackgroundIO::NotifyController() { // --------------------------------------------------------------------------- +InFlightIO::InFlightIO() + : callback_thread_(base::MessageLoopProxy::CreateForCurrentThread()), + running_(false), single_thread_(false) { +} + +InFlightIO::~InFlightIO() { +} + void InFlightIO::WaitForPendingIO() { while (!io_list_.empty()) { // Block the current thread until all pending IO completes. diff --git a/net/disk_cache/in_flight_io.h b/net/disk_cache/in_flight_io.h index 70a3d8c..6c5f8ab 100644 --- a/net/disk_cache/in_flight_io.h +++ b/net/disk_cache/in_flight_io.h @@ -24,8 +24,7 @@ class BackgroundIO : public base::RefCountedThreadSafe<BackgroundIO> { // is keeping track of all operations. When done, we notify the controller // (we do NOT invoke the callback), in the worker thead that completed the // operation. - explicit BackgroundIO(InFlightIO* controller) - : controller_(controller), result_(-1), io_completed_(true, false) {} + explicit BackgroundIO(InFlightIO* controller); // This method signals the controller that this operation is finished, in the // original thread. In practice, this is a RunableMethod that allows @@ -47,7 +46,7 @@ class BackgroundIO : public base::RefCountedThreadSafe<BackgroundIO> { } protected: - virtual ~BackgroundIO() {} + virtual ~BackgroundIO(); InFlightIO* controller_; // The controller that tracks all operations. int result_; // Final operation result. @@ -89,10 +88,8 @@ class BackgroundIO : public base::RefCountedThreadSafe<BackgroundIO> { // of just waiting for step 7. class InFlightIO { public: - InFlightIO() - : callback_thread_(base::MessageLoopProxy::CreateForCurrentThread()), - running_(false), single_thread_(false) {} - virtual ~InFlightIO() {} + InFlightIO(); + virtual ~InFlightIO(); // Blocks the current thread until all IO operations tracked by this object // complete. diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc index 34c002b..e7c6736 100644 --- a/net/disk_cache/rankings.cc +++ b/net/disk_cache/rankings.cc @@ -176,6 +176,20 @@ void GenerateCrash(CrashLocation location) { namespace disk_cache { +Rankings::Iterator::Iterator(Rankings* rankings) { + memset(this, 0, sizeof(Iterator)); + my_rankings = rankings; +} + +Rankings::Iterator::~Iterator() { + for (int i = 0; i < 3; i++) + ScopedRankingsBlock(my_rankings, nodes[i]); +} + +Rankings::Rankings() : init_(false) {} + +Rankings::~Rankings() {} + bool Rankings::Init(BackendImpl* backend, bool count_lists) { DCHECK(!init_); if (init_) diff --git a/net/disk_cache/rankings.h b/net/disk_cache/rankings.h index 8347b4c..1914cf6 100644 --- a/net/disk_cache/rankings.h +++ b/net/disk_cache/rankings.h @@ -96,18 +96,12 @@ class Rankings { List list; // Which entry was returned to the user. CacheRankingsBlock* nodes[3]; // Nodes on the first three lists. Rankings* my_rankings; - explicit Iterator(Rankings* rankings) { - memset(this, 0, sizeof(Iterator)); - my_rankings = rankings; - } - ~Iterator() { - for (int i = 0; i < 3; i++) - ScopedRankingsBlock(my_rankings, nodes[i]); - } + explicit Iterator(Rankings* rankings); + ~Iterator(); }; - Rankings() : init_(false) {} - ~Rankings() {} + Rankings(); + ~Rankings(); bool Init(BackendImpl* backend, bool count_lists); diff --git a/net/disk_cache/trace.cc b/net/disk_cache/trace.cc index 7a61e20..9578339 100644 --- a/net/disk_cache/trace.cc +++ b/net/disk_cache/trace.cc @@ -57,6 +57,14 @@ TraceObject* TraceObject::GetTraceObject() { return s_trace_object; } +TraceObject::TraceObject() { + InitTrace(); +} + +TraceObject::~TraceObject() { + DestroyTrace(); +} + #if ENABLE_TRACING static TraceBuffer* s_trace_buffer = NULL; diff --git a/net/disk_cache/trace.h b/net/disk_cache/trace.h index 25d9b33..a5aa651 100644 --- a/net/disk_cache/trace.h +++ b/net/disk_cache/trace.h @@ -27,13 +27,8 @@ class TraceObject : public base::RefCounted<TraceObject> { static TraceObject* GetTraceObject(); private: - TraceObject() { - InitTrace(); - } - - ~TraceObject() { - DestroyTrace(); - } + TraceObject(); + ~TraceObject(); DISALLOW_COPY_AND_ASSIGN(TraceObject); }; diff --git a/net/http/http_util.cc b/net/http/http_util.cc index a559c06..1098a06 100644 --- a/net/http/http_util.cc +++ b/net/http/http_util.cc @@ -631,6 +631,9 @@ HttpUtil::HeadersIterator::HeadersIterator(string::const_iterator headers_begin, : lines_(headers_begin, headers_end, line_delimiter) { } +HttpUtil::HeadersIterator::~HeadersIterator() { +} + bool HttpUtil::HeadersIterator::GetNext() { while (lines_.GetNext()) { name_begin_ = lines_.token_begin(); @@ -683,6 +686,9 @@ HttpUtil::ValuesIterator::ValuesIterator( values_.set_quote_chars("\'\""); } +HttpUtil::ValuesIterator::~ValuesIterator() { +} + bool HttpUtil::ValuesIterator::GetNext() { while (values_.GetNext()) { value_begin_ = values_.token_begin(); diff --git a/net/http/http_util.h b/net/http/http_util.h index 6daf173..776b876 100644 --- a/net/http/http_util.h +++ b/net/http/http_util.h @@ -167,6 +167,7 @@ class HttpUtil { HeadersIterator(std::string::const_iterator headers_begin, std::string::const_iterator headers_end, const std::string& line_delimiter); + ~HeadersIterator(); // Advances the iterator to the next header, if any. Returns true if there // is a next header. Use name* and values* methods to access the resultant @@ -229,6 +230,7 @@ class HttpUtil { ValuesIterator(std::string::const_iterator values_begin, std::string::const_iterator values_end, char delimiter); + ~ValuesIterator(); // Advances the iterator to the next value, if any. Returns true if there // is a next value. Use value* methods to access the resultant value. diff --git a/net/spdy/spdy_settings_storage.cc b/net/spdy/spdy_settings_storage.cc index 32069b7..dc9bdcd 100644 --- a/net/spdy/spdy_settings_storage.cc +++ b/net/spdy/spdy_settings_storage.cc @@ -11,6 +11,9 @@ namespace net { SpdySettingsStorage::SpdySettingsStorage() { } +SpdySettingsStorage::~SpdySettingsStorage() { +} + const spdy::SpdySettings& SpdySettingsStorage::Get( const HostPortPair& host_port_pair) const { SettingsMap::const_iterator it = settings_map_.find(host_port_pair); diff --git a/net/spdy/spdy_settings_storage.h b/net/spdy/spdy_settings_storage.h index 09d829e..999f016 100644 --- a/net/spdy/spdy_settings_storage.h +++ b/net/spdy/spdy_settings_storage.h @@ -18,6 +18,7 @@ namespace net { class SpdySettingsStorage { public: SpdySettingsStorage(); + ~SpdySettingsStorage(); // Get a copy of the SpdySettings stored for a host. // If no settings are stored, returns an empty set of settings. diff --git a/skia/ext/convolver.cc b/skia/ext/convolver.cc index ec0c014..a220d02 100644 --- a/skia/ext/convolver.cc +++ b/skia/ext/convolver.cc @@ -223,6 +223,13 @@ void ConvolveVertically(const ConvolutionFilter1D::Fixed* filter_values, // ConvolutionFilter1D --------------------------------------------------------- +ConvolutionFilter1D::ConvolutionFilter1D() + : max_filter_(0) { +} + +ConvolutionFilter1D::~ConvolutionFilter1D() { +} + void ConvolutionFilter1D::AddFilter(int filter_offset, const float* filter_values, int filter_length) { diff --git a/skia/ext/convolver.h b/skia/ext/convolver.h index 692c803..97f191c 100644 --- a/skia/ext/convolver.h +++ b/skia/ext/convolver.h @@ -30,8 +30,8 @@ class ConvolutionFilter1D { typedef short Fixed; - ConvolutionFilter1D() : max_filter_(0) { - } + ConvolutionFilter1D(); + ~ConvolutionFilter1D(); // Convert between floating point and our fixed point representation. static Fixed FloatToFixed(float f) { diff --git a/webkit/glue/plugins/pepper_resource.cc b/webkit/glue/plugins/pepper_resource.cc index b17fc31..cf7a7fe 100644 --- a/webkit/glue/plugins/pepper_resource.cc +++ b/webkit/glue/plugins/pepper_resource.cc @@ -9,6 +9,13 @@ namespace pepper { +Resource::Resource(PluginModule* module) + : resource_id_(0), module_(module) { +} + +Resource::~Resource() { +} + PP_Resource Resource::GetReference() { ResourceTracker *tracker = ResourceTracker::Get(); if (resource_id_) diff --git a/webkit/glue/plugins/pepper_resource.h b/webkit/glue/plugins/pepper_resource.h index 3bad113..cab6f32 100644 --- a/webkit/glue/plugins/pepper_resource.h +++ b/webkit/glue/plugins/pepper_resource.h @@ -38,8 +38,8 @@ class Widget; class Resource : public base::RefCountedThreadSafe<Resource> { public: - explicit Resource(PluginModule* module) : resource_id_(0), module_(module) {} - virtual ~Resource() {} + explicit Resource(PluginModule* module); + virtual ~Resource(); // Returns NULL if the resource is invalid or is a different type. template<typename T> diff --git a/webkit/glue/plugins/pepper_resource_tracker.cc b/webkit/glue/plugins/pepper_resource_tracker.cc index 869874e..9ee54f8 100644 --- a/webkit/glue/plugins/pepper_resource_tracker.cc +++ b/webkit/glue/plugins/pepper_resource_tracker.cc @@ -21,6 +21,13 @@ scoped_refptr<Resource> ResourceTracker::GetResource(PP_Resource res) const { return result->second.first; } +ResourceTracker::ResourceTracker() + : last_id_(0) { +} + +ResourceTracker::~ResourceTracker() { +} + PP_Resource ResourceTracker::AddResource(Resource* resource) { // If the plugin manages to create 4B resources... if (last_id_ == std::numeric_limits<PP_Resource>::max()) { diff --git a/webkit/glue/plugins/pepper_resource_tracker.h b/webkit/glue/plugins/pepper_resource_tracker.h index 20ba6db..59f02d2 100644 --- a/webkit/glue/plugins/pepper_resource_tracker.h +++ b/webkit/glue/plugins/pepper_resource_tracker.h @@ -53,8 +53,8 @@ class ResourceTracker { friend class Resource; // Prohibit creation other then by the Singleton class. - ResourceTracker() : last_id_(0) {} - ~ResourceTracker() {} + ResourceTracker(); + ~ResourceTracker(); // Adds the given resource to the tracker and assigns it a resource ID and // refcount of 1. The assigned resource ID will be returned. Used only by the diff --git a/webkit/glue/plugins/webplugin.cc b/webkit/glue/plugins/webplugin.cc index 6443318..18f722b 100644 --- a/webkit/glue/plugins/webplugin.cc +++ b/webkit/glue/plugins/webplugin.cc @@ -12,6 +12,9 @@ WebPluginGeometry::WebPluginGeometry() visible(false) { } +WebPluginGeometry::~WebPluginGeometry() { +} + bool WebPluginGeometry::Equals(const WebPluginGeometry& rhs) const { return window == rhs.window && window_rect == rhs.window_rect && diff --git a/webkit/glue/plugins/webplugin.h b/webkit/glue/plugins/webplugin.h index 1813842..19c6cb0 100644 --- a/webkit/glue/plugins/webplugin.h +++ b/webkit/glue/plugins/webplugin.h @@ -33,6 +33,7 @@ class WebPluginResourceClient; // Describes the new location for a plugin window. struct WebPluginGeometry { WebPluginGeometry(); + ~WebPluginGeometry(); bool Equals(const WebPluginGeometry& rhs) const; |