Skip to content

Commit

Permalink
Revert "FBTF: Another big ctor/dtor cleanup found by automated tools."
Browse files Browse the repository at this point in the history
This reverts commit 27ea47d (r61237).

BUG=none
TEST=compiles

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61240 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
erg@google.com committed Oct 1, 2010
1 parent 7f71e75 commit d0af720
Show file tree
Hide file tree
Showing 90 changed files with 290 additions and 746 deletions.
2 changes: 0 additions & 2 deletions base/field_trial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ std::string FieldTrial::MakeName(const std::string& name_prefix,
return big_string.append(FieldTrialList::FindFullName(trial_name));
}

FieldTrial::~FieldTrial() {}

//------------------------------------------------------------------------------
// FieldTrialList methods and members.

Expand Down
2 changes: 1 addition & 1 deletion base/field_trial.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class FieldTrial : public base::RefCounted<FieldTrial> {
private:
friend class base::RefCounted<FieldTrial>;

virtual ~FieldTrial();
~FieldTrial() {}

// The name of the field trial, as can be found via the FieldTrialList.
// This is empty of the trial is not in the experiment.
Expand Down
4 changes: 0 additions & 4 deletions base/global_descriptors_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

namespace base {

GlobalDescriptors::GlobalDescriptors() {}

GlobalDescriptors::~GlobalDescriptors() {}

int GlobalDescriptors::MaybeGet(Key key) const {
for (Mapping::const_iterator
i = descriptors_.begin(); i != descriptors_.end(); ++i) {
Expand Down
3 changes: 1 addition & 2 deletions base/global_descriptors_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ class GlobalDescriptors {
}

private:
GlobalDescriptors();
~GlobalDescriptors();
GlobalDescriptors() { }
friend struct DefaultSingletonTraits<GlobalDescriptors>;

Mapping descriptors_;
Expand Down
10 changes: 0 additions & 10 deletions chrome/browser/debugger/devtools_remote_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ DevToolsRemoteMessageBuilder& DevToolsRemoteMessageBuilder::instance() {
return instance_;
}

DevToolsRemoteMessage::DevToolsRemoteMessage() {}

DevToolsRemoteMessage::DevToolsRemoteMessage(const HeaderMap& headers,
const std::string& content)
: header_map_(headers),
content_(content) {
}

DevToolsRemoteMessage::~DevToolsRemoteMessage() {}

const std::string DevToolsRemoteMessage::GetHeader(
const std::string& header_name,
const std::string& default_value) const {
Expand Down
8 changes: 5 additions & 3 deletions chrome/browser/debugger/devtools_remote_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ class DevToolsRemoteMessage {
static const char kEmptyValue[];

// Constructs an empty message with no content or headers.
DevToolsRemoteMessage();
DevToolsRemoteMessage(const HeaderMap& headers, const std::string& content);
virtual ~DevToolsRemoteMessage();
DevToolsRemoteMessage() {}
DevToolsRemoteMessage(const HeaderMap& headers, const std::string& content)
: header_map_(headers),
content_(content) {}
virtual ~DevToolsRemoteMessage() {}

const HeaderMap& headers() const {
return header_map_;
Expand Down
16 changes: 0 additions & 16 deletions chrome/browser/debugger/inspectable_tab_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/common/devtools_messages.h"

DevToolsClientHostImpl::DevToolsClientHostImpl(
int32 id,
DebuggerRemoteService* service,
InspectableTabProxy::IdToClientHostMap* map)
: id_(id),
service_(service),
map_(map) {}

DevToolsClientHostImpl::~DevToolsClientHostImpl() {
map_->erase(this->id_);
}

// The debugged tab has closed.
void DevToolsClientHostImpl::InspectedTabClosing() {
TabClosed();
Expand Down Expand Up @@ -61,10 +49,6 @@ void DevToolsClientHostImpl::TabClosed() {
service_->TabClosed(id_);
}

InspectableTabProxy::InspectableTabProxy() {}

InspectableTabProxy::~InspectableTabProxy() {}

const InspectableTabProxy::ControllersMap&
InspectableTabProxy::controllers_map() {
controllers_map_.clear();
Expand Down
14 changes: 9 additions & 5 deletions chrome/browser/debugger/inspectable_tab_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class InspectableTabProxy {
typedef base::hash_map<int32, NavigationController*> ControllersMap;
typedef base::hash_map<int32, DevToolsClientHostImpl*> IdToClientHostMap;

InspectableTabProxy();
virtual ~InspectableTabProxy();
InspectableTabProxy() {}
virtual ~InspectableTabProxy() {}

// Returns a map of NavigationControllerKeys to NavigationControllers
// for all Browser instances. Clients should not keep the result around
Expand Down Expand Up @@ -64,9 +64,13 @@ class DevToolsClientHostImpl : public DevToolsClientHost {
DevToolsClientHostImpl(
int32 id,
DebuggerRemoteService* service,
InspectableTabProxy::IdToClientHostMap* map);
~DevToolsClientHostImpl();

InspectableTabProxy::IdToClientHostMap* map)
: id_(id),
service_(service),
map_(map) {}
~DevToolsClientHostImpl() {
map_->erase(this->id_);
}
DebuggerRemoteService* debugger_remote_service() {
return service_;
}
Expand Down
17 changes: 0 additions & 17 deletions chrome/browser/sync/engine/model_safe_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,4 @@ std::string ModelSafeGroupToString(ModelSafeGroup group) {
}
}

ModelSafeWorker::ModelSafeWorker() {}

ModelSafeWorker::~ModelSafeWorker() {}

void ModelSafeWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) {
work->Run(); // For GROUP_PASSIVE, we do the work on the current thread.
}

ModelSafeGroup ModelSafeWorker::GetModelSafeGroup() {
return GROUP_PASSIVE;
}

bool ModelSafeWorker::CurrentThreadIsWorkThread() {
// The passive group is not the work thread for any browser model.
return false;
}

} // namespace browser_sync
17 changes: 12 additions & 5 deletions chrome/browser/sync/engine/model_safe_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,28 @@ std::string ModelSafeGroupToString(ModelSafeGroup group);
// syncable::Directory due to a race.
class ModelSafeWorker : public base::RefCountedThreadSafe<ModelSafeWorker> {
public:
ModelSafeWorker();
virtual ~ModelSafeWorker();
ModelSafeWorker() { }
virtual ~ModelSafeWorker() { }

// Any time the Syncer performs model modifications (e.g employing a
// WriteTransaction), it should be done by this method to ensure it is done
// from a model-safe thread.
virtual void DoWorkAndWaitUntilDone(Callback0::Type* work);
virtual void DoWorkAndWaitUntilDone(Callback0::Type* work) {
work->Run(); // For GROUP_PASSIVE, we do the work on the current thread.
}

virtual ModelSafeGroup GetModelSafeGroup();
virtual ModelSafeGroup GetModelSafeGroup() {
return GROUP_PASSIVE;
}

// Check the current thread and see if it's the thread associated with
// this worker. If this returns true, then it should be safe to operate
// on models that are in this worker's group. If this returns false,
// such work should not be attempted.
virtual bool CurrentThreadIsWorkThread();
virtual bool CurrentThreadIsWorkThread() {
// The passive group is not the work thread for any browser model.
return false;
}

private:
friend class base::RefCountedThreadSafe<ModelSafeWorker>;
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/sync/engine/syncapi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "base/task.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/sync/sync_constants.h"
#include "chrome/browser/sync/engine/all_status.h"
#include "chrome/browser/sync/engine/change_reorder_buffer.h"
Expand Down
7 changes: 0 additions & 7 deletions chrome/browser/sync/sessions/ordered_commit_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
namespace browser_sync {
namespace sessions {

OrderedCommitSet::OrderedCommitSet(
const browser_sync::ModelSafeRoutingInfo& routes)
: routes_(routes) {
}

OrderedCommitSet::~OrderedCommitSet() {}

void OrderedCommitSet::AddCommitItem(const int64 metahandle,
const syncable::Id& commit_id,
syncable::ModelType type) {
Expand Down
6 changes: 4 additions & 2 deletions chrome/browser/sync/sessions/ordered_commit_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class OrderedCommitSet {
typedef std::vector<size_t> Projection;

// TODO(chron): Reserve space according to batch size?
explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes);
~OrderedCommitSet();
explicit OrderedCommitSet(const browser_sync::ModelSafeRoutingInfo& routes)
: routes_(routes) {}

~OrderedCommitSet() {}

bool HaveCommitItem(const int64 metahandle) const {
return inserted_metahandles_.count(metahandle) > 0;
Expand Down
61 changes: 0 additions & 61 deletions chrome/browser/sync/sessions/session_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,6 @@ using std::vector;
namespace browser_sync {
namespace sessions {

SyncSessionSnapshot::SyncSessionSnapshot(
const SyncerStatus& syncer_status,
const ErrorCounters& errors,
int64 num_server_changes_remaining,
int64 max_local_timestamp,
bool is_share_usable,
const syncable::ModelTypeBitSet& initial_sync_ended,
bool more_to_sync,
bool is_silenced,
int64 unsynced_count,
int num_conflicting_updates,
bool did_commit_items)
: syncer_status(syncer_status),
errors(errors),
num_server_changes_remaining(num_server_changes_remaining),
max_local_timestamp(max_local_timestamp),
is_share_usable(is_share_usable),
initial_sync_ended(initial_sync_ended),
has_more_to_sync(more_to_sync),
is_silenced(is_silenced),
unsynced_count(unsynced_count),
num_conflicting_updates(num_conflicting_updates),
did_commit_items(did_commit_items) {
}

SyncSessionSnapshot::~SyncSessionSnapshot() {}

ConflictProgress::ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {}

ConflictProgress::~ConflictProgress() {
CleanupSets();
}

IdToConflictSetMap::const_iterator ConflictProgress::IdToConflictSetFind(
const syncable::Id& the_id) const {
return id_to_conflict_set_.find(the_id);
Expand Down Expand Up @@ -164,10 +131,6 @@ void ConflictProgress::CleanupSets() {
id_to_conflict_set_.clear();
}

UpdateProgress::UpdateProgress() {}

UpdateProgress::~UpdateProgress() {}

void UpdateProgress::AddVerifyResult(const VerifyResult& verify_result,
const sync_pb::SyncEntity& entity) {
verified_updates_.push_back(std::make_pair(verify_result, entity));
Expand Down Expand Up @@ -221,29 +184,5 @@ bool UpdateProgress::HasConflictingUpdates() const {
return false;
}

AllModelTypeState::AllModelTypeState(bool* dirty_flag)
: unsynced_handles(dirty_flag),
syncer_status(dirty_flag),
error_counters(dirty_flag),
num_server_changes_remaining(dirty_flag, 0),
commit_set(ModelSafeRoutingInfo()) {
}

AllModelTypeState::~AllModelTypeState() {}

PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag)
: conflict_progress(dirty_flag) {
}

PerModelSafeGroupState::~PerModelSafeGroupState() {
}

PerModelTypeState::PerModelTypeState(bool* dirty_flag)
: current_download_timestamp(dirty_flag, 0) {
}

PerModelTypeState::~PerModelTypeState() {
}

} // namespace sessions
} // namespace browser_sync
41 changes: 24 additions & 17 deletions chrome/browser/sync/sessions/session_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,18 @@ struct SyncSessionSnapshot {
bool is_silenced,
int64 unsynced_count,
int num_conflicting_updates,
bool did_commit_items);
~SyncSessionSnapshot();

bool did_commit_items)
: syncer_status(syncer_status),
errors(errors),
num_server_changes_remaining(num_server_changes_remaining),
max_local_timestamp(max_local_timestamp),
is_share_usable(is_share_usable),
initial_sync_ended(initial_sync_ended),
has_more_to_sync(more_to_sync),
is_silenced(is_silenced),
unsynced_count(unsynced_count),
num_conflicting_updates(num_conflicting_updates),
did_commit_items(did_commit_items) {}
const SyncerStatus syncer_status;
const ErrorCounters errors;
const int64 num_server_changes_remaining;
Expand All @@ -99,8 +108,8 @@ struct SyncSessionSnapshot {
// Tracks progress of conflicts and their resolution using conflict sets.
class ConflictProgress {
public:
explicit ConflictProgress(bool* dirty_flag);
~ConflictProgress();
explicit ConflictProgress(bool* dirty_flag) : dirty_(dirty_flag) {}
~ConflictProgress() { CleanupSets(); }
// Various iterators, size, and retrieval functions for conflict sets.
IdToConflictSetMap::const_iterator IdToConflictSetBegin() const;
IdToConflictSetMap::const_iterator IdToConflictSetEnd() const;
Expand Down Expand Up @@ -141,9 +150,6 @@ typedef std::pair<UpdateAttemptResponse, syncable::Id> AppliedUpdate;
// Tracks update application and verification.
class UpdateProgress {
public:
UpdateProgress();
~UpdateProgress();

void AddVerifyResult(const VerifyResult& verify_result,
const sync_pb::SyncEntity& entity);

Expand Down Expand Up @@ -226,9 +232,12 @@ class DirtyOnWrite {
// scope control (such as OrderedCommitSet), but the top level entity is still
// a singleton with respect to model types.
struct AllModelTypeState {
explicit AllModelTypeState(bool* dirty_flag);
~AllModelTypeState();

explicit AllModelTypeState(bool* dirty_flag)
: unsynced_handles(dirty_flag),
syncer_status(dirty_flag),
error_counters(dirty_flag),
num_server_changes_remaining(dirty_flag, 0),
commit_set(ModelSafeRoutingInfo()) {}
// Commits for all model types are bundled together into a single message.
ClientToServerMessage commit_message;
ClientToServerResponse commit_response;
Expand All @@ -247,18 +256,16 @@ struct AllModelTypeState {

// Grouping of all state that applies to a single ModelSafeGroup.
struct PerModelSafeGroupState {
explicit PerModelSafeGroupState(bool* dirty_flag);
~PerModelSafeGroupState();

explicit PerModelSafeGroupState(bool* dirty_flag)
: conflict_progress(dirty_flag) {}
UpdateProgress update_progress;
ConflictProgress conflict_progress;
};

// Grouping of all state that applies to a single ModelType.
struct PerModelTypeState {
explicit PerModelTypeState(bool* dirty_flag);
~PerModelTypeState();

explicit PerModelTypeState(bool* dirty_flag)
: current_download_timestamp(dirty_flag, 0) {}
DirtyOnWrite<int64> current_download_timestamp;
};

Expand Down
2 changes: 0 additions & 2 deletions chrome/browser/sync/sessions/status_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ StatusController::StatusController(const ModelSafeRoutingInfo& routes)
routing_info_(routes) {
}

StatusController::~StatusController() {}

bool StatusController::TestAndClearIsDirty() {
bool is_dirty = is_dirty_;
is_dirty_ = false;
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/sync/sessions/status_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ namespace sessions {
class StatusController {
public:
explicit StatusController(const ModelSafeRoutingInfo& routes);
~StatusController();

// Returns true if some portion of the session state has changed (is dirty)
// since it was created or was last reset.
Expand Down
Loading

0 comments on commit d0af720

Please sign in to comment.