summaryrefslogtreecommitdiffstats
path: root/sync/syncable/syncable_model_neutral_write_transaction.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sync/syncable/syncable_model_neutral_write_transaction.cc')
-rw-r--r--sync/syncable/syncable_model_neutral_write_transaction.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/sync/syncable/syncable_model_neutral_write_transaction.cc b/sync/syncable/syncable_model_neutral_write_transaction.cc
new file mode 100644
index 0000000..9aaf740
--- /dev/null
+++ b/sync/syncable/syncable_model_neutral_write_transaction.cc
@@ -0,0 +1,33 @@
+// Copyright 2013 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.
+
+#include "sync/syncable/syncable_model_neutral_write_transaction.h"
+
+#include "sync/syncable/directory.h"
+
+namespace syncer {
+namespace syncable {
+
+ModelNeutralWriteTransaction::ModelNeutralWriteTransaction(
+ const tracked_objects::Location& location,
+ WriterTag writer, Directory* directory)
+ : BaseWriteTransaction(location,
+ "ModelNeutralWriteTransaction",
+ writer,
+ directory) {
+ Lock();
+}
+
+ModelNeutralWriteTransaction::~ModelNeutralWriteTransaction() {
+ directory()->CheckInvariantsOnTransactionClose(this, modified_handles_);
+ HandleUnrecoverableErrorIfSet();
+ Unlock();
+}
+
+void ModelNeutralWriteTransaction::TrackChangesTo(const EntryKernel* entry) {
+ modified_handles_.insert(entry->ref(META_HANDLE));
+}
+
+} // namespace syncer
+} // namespace syncable