| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
| 6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/gtest_prod_util.h" |
| 13 #include "base/lock.h" | 14 #include "base/lock.h" |
| 14 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
| 15 #include "chrome/browser/sync/engine/conflict_resolver.h" | 16 #include "chrome/browser/sync/engine/conflict_resolver.h" |
| 16 #include "chrome/browser/sync/engine/syncer_types.h" | 17 #include "chrome/browser/sync/engine/syncer_types.h" |
| 17 #include "chrome/browser/sync/engine/syncproto.h" | 18 #include "chrome/browser/sync/engine/syncproto.h" |
| 18 #include "chrome/browser/sync/sessions/sync_session.h" | 19 #include "chrome/browser/sync/sessions/sync_session.h" |
| 19 #include "chrome/browser/sync/syncable/directory_event.h" | 20 #include "chrome/browser/sync/syncable/directory_event.h" |
| 20 #include "chrome/browser/sync/util/closure.h" | 21 #include "chrome/browser/sync/util/closure.h" |
| 21 #include "chrome/browser/sync/util/extensions_activity_monitor.h" | 22 #include "chrome/browser/sync/util/extensions_activity_monitor.h" |
| 22 #include "chrome/common/deprecated/event_sys.h" | 23 #include "chrome/common/deprecated/event_sys.h" |
| 23 #include "chrome/common/deprecated/event_sys-inl.h" | 24 #include "chrome/common/deprecated/event_sys-inl.h" |
| 24 #include "testing/gtest/include/gtest/gtest_prod.h" // For FRIEND_TEST | |
| 25 | 25 |
| 26 namespace syncable { | 26 namespace syncable { |
| 27 class Directory; | 27 class Directory; |
| 28 class DirectoryManager; | 28 class DirectoryManager; |
| 29 class Entry; | 29 class Entry; |
| 30 class Id; | 30 class Id; |
| 31 class MutableEntry; | 31 class MutableEntry; |
| 32 class WriteTransaction; | 32 class WriteTransaction; |
| 33 } // namespace syncable | 33 } // namespace syncable |
| 34 | 34 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 scoped_ptr<ShutdownChannel> shutdown_channel_; | 159 scoped_ptr<ShutdownChannel> shutdown_channel_; |
| 160 | 160 |
| 161 // The source of the last nudge. | 161 // The source of the last nudge. |
| 162 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source_; | 162 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source_; |
| 163 | 163 |
| 164 // A callback hook used in unittests to simulate changes between conflict set | 164 // A callback hook used in unittests to simulate changes between conflict set |
| 165 // building and conflict resolution. | 165 // building and conflict resolution. |
| 166 Closure* pre_conflict_resolution_closure_; | 166 Closure* pre_conflict_resolution_closure_; |
| 167 | 167 |
| 168 friend class SyncerTest; | 168 friend class SyncerTest; |
| 169 FRIEND_TEST(SyncerTest, NameClashWithResolver); | 169 FRIEND_TEST_ALL_PREFIXES(SyncerTest, NameClashWithResolver); |
| 170 FRIEND_TEST(SyncerTest, IllegalAndLegalUpdates); | 170 FRIEND_TEST_ALL_PREFIXES(SyncerTest, IllegalAndLegalUpdates); |
| 171 FRIEND_TEST(SusanDeletingTest, | 171 FRIEND_TEST_ALL_PREFIXES(SusanDeletingTest, |
| 172 NewServerItemInAFolderHierarchyWeHaveDeleted3); | 172 NewServerItemInAFolderHierarchyWeHaveDeleted3); |
| 173 FRIEND_TEST(SyncerTest, TestCommitListOrderingAndNewParent); | 173 FRIEND_TEST_ALL_PREFIXES(SyncerTest, TestCommitListOrderingAndNewParent); |
| 174 FRIEND_TEST(SyncerTest, TestCommitListOrderingAndNewParentAndChild); | 174 FRIEND_TEST_ALL_PREFIXES(SyncerTest, |
| 175 FRIEND_TEST(SyncerTest, TestCommitListOrderingCounterexample); | 175 TestCommitListOrderingAndNewParentAndChild); |
| 176 FRIEND_TEST(SyncerTest, TestCommitListOrderingWithNesting); | 176 FRIEND_TEST_ALL_PREFIXES(SyncerTest, TestCommitListOrderingCounterexample); |
| 177 FRIEND_TEST(SyncerTest, TestCommitListOrderingWithNewItems); | 177 FRIEND_TEST_ALL_PREFIXES(SyncerTest, TestCommitListOrderingWithNesting); |
| 178 FRIEND_TEST(SyncerTest, TestGetUnsyncedAndSimpleCommit); | 178 FRIEND_TEST_ALL_PREFIXES(SyncerTest, TestCommitListOrderingWithNewItems); |
| 179 FRIEND_TEST(SyncerTest, UnappliedUpdateDuringCommit); | 179 FRIEND_TEST_ALL_PREFIXES(SyncerTest, TestGetUnsyncedAndSimpleCommit); |
| 180 FRIEND_TEST(SyncerTest, DeletingEntryInFolder); | 180 FRIEND_TEST_ALL_PREFIXES(SyncerTest, UnappliedUpdateDuringCommit); |
| 181 FRIEND_TEST(SyncerTest, LongChangelistCreatesFakeOrphanedEntries); | 181 FRIEND_TEST_ALL_PREFIXES(SyncerTest, DeletingEntryInFolder); |
| 182 FRIEND_TEST(SyncerTest, QuicklyMergeDualCreatedHierarchy); | 182 FRIEND_TEST_ALL_PREFIXES(SyncerTest, |
| 183 FRIEND_TEST(SyncerTest, LongChangelistWithApplicationConflict); | 183 LongChangelistCreatesFakeOrphanedEntries); |
| 184 FRIEND_TEST_ALL_PREFIXES(SyncerTest, QuicklyMergeDualCreatedHierarchy); |
| 185 FRIEND_TEST_ALL_PREFIXES(SyncerTest, LongChangelistWithApplicationConflict); |
| 184 | 186 |
| 185 DISALLOW_COPY_AND_ASSIGN(Syncer); | 187 DISALLOW_COPY_AND_ASSIGN(Syncer); |
| 186 }; | 188 }; |
| 187 | 189 |
| 188 // Inline utility functions. | 190 // Inline utility functions. |
| 189 | 191 |
| 190 // Given iterator ranges from two collections sorted according to a common | 192 // Given iterator ranges from two collections sorted according to a common |
| 191 // strict weak ordering, return true if the two ranges contain any common | 193 // strict weak ordering, return true if the two ranges contain any common |
| 192 // items, and false if they do not. This function is in this header so that it | 194 // items, and false if they do not. This function is in this header so that it |
| 193 // can be tested. | 195 // can be tested. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 206 } | 208 } |
| 207 return false; | 209 return false; |
| 208 } | 210 } |
| 209 // Utility function declarations. | 211 // Utility function declarations. |
| 210 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); | 212 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); |
| 211 void ClearServerData(syncable::MutableEntry* entry); | 213 void ClearServerData(syncable::MutableEntry* entry); |
| 212 | 214 |
| 213 } // namespace browser_sync | 215 } // namespace browser_sync |
| 214 | 216 |
| 215 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 217 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
| OLD | NEW |