OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/syncable/scoped_parent_child_index_updater.h" | 5 #include "components/sync/syncable/scoped_parent_child_index_updater.h" |
6 | 6 |
7 #include "sync/syncable/parent_child_index.h" | 7 #include "components/sync/syncable/parent_child_index.h" |
8 | 8 |
9 namespace syncer { | 9 namespace syncer { |
10 namespace syncable { | 10 namespace syncable { |
11 | 11 |
12 ScopedParentChildIndexUpdater::ScopedParentChildIndexUpdater( | 12 ScopedParentChildIndexUpdater::ScopedParentChildIndexUpdater( |
13 const ScopedKernelLock& proof_of_lock, | 13 const ScopedKernelLock& proof_of_lock, |
14 EntryKernel* entry, | 14 EntryKernel* entry, |
15 ParentChildIndex* index) | 15 ParentChildIndex* index) |
16 : entry_(entry), index_(index) { | 16 : entry_(entry), index_(index) { |
17 if (ParentChildIndex::ShouldInclude(entry_)) { | 17 if (ParentChildIndex::ShouldInclude(entry_)) { |
18 index_->Remove(entry_); | 18 index_->Remove(entry_); |
19 } | 19 } |
20 } | 20 } |
21 | 21 |
22 ScopedParentChildIndexUpdater::~ScopedParentChildIndexUpdater() { | 22 ScopedParentChildIndexUpdater::~ScopedParentChildIndexUpdater() { |
23 if (ParentChildIndex::ShouldInclude(entry_)) { | 23 if (ParentChildIndex::ShouldInclude(entry_)) { |
24 index_->Insert(entry_); | 24 index_->Insert(entry_); |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
28 } // namespace syncable | 28 } // namespace syncable |
29 } // namespace syncer | 29 } // namespace syncer |
OLD | NEW |