summaryrefslogtreecommitdiffstats
path: root/components/sync_driver
diff options
context:
space:
mode:
authormohan.reddy <mohan.reddy@samsung.com>2014-09-10 06:33:00 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-10 13:42:19 +0000
commitd97aafa2698638f2f207538980014b6e461e382c (patch)
tree8720732fc762671e92d85491f304e7a493583119 /components/sync_driver
parent534f477b55a79cb4829d95c48d310cfedca09470 (diff)
downloadchromium_src-d97aafa2698638f2f207538980014b6e461e382c.zip
chromium_src-d97aafa2698638f2f207538980014b6e461e382c.tar.gz
chromium_src-d97aafa2698638f2f207538980014b6e461e382c.tar.bz2
Refactoring the WeakPtrFactory usage, Member variables should appear before the WeakPtrFactory, to ensure that any WeakPtrs to Controller are invalidated before its members variable's destructors are executed, rendering them invalid.
BUG=303818 Review URL: https://codereview.chromium.org/554233002 Cr-Commit-Position: refs/heads/master@{#294163}
Diffstat (limited to 'components/sync_driver')
-rw-r--r--components/sync_driver/model_association_manager.cc4
-rw-r--r--components/sync_driver/model_association_manager.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/components/sync_driver/model_association_manager.cc b/components/sync_driver/model_association_manager.cc
index 05ef0ab..658b1bf 100644
--- a/components/sync_driver/model_association_manager.cc
+++ b/components/sync_driver/model_association_manager.cc
@@ -114,8 +114,8 @@ ModelAssociationManager::ModelAssociationManager(
: state_(IDLE),
controllers_(controllers),
delegate_(processor),
- weak_ptr_factory_(this),
- configure_status_(DataTypeManager::UNKNOWN) {
+ configure_status_(DataTypeManager::UNKNOWN),
+ weak_ptr_factory_(this) {
// Ensure all data type controllers are stopped.
for (DataTypeController::TypeMap::const_iterator it = controllers_->begin();
it != controllers_->end(); ++it) {
diff --git a/components/sync_driver/model_association_manager.h b/components/sync_driver/model_association_manager.h
index a29eea6..ce209f4 100644
--- a/components/sync_driver/model_association_manager.h
+++ b/components/sync_driver/model_association_manager.h
@@ -146,10 +146,10 @@ class ModelAssociationManager {
// Timer to track and limit how long a datatype takes to model associate.
base::OneShotTimer<ModelAssociationManager> timer_;
- base::WeakPtrFactory<ModelAssociationManager> weak_ptr_factory_;
-
DataTypeManager::ConfigureStatus configure_status_;
+ base::WeakPtrFactory<ModelAssociationManager> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ModelAssociationManager);
};