summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/base_transaction.cc
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 04:16:33 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 04:16:33 +0000
commit16b85e8a64fd14f425d9b12c8b6802d5e41c1853 (patch)
tree3c5ddbcef5b4c05824a6c197ae558c12ac027f75 /sync/internal_api/base_transaction.cc
parent6bf30d0a453f8647c63d261a2f603a2c3939566b (diff)
downloadchromium_src-16b85e8a64fd14f425d9b12c8b6802d5e41c1853.zip
chromium_src-16b85e8a64fd14f425d9b12c8b6802d5e41c1853.tar.gz
chromium_src-16b85e8a64fd14f425d9b12c8b6802d5e41c1853.tar.bz2
Sync: Add DeviceInfo's ChangeProcessor
This is the long-awaited change to enable DeviceInfo tracking. Long ago (r161496) we committed code to support the DeviceInfo type, but we had to leave this code disabled until the server was ready to support the new type. That support has now been added. This change includes a very special kind of ChangeProcessor named SyncedDeviceTracker. It is the only ChangeProcessor that is owned by the sync thread. The SyncBackendHost creates and initializes it during backend intialization and deletes it before the UserShare it references is destroyed. As part of its initialization, the SyncedDeviceTracker will update the DeviceInfo entry for the current device. The SyncedDeviceTracker could support sending notifications to any interested listeners when new or update DeviceInfo information arrives, but this functionality has not been implemented yet. Also included are: - Tests for the SyncedDeviceTracker - A MockTransactionObserver to support these tests - A cache_guid() accessor on the SyncManager, used to initialize the SyncedDeviceTracker - Remove support for default constructing a DeviceInfo object BUG=122825 Review URL: https://chromiumcodereview.appspot.com/11360259 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/base_transaction.cc')
-rw-r--r--sync/internal_api/base_transaction.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/sync/internal_api/base_transaction.cc b/sync/internal_api/base_transaction.cc
index 11a8ca4..cbfb246 100644
--- a/sync/internal_api/base_transaction.cc
+++ b/sync/internal_api/base_transaction.cc
@@ -12,19 +12,20 @@ namespace syncer {
//////////////////////////////////////////////////////////////////////////
// BaseTransaction member definitions
-BaseTransaction::BaseTransaction(UserShare* share) {
+BaseTransaction::BaseTransaction(UserShare* share)
+ : user_share_(share) {
DCHECK(share && share->directory.get());
- directory_ = share->directory.get();
}
+
BaseTransaction::~BaseTransaction() {
}
Cryptographer* BaseTransaction::GetCryptographer() const {
- return directory_->GetCryptographer(this->GetWrappedTrans());
+ return GetDirectory()->GetCryptographer(this->GetWrappedTrans());
}
ModelTypeSet BaseTransaction::GetEncryptedTypes() const {
- return directory_->GetNigoriHandler()->GetEncryptedTypes(
+ return GetDirectory()->GetNigoriHandler()->GetEncryptedTypes(
this->GetWrappedTrans());
}