Skip to content

Commit

Permalink
Move more code from headers to implementation.
Browse files Browse the repository at this point in the history
BUG=none
TEST=compiles

Review URL: http://codereview.chromium.org/5624002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68534 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
erg@google.com committed Dec 7, 2010
1 parent 111ca63 commit aa20e06
Show file tree
Hide file tree
Showing 38 changed files with 218 additions and 88 deletions.
2 changes: 2 additions & 0 deletions chrome/browser/automation/automation_provider_observers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,8 @@ NTPInfoObserver::NTPInfoObserver(
}
}

NTPInfoObserver::~NTPInfoObserver() {}

void NTPInfoObserver::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/automation/automation_provider_observers.h
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ class NTPInfoObserver : public NotificationObserver {
NTPInfoObserver(AutomationProvider* automation,
IPC::Message* reply_message,
CancelableRequestConsumer* consumer);
virtual ~NTPInfoObserver();

virtual void Observe(NotificationType type,
const NotificationSource& source,
Expand Down
37 changes: 37 additions & 0 deletions chrome/browser/bug_report_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,43 @@
#include "chrome/browser/chromeos/notifications/system_notification.h"
#endif

BugReportData::BugReportData()
: profile_(NULL),
problem_type_(0)
#if defined(OS_CHROMEOS)
, sent_report_(false), send_sys_info_(false)
#endif
{
}

BugReportData::~BugReportData() {}

void BugReportData::UpdateData(Profile* profile,
const std::string& target_tab_url,
const string16& target_tab_title,
const int problem_type,
const std::string& page_url,
const std::string& description,
const std::vector<unsigned char>& image
#if defined(OS_CHROMEOS)
, const std::string& user_email
, const bool send_sys_info
, const bool sent_report
#endif
) {
profile_ = profile;
target_tab_url_ = target_tab_url;
target_tab_title_ = target_tab_title;
problem_type_ = problem_type;
page_url_ = page_url;
description_ = description;
image_ = image;
#if defined(OS_CHROMEOS)
user_email_ = user_email;
send_sys_info_ = send_sys_info;
sent_report_ = sent_report;
#endif
}


#if defined(OS_CHROMEOS)
Expand Down
44 changes: 13 additions & 31 deletions chrome/browser/bug_report_data.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2010 Google Inc. All Rights Reserved.
// Author: rkc@google.com (Rahul Chaturvedi)
// 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.

#ifndef CHROME_BROWSER_BUG_REPORT_DATA_H_
#define CHROME_BROWSER_BUG_REPORT_DATA_H_


#include <string>
#include <vector>

Expand All @@ -23,43 +23,25 @@ class BugReportData {
// don't want it to send the report either - this will make sure that if
// SyslogsComplete gets called before UpdateData, we'll simply populate the
// sys_info and zip_content fields and exit without disturbing anything else
BugReportData() : profile_(NULL),
problem_type_(0)
#if defined(OS_CHROMEOS)
, sent_report_(false), send_sys_info_(false)
#endif
{
}
BugReportData();
~BugReportData();

// Defined in bug_report_ui.cc
void SendReport();

void UpdateData(Profile* profile
, const std::string& target_tab_url
, const string16& target_tab_title
, const int problem_type
, const std::string& page_url
, const std::string& description
, const std::vector<unsigned char>& image
void UpdateData(Profile* profile,
const std::string& target_tab_url,
const string16& target_tab_title,
const int problem_type,
const std::string& page_url,
const std::string& description,
const std::vector<unsigned char>& image
#if defined(OS_CHROMEOS)
, const std::string& user_email
, const bool send_sys_info
, const bool sent_report
#endif
) {
profile_ = profile;
target_tab_url_ = target_tab_url;
target_tab_title_ = target_tab_title;
problem_type_ = problem_type;
page_url_ = page_url;
description_ = description;
image_ = image;
#if defined(OS_CHROMEOS)
user_email_ = user_email;
send_sys_info_ = send_sys_info;
sent_report_ = sent_report;
#endif
}
);

#if defined(OS_CHROMEOS)
void SyslogsComplete(chromeos::LogDictionaryType* logs,
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/extensions/extension_tts_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ ExtensionTtsController::ExtensionTtsController()
platform_impl_(NULL) {
}

ExtensionTtsController::~ExtensionTtsController() {}

void ExtensionTtsController::SpeakOrEnqueue(
Utterance* utterance, bool can_enqueue) {
if (IsSpeaking() && can_enqueue) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/extensions/extension_tts_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ExtensionTtsController {

private:
ExtensionTtsController();
virtual ~ExtensionTtsController() {}
virtual ~ExtensionTtsController();

// Get the platform TTS implementation (or injected mock).
ExtensionTtsPlatformImpl* GetPlatformImpl();
Expand Down
15 changes: 13 additions & 2 deletions chrome/browser/history/history_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ Images::Images() {}

Images::~Images() {}

// TopSitesDelta --------------------------------------------------------------

TopSitesDelta::TopSitesDelta() {}

TopSitesDelta::~TopSitesDelta() {}

// HistoryAddPageArgs ---------------------------------------------------------

HistoryAddPageArgs::HistoryAddPageArgs(
Expand Down Expand Up @@ -366,7 +372,12 @@ HistoryAddPageArgs* HistoryAddPageArgs::Clone() const {
visit_source, did_replace_entry);
}

MostVisitedThumbnails::MostVisitedThumbnails() {
}
ThumbnailMigration::ThumbnailMigration() {}

ThumbnailMigration::~ThumbnailMigration() {}

MostVisitedThumbnails::MostVisitedThumbnails() {}

MostVisitedThumbnails::~MostVisitedThumbnails() {}

} // namespace history
7 changes: 7 additions & 0 deletions chrome/browser/history/history_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ struct MostVisitedURLWithRank {
typedef std::vector<MostVisitedURLWithRank> MostVisitedURLWithRankList;

struct TopSitesDelta {
TopSitesDelta();
~TopSitesDelta();

MostVisitedURLList deleted;
MostVisitedURLWithRankList added;
MostVisitedURLWithRankList moved;
Expand All @@ -619,6 +622,9 @@ typedef std::map<GURL, scoped_refptr<RefCountedBytes> > URLToThumbnailMap;

// Used when migrating most visited thumbnails out of history and into topsites.
struct ThumbnailMigration {
ThumbnailMigration();
~ThumbnailMigration();

MostVisitedURLList most_visited;
URLToThumbnailMap url_to_thumbnail_map;
};
Expand All @@ -629,6 +635,7 @@ class MostVisitedThumbnails
: public base::RefCountedThreadSafe<MostVisitedThumbnails> {
public:
MostVisitedThumbnails();
virtual ~MostVisitedThumbnails();

MostVisitedURLList most_visited;
URLToImagesMap url_to_images_map;
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/policy/configuration_policy_pref_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ ConfigurationPolicyPrefStore::ConfigurationPolicyPrefStore(
use_system_proxy_(false) {
}

ConfigurationPolicyPrefStore::~ConfigurationPolicyPrefStore() {}

PrefStore::PrefReadError ConfigurationPolicyPrefStore::ReadPrefs() {
proxy_disabled_ = false;
proxy_configuration_specified_ = false;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/policy/configuration_policy_pref_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ConfigurationPolicyPrefStore : public PrefStore,
// The ConfigurationPolicyPrefStore does not take ownership of the
// passed-in |provider|.
explicit ConfigurationPolicyPrefStore(ConfigurationPolicyProvider* provider);
virtual ~ConfigurationPolicyPrefStore() {}
virtual ~ConfigurationPolicyPrefStore();

// PrefStore methods:
virtual PrefReadError ReadPrefs();
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/policy/device_management_policy_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ DeviceManagementPolicyCache::DeviceManagementPolicyCache(
is_device_unmanaged_(false) {
}

DeviceManagementPolicyCache::~DeviceManagementPolicyCache() {}

void DeviceManagementPolicyCache::LoadPolicyFromFile() {
if (!file_util::PathExists(backing_file_path_) || fresh_policy_)
return;
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/policy/device_management_policy_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace em = enterprise_management;
class DeviceManagementPolicyCache {
public:
explicit DeviceManagementPolicyCache(const FilePath& backing_file_path);
~DeviceManagementPolicyCache();

// Loads policy information from the backing file. Non-existing or erroneous
// cache files are ignored.
Expand Down
27 changes: 27 additions & 0 deletions chrome/browser/policy/device_token_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,31 @@ namespace policy {

namespace em = enterprise_management;

DeviceTokenFetcher::ObserverRegistrar::ObserverRegistrar() {}

DeviceTokenFetcher::ObserverRegistrar::~ObserverRegistrar() {
RemoveAll();
}

void DeviceTokenFetcher::ObserverRegistrar::Init(
DeviceTokenFetcher* token_fetcher) {
token_fetcher_ = token_fetcher;
}

void DeviceTokenFetcher::ObserverRegistrar::AddObserver(
DeviceTokenFetcher::Observer* observer) {
observers_.push_back(observer);
token_fetcher_->AddObserver(observer);
}

void DeviceTokenFetcher::ObserverRegistrar::RemoveAll() {
for (std::vector<DeviceTokenFetcher::Observer*>::iterator it =
observers_.begin(); it != observers_.end(); ++it) {
token_fetcher_->RemoveObserver(*it);
}
observers_.clear();
}

DeviceTokenFetcher::DeviceTokenFetcher(
DeviceManagementBackend* backend,
Profile* profile,
Expand Down Expand Up @@ -88,6 +113,8 @@ DeviceTokenFetcher::DeviceTokenFetcher(
#endif
}

DeviceTokenFetcher::~DeviceTokenFetcher() {}

void DeviceTokenFetcher::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
Expand Down
25 changes: 7 additions & 18 deletions chrome/browser/policy/device_token_fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,12 @@ class DeviceTokenFetcher

class ObserverRegistrar {
public:
void Init(DeviceTokenFetcher* token_fetcher) {
token_fetcher_ = token_fetcher;
}
~ObserverRegistrar() {
RemoveAll();
}
void AddObserver(DeviceTokenFetcher::Observer* observer) {
observers_.push_back(observer);
token_fetcher_->AddObserver(observer);
}
void RemoveAll() {
for (std::vector<DeviceTokenFetcher::Observer*>::iterator it =
observers_.begin(); it != observers_.end(); ++it) {
token_fetcher_->RemoveObserver(*it);
}
observers_.clear();
}
ObserverRegistrar();
~ObserverRegistrar();

void Init(DeviceTokenFetcher* token_fetcher);
void AddObserver(DeviceTokenFetcher::Observer* observer);
void RemoveAll();
private:
DeviceTokenFetcher* token_fetcher_;
std::vector<DeviceTokenFetcher::Observer*> observers_;
Expand All @@ -71,7 +60,7 @@ class DeviceTokenFetcher
DeviceTokenFetcher(DeviceManagementBackend* backend,
Profile* profile,
const FilePath& token_path);
virtual ~DeviceTokenFetcher() {}
virtual ~DeviceTokenFetcher();

// NotificationObserver method overrides:
virtual void Observe(NotificationType type,
Expand Down
1 change: 1 addition & 0 deletions chrome/common/json_schema_validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ JSONSchemaValidator::JSONSchemaValidator(DictionaryValue* schema,
}
}

JSONSchemaValidator::~JSONSchemaValidator() {}

bool JSONSchemaValidator::Validate(Value* instance) {
errors_.clear();
Expand Down
2 changes: 2 additions & 0 deletions chrome/common/json_schema_validator.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ class JSONSchemaValidator {
// not be used with untrusted schemas.
JSONSchemaValidator(DictionaryValue* schema, ListValue* types);

~JSONSchemaValidator();

// Whether the validator allows additional items for objects and lists, beyond
// those defined by their schema, by default.
//
Expand Down
4 changes: 4 additions & 0 deletions chrome/common/metrics_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ void MetricsServiceBase::SnapshotProblemResolved(int amount) {
std::abs(amount));
}

HistogramSender::HistogramSender() {}

HistogramSender::~HistogramSender() {}

void HistogramSender::TransmitAllHistograms(Histogram::Flags flag_to_set,
bool send_only_uma) {
StatisticsRecorder::Histograms histograms;
Expand Down
4 changes: 2 additions & 2 deletions chrome/common/metrics_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ class MetricsLogBase {
// onward.
class HistogramSender {
protected:
HistogramSender() {}
virtual ~HistogramSender() {}
HistogramSender();
virtual ~HistogramSender();

// Snapshot all histograms, and transmit the delta.
// The arguments allow a derived class to select only a subset for
Expand Down
2 changes: 2 additions & 0 deletions chrome/service/cloud_print/cloud_print_url_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ void CloudPrintURLFetcher::StartRequestHelper(
request_->Start();
}

CloudPrintURLFetcher::~CloudPrintURLFetcher() {}

URLRequestContextGetter* CloudPrintURLFetcher::GetRequestContextGetter() {
ServiceURLRequestContextGetter* getter =
new ServiceURLRequestContextGetter();
Expand Down
3 changes: 3 additions & 0 deletions chrome/service/cloud_print/cloud_print_url_fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ class CloudPrintURLFetcher
const ResponseCookies& cookies,
const std::string& data);
protected:
friend class base::RefCountedThreadSafe<CloudPrintURLFetcher>;
virtual ~CloudPrintURLFetcher();

// Virtual for testing.
virtual URLRequestContextGetter* GetRequestContextGetter();

Expand Down
5 changes: 3 additions & 2 deletions media/base/filter_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

namespace media {

FilterCollection::FilterCollection() {
}
FilterCollection::FilterCollection() {}

FilterCollection::~FilterCollection() {}

void FilterCollection::AddDataSource(DataSource* filter) {
AddFilter(DATA_SOURCE, filter);
Expand Down
1 change: 1 addition & 0 deletions media/base/filter_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace media {
class FilterCollection {
public:
FilterCollection();
~FilterCollection();

// Adds a filter to the collection.
void AddDataSource(DataSource* filter);
Expand Down
Loading

0 comments on commit aa20e06

Please sign in to comment.