diff options
| author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 17:08:20 +0000 | 
|---|---|---|
| committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 17:08:20 +0000 | 
| commit | 601858c0f72ea9693a4796fe6b48558efde46ed7 (patch) | |
| tree | f9102a4e748ce2f2257f86a748ba6ecfb7087141 | |
| parent | a0709c0dafd07a463a1e9b3553554a0be6cec862 (diff) | |
| download | chromium_src-601858c0f72ea9693a4796fe6b48558efde46ed7.zip chromium_src-601858c0f72ea9693a4796fe6b48558efde46ed7.tar.gz chromium_src-601858c0f72ea9693a4796fe6b48558efde46ed7.tar.bz2 | |
FBTF: Move more ctors/dtors from headers to implementation.
- Adding/Moving dtors of objects that have CancelableRequestConsumers shaves
  three megs off browser.a.
- Adding/Moving dtors of objects that have ScopedRunnableMethodFactories only
  shaved 100k off browser.a/renderer.a.
- Adding/Moving dtors of objects that used some form of base::*Timer<> was
  negligible; there were only a few classes that had a Timer but had a
  ctor/dtor in the header after the previous cleanups.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3278006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58192 0039d316-1c4b-4281-b951-d872f2087c98
58 files changed, 222 insertions, 66 deletions
| diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc index da748d7..911f429 100644 --- a/chrome/browser/autocomplete/history_contents_provider.cc +++ b/chrome/browser/autocomplete/history_contents_provider.cc @@ -50,6 +50,18 @@ bool CompareMatchRelevance(const MatchReference& a, const MatchReference& b) {  using history::HistoryDatabase; +HistoryContentsProvider::HistoryContentsProvider(ACProviderListener* listener, +                                                 Profile* profile) +    : AutocompleteProvider(listener, profile, "HistoryContents"), +      star_title_count_(0), +      star_contents_count_(0), +      title_count_(0), +      contents_count_(0), +      input_type_(AutocompleteInput::INVALID), +      trim_http_(false), +      have_results_(false) { +} +  void HistoryContentsProvider::Start(const AutocompleteInput& input,                                      bool minimal_changes) {    matches_.clear(); @@ -138,6 +150,9 @@ void HistoryContentsProvider::Stop() {    have_results_ = false;  } +HistoryContentsProvider::~HistoryContentsProvider() { +} +  void HistoryContentsProvider::QueryComplete(HistoryService::Handle handle,                                              history::QueryResults* results) {    results_.AppendResultsBySwapping(results, true); diff --git a/chrome/browser/autocomplete/history_contents_provider.h b/chrome/browser/autocomplete/history_contents_provider.h index 510b5cf..31b75ec 100644 --- a/chrome/browser/autocomplete/history_contents_provider.h +++ b/chrome/browser/autocomplete/history_contents_provider.h @@ -22,16 +22,7 @@ struct TitleMatch;  //   This is synchronous.  class HistoryContentsProvider : public AutocompleteProvider {   public: -  HistoryContentsProvider(ACProviderListener* listener, Profile* profile) -      : AutocompleteProvider(listener, profile, "HistoryContents"), -        star_title_count_(0), -        star_contents_count_(0), -        title_count_(0), -        contents_count_(0), -        input_type_(AutocompleteInput::INVALID), -        trim_http_(false), -        have_results_(false) { -  } +  HistoryContentsProvider(ACProviderListener* listener, Profile* profile);    // As necessary asks the history service for the relevant results. When    // done SetResults is invoked. @@ -50,7 +41,7 @@ class HistoryContentsProvider : public AutocompleteProvider {    static const size_t kMaxMatchCount = 50;   private: -  ~HistoryContentsProvider() {} +  ~HistoryContentsProvider();    void QueryComplete(HistoryService::Handle handle,                       history::QueryResults* results); diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index 2c67f7d..0ec478c 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -54,6 +54,14 @@ void SearchProvider::Providers::Set(const TemplateURL* default_provider,      cached_keyword_provider_ = *keyword_provider;  } +SearchProvider::SearchProvider(ACProviderListener* listener, Profile* profile) +    : AutocompleteProvider(listener, profile, "Search"), +      have_history_results_(false), +      history_request_pending_(false), +      suggest_results_pending_(0), +      have_suggest_results_(false) { +} +  void SearchProvider::Start(const AutocompleteInput& input,                             bool minimal_changes) {    matches_.clear(); @@ -198,6 +206,9 @@ void SearchProvider::OnURLFetchComplete(const URLFetcher* source,    listener_->OnProviderUpdate(!suggest_results->empty());  } +SearchProvider::~SearchProvider() { +} +  void SearchProvider::StartOrStopHistoryQuery(bool minimal_changes) {    // For the minimal_changes case, if we finished the previous query and still    // have its results, or are allowed to keep running it, just do that, rather diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h index 02adb5c..73b70fe 100644 --- a/chrome/browser/autocomplete/search_provider.h +++ b/chrome/browser/autocomplete/search_provider.h @@ -44,13 +44,7 @@ class Value;  class SearchProvider : public AutocompleteProvider,                         public URLFetcher::Delegate {   public: -  SearchProvider(ACProviderListener* listener, Profile* profile) -      : AutocompleteProvider(listener, profile, "Search"), -        have_history_results_(false), -        history_request_pending_(false), -        suggest_results_pending_(0), -        have_suggest_results_(false) { -  } +  SearchProvider(ACProviderListener* listener, Profile* profile);  #if defined(UNIT_TEST)    static void set_query_suggest_immediately(bool value) { @@ -78,7 +72,7 @@ class SearchProvider : public AutocompleteProvider,    static const int kKeywordProviderURLFetcherID;   private: -  ~SearchProvider() {} +  ~SearchProvider();    // Manages the providers (TemplateURLs) used by SearchProvider. Two providers    // may be used: diff --git a/chrome/browser/bookmarks/bookmark_drop_info.cc b/chrome/browser/bookmarks/bookmark_drop_info.cc index e6032b5..9a6106d 100644 --- a/chrome/browser/bookmarks/bookmark_drop_info.cc +++ b/chrome/browser/bookmarks/bookmark_drop_info.cc @@ -22,6 +22,9 @@ BookmarkDropInfo::BookmarkDropInfo(gfx::NativeWindow wnd, int top_margin)        scroll_up_(false) {  } +BookmarkDropInfo::~BookmarkDropInfo() { +} +  void BookmarkDropInfo::Update(const views::DropTargetEvent& event) {    source_operations_ = event.GetSourceOperations();    is_control_down_ = event.IsControlDown(); diff --git a/chrome/browser/bookmarks/bookmark_drop_info.h b/chrome/browser/bookmarks/bookmark_drop_info.h index 105bb79..358a0f5 100644 --- a/chrome/browser/bookmarks/bookmark_drop_info.h +++ b/chrome/browser/bookmarks/bookmark_drop_info.h @@ -22,7 +22,7 @@ class DropTargetEvent;  class BookmarkDropInfo {   public:    BookmarkDropInfo(gfx::NativeWindow hwnd, int top_margin); -  virtual ~BookmarkDropInfo() {} +  virtual ~BookmarkDropInfo();    // Invoke this from OnDragUpdated. It resets source_operations,    // is_control_down, last_y and updates the autoscroll timer as necessary. diff --git a/chrome/browser/dom_ui/most_visited_handler.cc b/chrome/browser/dom_ui/most_visited_handler.cc index 5d2d4f5..f152dfe 100644 --- a/chrome/browser/dom_ui/most_visited_handler.cc +++ b/chrome/browser/dom_ui/most_visited_handler.cc @@ -62,6 +62,9 @@ MostVisitedHandler::MostVisitedHandler()        got_first_most_visited_request_(false) {  } +MostVisitedHandler::~MostVisitedHandler() { +} +  DOMMessageHandler* MostVisitedHandler::Attach(DOMUI* dom_ui) {    url_blacklist_ = dom_ui->GetProfile()->GetPrefs()->        GetMutableDictionary(prefs::kNTPMostVisitedURLsBlacklist); diff --git a/chrome/browser/dom_ui/most_visited_handler.h b/chrome/browser/dom_ui/most_visited_handler.h index bdb42e2..92aaa2e 100644 --- a/chrome/browser/dom_ui/most_visited_handler.h +++ b/chrome/browser/dom_ui/most_visited_handler.h @@ -28,7 +28,7 @@ class MostVisitedHandler : public DOMMessageHandler,   public:    MostVisitedHandler(); -  virtual ~MostVisitedHandler() { } +  virtual ~MostVisitedHandler();    // DOMMessageHandler override and implementation.    virtual DOMMessageHandler* Attach(DOMUI* dom_ui); diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc index d232a87..26b65c4 100644 --- a/chrome/browser/download/download_history.cc +++ b/chrome/browser/download/download_history.cc @@ -23,6 +23,9 @@ DownloadHistory::DownloadHistory(Profile* profile)    DCHECK(profile);  } +DownloadHistory::~DownloadHistory() { +} +  void DownloadHistory::Load(HistoryService::DownloadQueryCallback* callback) {    DCHECK(callback);    HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); diff --git a/chrome/browser/download/download_history.h b/chrome/browser/download/download_history.h index 52f93a0..d7f9188 100644 --- a/chrome/browser/download/download_history.h +++ b/chrome/browser/download/download_history.h @@ -25,6 +25,7 @@ class DownloadHistory {    static const int kUninitializedHandle;    explicit DownloadHistory(Profile* profile); +  ~DownloadHistory();    // Retrieves DownloadCreateInfos saved in the history.    void Load(HistoryService::DownloadQueryCallback* callback); diff --git a/chrome/browser/extensions/extension_history_api.cc b/chrome/browser/extensions/extension_history_api.cc index 82be3dc..515e918b 100644 --- a/chrome/browser/extensions/extension_history_api.cc +++ b/chrome/browser/extensions/extension_history_api.cc @@ -184,6 +184,12 @@ bool HistoryFunction::GetTimeFromValue(Value* value, base::Time* time) {    return true;  } +HistoryFunctionWithCallback::HistoryFunctionWithCallback() { +} + +HistoryFunctionWithCallback::~HistoryFunctionWithCallback() { +} +  bool HistoryFunctionWithCallback::RunImpl() {    AddRef();  // Balanced in SendAysncRepose() and below.    bool retval = RunAsyncImpl(); diff --git a/chrome/browser/extensions/extension_history_api.h b/chrome/browser/extensions/extension_history_api.h index 2f43501..9bd89e3 100644 --- a/chrome/browser/extensions/extension_history_api.h +++ b/chrome/browser/extensions/extension_history_api.h @@ -71,6 +71,9 @@ class HistoryFunction : public AsyncExtensionFunction {  // chrome services and the extension thread.  class HistoryFunctionWithCallback : public HistoryFunction {   public: +  HistoryFunctionWithCallback(); +  ~HistoryFunctionWithCallback(); +    // Return true if the async call was completed, false otherwise.    virtual bool RunAsyncImpl() = 0; diff --git a/chrome/browser/favicon_service.cc b/chrome/browser/favicon_service.cc index 94baaf7..51b9098 100644 --- a/chrome/browser/favicon_service.cc +++ b/chrome/browser/favicon_service.cc @@ -84,6 +84,9 @@ void FaviconService::SetFavicon(const GURL& page_url,      hs->SetFavicon(page_url, icon_url, image_data);  } +FaviconService::~FaviconService() { +} +  void FaviconService::ForwardEmptyResultAsync(GetFaviconRequest* request) {    request->ForwardResultAsync(FaviconDataCallback::TupleType(request->handle(),          false, NULL, false, GURL())); diff --git a/chrome/browser/favicon_service.h b/chrome/browser/favicon_service.h index e22e81c..b6ef85b 100644 --- a/chrome/browser/favicon_service.h +++ b/chrome/browser/favicon_service.h @@ -90,7 +90,7 @@ class FaviconService : public CancelableRequestProvider,   private:    friend class base::RefCountedThreadSafe<FaviconService>; -  ~FaviconService() {} +  ~FaviconService();    Profile* profile_; diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc index ed24b8b..04542a6 100644 --- a/chrome/browser/net/sdch_dictionary_fetcher.cc +++ b/chrome/browser/net/sdch_dictionary_fetcher.cc @@ -4,9 +4,18 @@  #include "chrome/browser/net/sdch_dictionary_fetcher.h" +#include "base/compiler_specific.h"  #include "chrome/browser/profile.h"  #include "net/url_request/url_request_status.h" +SdchDictionaryFetcher::SdchDictionaryFetcher() +    : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), +      task_is_pending_(false) { +} + +SdchDictionaryFetcher::~SdchDictionaryFetcher() { +} +  void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) {    // Avoid pushing duplicate copy onto queue.  We may fetch this url again later    // and get a different dictionary, but there is no reason to have it in the diff --git a/chrome/browser/net/sdch_dictionary_fetcher.h b/chrome/browser/net/sdch_dictionary_fetcher.h index 886c980..32bf0d7 100644 --- a/chrome/browser/net/sdch_dictionary_fetcher.h +++ b/chrome/browser/net/sdch_dictionary_fetcher.h @@ -14,7 +14,6 @@  #include <set>  #include <string> -#include "base/compiler_specific.h"  #include "base/scoped_ptr.h"  #include "base/task.h"  #include "chrome/common/net/url_fetcher.h" @@ -23,10 +22,8 @@  class SdchDictionaryFetcher : public URLFetcher::Delegate,                                public SdchFetcher {   public: -  SdchDictionaryFetcher() : -      ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), -      task_is_pending_(false) {} -  virtual ~SdchDictionaryFetcher() {} +  SdchDictionaryFetcher(); +  virtual ~SdchDictionaryFetcher();    // Implementation of SdchFetcher class.    // This method gets the requested dictionary, and then calls back into the @@ -87,7 +84,6 @@ class SdchDictionaryFetcher : public URLFetcher::Delegate,    // TODO(jar): Try to augment the SDCH proposal to include this restiction.    std::set<GURL> attempted_load_; -    DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher);  }; diff --git a/chrome/browser/net/url_request_slow_http_job.cc b/chrome/browser/net/url_request_slow_http_job.cc index 3d143b07..a8205f0 100644 --- a/chrome/browser/net/url_request_slow_http_job.cc +++ b/chrome/browser/net/url_request_slow_http_job.cc @@ -53,6 +53,9 @@ void URLRequestSlowHTTPJob::Start() {                       &URLRequestSlowHTTPJob::RealStart);  } +URLRequestSlowHTTPJob::~URLRequestSlowHTTPJob() { +} +  void URLRequestSlowHTTPJob::RealStart() {    URLRequestMockHTTPJob::Start();  } diff --git a/chrome/browser/net/url_request_slow_http_job.h b/chrome/browser/net/url_request_slow_http_job.h index 0362106..fab7a01 100644 --- a/chrome/browser/net/url_request_slow_http_job.h +++ b/chrome/browser/net/url_request_slow_http_job.h @@ -28,7 +28,7 @@ class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob {    virtual void Start();   private: -  ~URLRequestSlowHTTPJob() {} +  ~URLRequestSlowHTTPJob();    void RealStart(); diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc index 5d15639..997e2b6 100644 --- a/chrome/browser/page_info_model.cc +++ b/chrome/browser/page_info_model.cc @@ -202,6 +202,9 @@ PageInfoModel::PageInfoModel(Profile* profile,    }  } +PageInfoModel::~PageInfoModel() { +} +  int PageInfoModel::GetSectionCount() {    return sections_.size();  } @@ -254,3 +257,6 @@ void PageInfoModel::OnGotVisitCountToHost(HistoryService::Handle handle,  void PageInfoModel::RegisterPrefs(PrefService* prefs) {    prefs->RegisterDictionaryPref(prefs::kPageInfoWindowPlacement);  } + +PageInfoModel::PageInfoModel() { +} diff --git a/chrome/browser/page_info_model.h b/chrome/browser/page_info_model.h index 08a9b56..e46ab8d 100644 --- a/chrome/browser/page_info_model.h +++ b/chrome/browser/page_info_model.h @@ -78,6 +78,7 @@ class PageInfoModel {                  const NavigationEntry::SSLStatus& ssl,                  bool show_history,                  PageInfoModelObserver* observer); +  ~PageInfoModel();    int GetSectionCount();    SectionInfo GetSectionInfo(int index); @@ -92,7 +93,7 @@ class PageInfoModel {   protected:    // Testing constructor. DO NOT USE. -  PageInfoModel() {} +  PageInfoModel();    PageInfoModelObserver* observer_; diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc index a58ea6b..911edf8 100644 --- a/chrome/browser/renderer_host/download_resource_handler.cc +++ b/chrome/browser/renderer_host/download_resource_handler.cc @@ -205,6 +205,9 @@ void DownloadResourceHandler::CheckWriteProgress() {    }  } +DownloadResourceHandler::~DownloadResourceHandler() { +} +  void DownloadResourceHandler::StartPauseTimer() {    if (!pause_timer_.IsRunning())      pause_timer_.Start(base::TimeDelta::FromMilliseconds(kThrottleTimeMs), this, diff --git a/chrome/browser/renderer_host/download_resource_handler.h b/chrome/browser/renderer_host/download_resource_handler.h index b2caa0a..1621bbc 100644 --- a/chrome/browser/renderer_host/download_resource_handler.h +++ b/chrome/browser/renderer_host/download_resource_handler.h @@ -65,7 +65,7 @@ class DownloadResourceHandler : public ResourceHandler {    void CheckWriteProgress();   private: -  ~DownloadResourceHandler() {} +  ~DownloadResourceHandler();    void StartPauseTimer(); diff --git a/chrome/browser/sync/glue/history_model_worker.cc b/chrome/browser/sync/glue/history_model_worker.cc index df0187d..1d4225e 100644 --- a/chrome/browser/sync/glue/history_model_worker.cc +++ b/chrome/browser/sync/glue/history_model_worker.cc @@ -42,6 +42,9 @@ HistoryModelWorker::HistoryModelWorker(HistoryService* history_service)    : history_service_(history_service) {  } +HistoryModelWorker::~HistoryModelWorker() { +} +  void HistoryModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) {    WaitableEvent done(false, false);    scoped_refptr<WorkerTask> task = new WorkerTask(work, &done); diff --git a/chrome/browser/sync/glue/history_model_worker.h b/chrome/browser/sync/glue/history_model_worker.h index baac2b3..64b59f6 100644 --- a/chrome/browser/sync/glue/history_model_worker.h +++ b/chrome/browser/sync/glue/history_model_worker.h @@ -27,6 +27,7 @@ class HistoryModelWorker : public browser_sync::ModelSafeWorker,                             public CancelableRequestConsumerBase {   public:    explicit HistoryModelWorker(HistoryService* history_service); +  virtual ~HistoryModelWorker();    // ModelSafeWorker implementation. Called on syncapi SyncerThread.    void DoWorkAndWaitUntilDone(Callback0::Type* work); diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 1bb022c..b570c4f 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -313,6 +313,9 @@ bool SyncBackendHost::RequestResume() {    return true;  } +SyncBackendHost::Core::~Core() { +} +  void SyncBackendHost::Core::NotifyPaused() {    NotificationService::current()->Notify(NotificationType::SYNC_PAUSED,                                           NotificationService::AllSources(), diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index ccf0a5d..2b8680d 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.h @@ -323,7 +323,7 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {      friend class base::RefCountedThreadSafe<SyncBackendHost::Core>;      friend class SyncBackendHostForProfileSyncTest; -    ~Core() {} +    ~Core();      // Sends a SYNC_PAUSED notification to the notification service on      // the UI thread. diff --git a/chrome/browser/visitedlink_event_listener.cc b/chrome/browser/visitedlink_event_listener.cc index ad43ba0..3c06608 100644 --- a/chrome/browser/visitedlink_event_listener.cc +++ b/chrome/browser/visitedlink_event_listener.cc @@ -13,6 +13,12 @@ using base::TimeDelta;  // The amount of time we wait to accumulate visited link additions.  static const int kCommitIntervalMs = 100; +VisitedLinkEventListener::VisitedLinkEventListener() { +} + +VisitedLinkEventListener::~VisitedLinkEventListener() { +} +  void VisitedLinkEventListener::NewTable(base::SharedMemory* table_memory) {    if (!table_memory)      return; diff --git a/chrome/browser/visitedlink_event_listener.h b/chrome/browser/visitedlink_event_listener.h index 3a73272..00a7392 100644 --- a/chrome/browser/visitedlink_event_listener.h +++ b/chrome/browser/visitedlink_event_listener.h @@ -19,8 +19,8 @@ class SharedMemory;  class VisitedLinkEventListener : public VisitedLinkMaster::Listener {   public: -  VisitedLinkEventListener() {} -  virtual ~VisitedLinkEventListener() {} +  VisitedLinkEventListener(); +  virtual ~VisitedLinkEventListener();    virtual void NewTable(base::SharedMemory* table_memory);    virtual void Add(VisitedLinkMaster::Fingerprint fingerprint); diff --git a/chrome/renderer/net/renderer_net_predictor.cc b/chrome/renderer/net/renderer_net_predictor.cc index 7749e91..7f9a7f1 100644 --- a/chrome/renderer/net/renderer_net_predictor.cc +++ b/chrome/renderer/net/renderer_net_predictor.cc @@ -32,6 +32,9 @@ RendererNetPredictor::RendererNetPredictor()    Reset();  } +RendererNetPredictor::~RendererNetPredictor() { +} +  void RendererNetPredictor::Reset() {    domain_map_.clear();    c_string_queue_.Clear(); diff --git a/chrome/renderer/net/renderer_net_predictor.h b/chrome/renderer/net/renderer_net_predictor.h index 36c2400..b761763 100644 --- a/chrome/renderer/net/renderer_net_predictor.h +++ b/chrome/renderer/net/renderer_net_predictor.h @@ -36,8 +36,7 @@ void DnsPrefetchCString(const char* hostname, size_t length);  class RendererNetPredictor {   public:    RendererNetPredictor(); - -  ~RendererNetPredictor() {} +  ~RendererNetPredictor();    // Push a name into the queue to be resolved.    void Resolve(const char* name, size_t length); diff --git a/chrome/renderer/translate_helper.cc b/chrome/renderer/translate_helper.cc index fafd52d..ab8bcdf 100644 --- a/chrome/renderer/translate_helper.cc +++ b/chrome/renderer/translate_helper.cc @@ -42,6 +42,9 @@ TranslateHelper::TranslateHelper(RenderView* render_view)        ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {  } +TranslateHelper::~TranslateHelper() { +} +  void TranslateHelper::TranslatePage(int page_id,                                      const std::string& source_lang,                                      const std::string& target_lang, diff --git a/chrome/renderer/translate_helper.h b/chrome/renderer/translate_helper.h index 0e3a989..04c623e 100644 --- a/chrome/renderer/translate_helper.h +++ b/chrome/renderer/translate_helper.h @@ -23,7 +23,7 @@ class WebFrame;  class TranslateHelper {   public:    explicit TranslateHelper(RenderView* render_view); -  virtual ~TranslateHelper() {} +  virtual ~TranslateHelper();    // Translates the page contents from |source_lang| to |target_lang|.    // Does nothing if |page_id| is not the current page id. diff --git a/chrome/renderer/user_script_idle_scheduler.cc b/chrome/renderer/user_script_idle_scheduler.cc index 9336a9d..b2989a4 100644 --- a/chrome/renderer/user_script_idle_scheduler.cc +++ b/chrome/renderer/user_script_idle_scheduler.cc @@ -19,6 +19,9 @@ UserScriptIdleScheduler::UserScriptIdleScheduler(RenderView* view,    frame_(frame), has_run_(false) {  } +UserScriptIdleScheduler::~UserScriptIdleScheduler() { +} +  void UserScriptIdleScheduler::DidFinishDocumentLoad() {    MessageLoop::current()->PostDelayedTask(FROM_HERE,        method_factory_.NewRunnableMethod(&UserScriptIdleScheduler::MaybeRun), diff --git a/chrome/renderer/user_script_idle_scheduler.h b/chrome/renderer/user_script_idle_scheduler.h index 012f6f6..d287d75 100644 --- a/chrome/renderer/user_script_idle_scheduler.h +++ b/chrome/renderer/user_script_idle_scheduler.h @@ -27,6 +27,7 @@ class WebFrame;  class UserScriptIdleScheduler {   public:    UserScriptIdleScheduler(RenderView* view, WebKit::WebFrame* frame); +  ~UserScriptIdleScheduler();    bool has_run() { return has_run_; } diff --git a/chrome/test/interactive_ui/view_event_test_base.cc b/chrome/test/interactive_ui/view_event_test_base.cc index 476445f..e717497 100644 --- a/chrome/test/interactive_ui/view_event_test_base.cc +++ b/chrome/test/interactive_ui/view_event_test_base.cc @@ -99,6 +99,10 @@ void ViewEventTestBase::TearDown() {  #endif  } +bool ViewEventTestBase::CanResize() const { +  return true; +} +  views::View* ViewEventTestBase::GetContentsView() {    if (!content_view_) {      // Wrap the real view (as returned by CreateContentsView) in a View so @@ -111,6 +115,9 @@ views::View* ViewEventTestBase::GetContentsView() {    return content_view_;  } +ViewEventTestBase::~ViewEventTestBase() { +} +  void ViewEventTestBase::StartMessageLoopAndRunTest() {    window_->Show();    // Make sure the window is the foreground window, otherwise none of the diff --git a/chrome/test/interactive_ui/view_event_test_base.h b/chrome/test/interactive_ui/view_event_test_base.h index d36fcc5..f0809d9 100644 --- a/chrome/test/interactive_ui/view_event_test_base.h +++ b/chrome/test/interactive_ui/view_event_test_base.h @@ -70,9 +70,7 @@ class ViewEventTestBase : public views::WindowDelegate,    // Destroys the window.    virtual void TearDown(); -  virtual bool CanResize() const { -    return true; -  } +  virtual bool CanResize() const;    // WindowDelegate method. Calls into CreateContentsView to get the actual    // view. @@ -84,7 +82,7 @@ class ViewEventTestBase : public views::WindowDelegate,    static bool ImplementsThreadSafeReferenceCounting() { return false; }   protected: -  virtual ~ViewEventTestBase() {} +  virtual ~ViewEventTestBase();    // Returns the view that is added to the window.    virtual views::View* CreateContentsView() = 0; diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 3f910cf..e4852b4 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -295,6 +295,10 @@ Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode,    }  } +Channel::ChannelImpl::~ChannelImpl() { +  Close(); +} +  // static  void AddChannelSocket(const std::string& name, int socket) {    Singleton<PipeMap>()->Insert(name, socket); diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h index 15f5f5e..b7818a2 100644 --- a/ipc/ipc_channel_posix.h +++ b/ipc/ipc_channel_posix.h @@ -40,7 +40,7 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {   public:    // Mirror methods of Channel, see ipc_channel.h for description.    ChannelImpl(const std::string& channel_id, Mode mode, Listener* listener); -  ~ChannelImpl() { Close(); } +  ~ChannelImpl();    bool Connect();    void Close();    void set_listener(Listener* listener) { listener_ = listener; } diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index be98707..051bb8d 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -48,6 +48,10 @@ Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode,    }  } +Channel::ChannelImpl::~ChannelImpl() { +  Close(); +} +  void Channel::ChannelImpl::Close() {    if (thread_check_.get()) {      DCHECK(thread_check_->CalledOnValidThread()); diff --git a/ipc/ipc_channel_win.h b/ipc/ipc_channel_win.h index 6965fd8..ccaa6f4 100644 --- a/ipc/ipc_channel_win.h +++ b/ipc/ipc_channel_win.h @@ -22,7 +22,7 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler {   public:    // Mirror methods of Channel, see ipc_channel.h for description.    ChannelImpl(const std::string& channel_id, Mode mode, Listener* listener); -  ~ChannelImpl() { Close(); } +  ~ChannelImpl();    bool Connect();    void Close();    void set_listener(Listener* listener) { listener_ = listener; } diff --git a/jingle/notifier/communicator/ssl_socket_adapter.cc b/jingle/notifier/communicator/ssl_socket_adapter.cc index 8cc135d..30d28fe 100644 --- a/jingle/notifier/communicator/ssl_socket_adapter.cc +++ b/jingle/notifier/communicator/ssl_socket_adapter.cc @@ -72,6 +72,9 @@ SSLSocketAdapter::SSLSocketAdapter(AsyncSocket* socket)    transport_socket_ = new TransportSocket(socket, this);  } +SSLSocketAdapter::~SSLSocketAdapter() { +} +  int SSLSocketAdapter::StartSSL(const char* hostname, bool restartable) {    DCHECK(!restartable);    hostname_ = hostname; @@ -222,6 +225,9 @@ TransportSocket::TransportSocket(talk_base::AsyncSocket* socket,    socket_->SignalWriteEvent.connect(this, &TransportSocket::OnWriteEvent);  } +TransportSocket::~TransportSocket() { +} +  int TransportSocket::Connect(net::CompletionCallback* callback) {    // Connect is never called by SSLClientSocket, instead SSLSocketAdapter    // calls Connect() on socket_ directly. diff --git a/jingle/notifier/communicator/ssl_socket_adapter.h b/jingle/notifier/communicator/ssl_socket_adapter.h index a5f5e9a..42b20a8 100644 --- a/jingle/notifier/communicator/ssl_socket_adapter.h +++ b/jingle/notifier/communicator/ssl_socket_adapter.h @@ -29,6 +29,7 @@ class TransportSocket : public net::ClientSocket, public sigslot::has_slots<> {   public:    TransportSocket(talk_base::AsyncSocket* socket,                    SSLSocketAdapter *ssl_adapter); +  ~TransportSocket();    void set_addr(const talk_base::SocketAddress& addr) {      addr_ = addr; @@ -82,6 +83,7 @@ class TransportSocket : public net::ClientSocket, public sigslot::has_slots<> {  class SSLSocketAdapter : public talk_base::SSLAdapter {   public:    explicit SSLSocketAdapter(talk_base::AsyncSocket* socket); +  ~SSLSocketAdapter();    // StartSSL returns 0 if successful, or non-zero on failure.    // If StartSSL is called while the socket is closed or connecting, the SSL diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 6b415b8..9a3fbe4 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -339,6 +339,49 @@ int BackendImpl::Init(CompletionCallback* callback) {    return net::ERR_IO_PENDING;  } +BackendImpl::BackendImpl(const FilePath& path, +                         base::MessageLoopProxy* cache_thread) +    : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), +      path_(path), +      block_files_(path), +      mask_(0), +      max_size_(0), +      cache_type_(net::DISK_CACHE), +      uma_report_(0), +      user_flags_(0), +      init_(false), +      restarted_(false), +      unit_test_(false), +      read_only_(false), +      new_eviction_(false), +      first_timer_(true), +      done_(true, false), +      ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), +      ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { +} + +BackendImpl::BackendImpl(const FilePath& path, +                         uint32 mask, +                         base::MessageLoopProxy* cache_thread) +    : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), +      path_(path), +      block_files_(path), +      mask_(mask), +      max_size_(0), +      cache_type_(net::DISK_CACHE), +      uma_report_(0), +      user_flags_(kMask), +      init_(false), +      restarted_(false), +      unit_test_(false), +      read_only_(false), +      new_eviction_(false), +      first_timer_(true), +      done_(true, false), +      ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), +      ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { +} +  BackendImpl::~BackendImpl() {    background_queue_.WaitForPendingIO(); diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h index 24af0b4..47bbe96 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -37,24 +37,10 @@ enum BackendFlags {  class BackendImpl : public Backend {    friend class Eviction;   public: -  BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread) -      : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), -        path_(path), block_files_(path), mask_(0), max_size_(0), -        cache_type_(net::DISK_CACHE), uma_report_(0), user_flags_(0), -        init_(false), restarted_(false), unit_test_(false), read_only_(false), -        new_eviction_(false), first_timer_(true), done_(true, false), -        ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), -        ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) {} +  BackendImpl(const FilePath& path, base::MessageLoopProxy* cache_thread);    // mask can be used to limit the usable size of the hash table, for testing.    BackendImpl(const FilePath& path, uint32 mask, -              base::MessageLoopProxy* cache_thread) -      : ALLOW_THIS_IN_INITIALIZER_LIST(background_queue_(this, cache_thread)), -        path_(path), block_files_(path), mask_(mask), max_size_(0), -        cache_type_(net::DISK_CACHE), uma_report_(0), user_flags_(kMask), -        init_(false), restarted_(false), unit_test_(false), read_only_(false), -        new_eviction_(false), first_timer_(true), done_(true, false), -        ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)), -        ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) {} +              base::MessageLoopProxy* cache_thread);    ~BackendImpl();    // Returns a new backend with the desired flags. See the declaration of diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc index f84b8b2..7dd618a 100644 --- a/net/disk_cache/disk_cache_test_util.cc +++ b/net/disk_cache/disk_cache_test_util.cc @@ -151,6 +151,9 @@ MessageLoopHelper::MessageLoopHelper()        TimeDelta::FromMilliseconds(50), this, &MessageLoopHelper::TimerExpired);  } +MessageLoopHelper::~MessageLoopHelper() { +} +  bool MessageLoopHelper::WaitUntilCacheIoFinished(int num_callbacks) {    if (num_callbacks == g_cache_tests_received)      return true; diff --git a/net/disk_cache/disk_cache_test_util.h b/net/disk_cache/disk_cache_test_util.h index d639c67..f6348e9 100644 --- a/net/disk_cache/disk_cache_test_util.h +++ b/net/disk_cache/disk_cache_test_util.h @@ -76,6 +76,7 @@ class CallbackTest : public CallbackRunner< Tuple1<int> >  {  class MessageLoopHelper {   public:    MessageLoopHelper(); +  ~MessageLoopHelper();    // Run the message loop and wait for num_callbacks before returning. Returns    // false if we are waiting to long. diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc index 8da01ae..da7577c 100644 --- a/net/disk_cache/eviction.cc +++ b/net/disk_cache/eviction.cc @@ -28,6 +28,7 @@  #include "net/disk_cache/eviction.h" +#include "base/compiler_specific.h"  #include "base/logging.h"  #include "base/message_loop.h"  #include "base/string_util.h" @@ -58,6 +59,15 @@ int LowWaterAdjust(int high_water) {  namespace disk_cache { +Eviction::Eviction() +    : backend_(NULL), +      init_(false), +      ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) { +} + +Eviction::~Eviction() { +} +  void Eviction::Init(BackendImpl* backend) {    // We grab a bunch of info from the backend to make the code a little cleaner    // when we're actually doing work. diff --git a/net/disk_cache/eviction.h b/net/disk_cache/eviction.h index 69736ea..6b13dc0 100644 --- a/net/disk_cache/eviction.h +++ b/net/disk_cache/eviction.h @@ -7,7 +7,6 @@  #pragma once  #include "base/basictypes.h" -#include "base/compiler_specific.h"  #include "base/task.h"  #include "net/disk_cache/disk_format.h"  #include "net/disk_cache/rankings.h" @@ -21,10 +20,8 @@ class EntryImpl;  // integrated with BackendImpl.  class Eviction {   public: -  Eviction() -      : backend_(NULL), init_(false), -        ALLOW_THIS_IN_INITIALIZER_LIST(factory_(this)) {} -  ~Eviction() {} +  Eviction(); +  ~Eviction();    void Init(BackendImpl* backend);    void Stop(); diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 46e0e55..bd47f7c 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -641,6 +641,9 @@ DelayedSocketData::DelayedSocketData(    set_connect_data(connect);  } +DelayedSocketData::~DelayedSocketData() { +} +  MockRead DelayedSocketData::GetNextRead() {    if (write_delay_ > 0)      return MockRead(true, ERR_IO_PENDING); diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index f63dd6c..aaa514e 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -280,6 +280,7 @@ class DelayedSocketData : public StaticSocketDataProvider,    DelayedSocketData(const MockConnect& connect, int write_delay,                      MockRead* reads, size_t reads_count,                      MockWrite* writes, size_t writes_count); +  ~DelayedSocketData();    virtual MockRead GetNextRead();    virtual MockWriteResult OnWrite(const std::string& data); diff --git a/webkit/glue/resource_fetcher.cc b/webkit/glue/resource_fetcher.cc index 186092b..84688a7 100644 --- a/webkit/glue/resource_fetcher.cc +++ b/webkit/glue/resource_fetcher.cc @@ -119,6 +119,9 @@ ResourceFetcherWithTimeout::ResourceFetcherWithTimeout(                         &ResourceFetcherWithTimeout::TimeoutFired);  } +ResourceFetcherWithTimeout::~ResourceFetcherWithTimeout() { +} +  void ResourceFetcherWithTimeout::TimeoutFired() {    if (!completed_) {      loader_->cancel(); diff --git a/webkit/glue/resource_fetcher.h b/webkit/glue/resource_fetcher.h index 7910fc1..a510d7c 100644 --- a/webkit/glue/resource_fetcher.h +++ b/webkit/glue/resource_fetcher.h @@ -100,7 +100,7 @@ class ResourceFetcherWithTimeout : public ResourceFetcher {   public:    ResourceFetcherWithTimeout(const GURL& url, WebKit::WebFrame* frame,                               int timeout_secs, Callback* c); -  virtual ~ResourceFetcherWithTimeout() {} +  virtual ~ResourceFetcherWithTimeout();   private:    // Callback for timer that limits how long we wait for the alternate error diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc index 02d8078..29e7295 100644 --- a/webkit/tools/test_shell/event_sending_controller.cc +++ b/webkit/tools/test_shell/event_sending_controller.cc @@ -305,6 +305,9 @@ EventSendingController::EventSendingController(TestShell* shell)  #endif  } +EventSendingController::~EventSendingController() { +} +  void EventSendingController::Reset() {    // The test should have finished a drag and the mouse button state.    DCHECK(current_drag_data.isNull()); diff --git a/webkit/tools/test_shell/event_sending_controller.h b/webkit/tools/test_shell/event_sending_controller.h index e7db529..95ddc05 100644 --- a/webkit/tools/test_shell/event_sending_controller.h +++ b/webkit/tools/test_shell/event_sending_controller.h @@ -36,6 +36,7 @@ class EventSendingController : public CppBoundClass {    // Builds the property and method lists needed to bind this class to a JS    // object.    EventSendingController(TestShell* shell); +  ~EventSendingController();    // Resets some static variable state.    void Reset(); diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 32f5188..e250886 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -199,6 +199,12 @@ LayoutTestController::LayoutTestController(TestShell* shell) :    BindProperty("webHistoryItemCount", &webHistoryItemCount_);  } +LayoutTestController::~LayoutTestController() { +} + +LayoutTestController::WorkQueue::WorkQueue() { +} +  LayoutTestController::WorkQueue::~WorkQueue() {    Reset();  } diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h index 28ae5ea..d048d0f 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -26,6 +26,7 @@ class LayoutTestController : public CppBoundClass {    // Builds the property and method lists needed to bind this class to a JS    // object.    LayoutTestController(TestShell* shell); +  ~LayoutTestController();    // This function sets a flag that tells the test_shell to dump pages as    // plain text, rather than as a text representation of the renderer's state. @@ -352,6 +353,7 @@ class LayoutTestController : public CppBoundClass {    // queueScript.    class WorkQueue {     public: +    WorkQueue();      virtual ~WorkQueue();      void ProcessWorkSoon(); diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.cc b/webkit/tools/test_shell/test_shell_devtools_agent.cc index 356f59c..d13cb9f 100644 --- a/webkit/tools/test_shell/test_shell_devtools_agent.cc +++ b/webkit/tools/test_shell/test_shell_devtools_agent.cc @@ -61,6 +61,9 @@ TestShellDevToolsAgent::TestShellDevToolsAgent()          &TestShellDevToolsAgent::DispatchMessageLoop);  } +TestShellDevToolsAgent::~TestShellDevToolsAgent() { +} +  void TestShellDevToolsAgent::SetWebView(WebKit::WebView* web_view) {    web_view_ = web_view;  } diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.h b/webkit/tools/test_shell/test_shell_devtools_agent.h index 8ea16de..e0f5276 100644 --- a/webkit/tools/test_shell/test_shell_devtools_agent.h +++ b/webkit/tools/test_shell/test_shell_devtools_agent.h @@ -24,7 +24,7 @@ class TestShellDevToolsAgent : public WebKit::WebDevToolsAgentClient {   public:    TestShellDevToolsAgent(); -  virtual ~TestShellDevToolsAgent() {} +  virtual ~TestShellDevToolsAgent();    void SetWebView(WebKit::WebView* web_view); | 
