summaryrefslogtreecommitdiffstats
path: root/chromium/sync/syncable/syncable_model_neutral_write_transaction.cc
blob: 9aaf74007268f7bffda9dee1d2fd942e6bbf40f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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