1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "sync/syncable/scoped_parent_child_index_updater.h"
7 #include "sync/syncable/parent_child_index.h"
12 ScopedParentChildIndexUpdater::ScopedParentChildIndexUpdater(
13 ScopedKernelLock
& proof_of_lock
,
15 ParentChildIndex
* index
) : entry_(entry
), index_(index
) {
16 if (ParentChildIndex::ShouldInclude(entry_
)) {
17 index_
->Remove(entry_
);
21 ScopedParentChildIndexUpdater::~ScopedParentChildIndexUpdater() {
22 if (ParentChildIndex::ShouldInclude(entry_
)) {
23 index_
->Insert(entry_
);
28 } // namespace syncable