| 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_SYNCABLE_SYNCABLE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ |
| 6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ | 6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <bitset> | 9 #include <bitset> |
| 10 #include <iosfwd> | 10 #include <iosfwd> |
| 11 #include <limits> | 11 #include <limits> |
| 12 #include <map> | 12 #include <map> |
| 13 #include <set> | 13 #include <set> |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/atomicops.h" | 17 #include "base/atomicops.h" |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 #include "base/file_path.h" | 19 #include "base/file_path.h" |
| 20 #include "base/gtest_prod_util.h" |
| 20 #include "base/lock.h" | 21 #include "base/lock.h" |
| 21 #include "base/time.h" | 22 #include "base/time.h" |
| 22 #include "chrome/browser/sync/protocol/sync.pb.h" | 23 #include "chrome/browser/sync/protocol/sync.pb.h" |
| 23 #include "chrome/browser/sync/syncable/blob.h" | 24 #include "chrome/browser/sync/syncable/blob.h" |
| 24 #include "chrome/browser/sync/syncable/dir_open_result.h" | 25 #include "chrome/browser/sync/syncable/dir_open_result.h" |
| 25 #include "chrome/browser/sync/syncable/directory_event.h" | 26 #include "chrome/browser/sync/syncable/directory_event.h" |
| 26 #include "chrome/browser/sync/syncable/path_name_cmp.h" | 27 #include "chrome/browser/sync/syncable/path_name_cmp.h" |
| 27 #include "chrome/browser/sync/syncable/syncable_id.h" | 28 #include "chrome/browser/sync/syncable/syncable_id.h" |
| 28 #include "chrome/browser/sync/syncable/model_type.h" | 29 #include "chrome/browser/sync/syncable/model_type.h" |
| 29 #include "chrome/browser/sync/util/dbgq.h" | 30 #include "chrome/browser/sync/util/dbgq.h" |
| 30 #include "chrome/browser/sync/util/row_iterator.h" | 31 #include "chrome/browser/sync/util/row_iterator.h" |
| 31 #include "chrome/browser/sync/util/sync_types.h" | 32 #include "chrome/browser/sync/util/sync_types.h" |
| 32 #include "chrome/common/deprecated/event_sys.h" | 33 #include "chrome/common/deprecated/event_sys.h" |
| 33 #include "testing/gtest/include/gtest/gtest_prod.h" // For FRIEND_TEST | |
| 34 | 34 |
| 35 struct PurgeInfo; | 35 struct PurgeInfo; |
| 36 | 36 |
| 37 namespace sync_api { | 37 namespace sync_api { |
| 38 class ReadTransaction; | 38 class ReadTransaction; |
| 39 class WriteNode; | 39 class WriteNode; |
| 40 class ReadNode; | 40 class ReadNode; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace syncable { | 43 namespace syncable { |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 friend class Entry; | 661 friend class Entry; |
| 662 friend class ExtendedAttribute; | 662 friend class ExtendedAttribute; |
| 663 friend class MutableEntry; | 663 friend class MutableEntry; |
| 664 friend class MutableExtendedAttribute; | 664 friend class MutableExtendedAttribute; |
| 665 friend class ReadTransaction; | 665 friend class ReadTransaction; |
| 666 friend class ReadTransactionWithoutDB; | 666 friend class ReadTransactionWithoutDB; |
| 667 friend class ScopedKernelLock; | 667 friend class ScopedKernelLock; |
| 668 friend class ScopedKernelUnlock; | 668 friend class ScopedKernelUnlock; |
| 669 friend class WriteTransaction; | 669 friend class WriteTransaction; |
| 670 friend class SyncableDirectoryTest; | 670 friend class SyncableDirectoryTest; |
| 671 FRIEND_TEST(SyncableDirectoryTest, TakeSnapshotGetsAllDirtyHandlesTest); | 671 FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, |
| 672 FRIEND_TEST(SyncableDirectoryTest, TakeSnapshotGetsOnlyDirtyHandlesTest); | 672 TakeSnapshotGetsAllDirtyHandlesTest); |
| 673 FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, |
| 674 TakeSnapshotGetsOnlyDirtyHandlesTest); |
| 673 | 675 |
| 674 public: | 676 public: |
| 675 // Various data that the Directory::Kernel we are backing (persisting data | 677 // Various data that the Directory::Kernel we are backing (persisting data |
| 676 // for) needs saved across runs of the application. | 678 // for) needs saved across runs of the application. |
| 677 struct PersistedKernelInfo { | 679 struct PersistedKernelInfo { |
| 678 // Last sync timestamp fetched from the server. | 680 // Last sync timestamp fetched from the server. |
| 679 int64 last_download_timestamp[MODEL_TYPE_COUNT]; | 681 int64 last_download_timestamp[MODEL_TYPE_COUNT]; |
| 680 // true iff we ever reached the end of the changelog. | 682 // true iff we ever reached the end of the changelog. |
| 681 ModelTypeBitSet initial_sync_ended; | 683 ModelTypeBitSet initial_sync_ended; |
| 682 // The store birthday we were given by the server. Contents are opaque to | 684 // The store birthday we were given by the server. Contents are opaque to |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 void ZeroFields(EntryKernel* entry, int first_field); | 1173 void ZeroFields(EntryKernel* entry, int first_field); |
| 1172 | 1174 |
| 1173 } // namespace syncable | 1175 } // namespace syncable |
| 1174 | 1176 |
| 1175 std::ostream& operator <<(std::ostream&, const syncable::Blob&); | 1177 std::ostream& operator <<(std::ostream&, const syncable::Blob&); |
| 1176 | 1178 |
| 1177 browser_sync::FastDump& operator << | 1179 browser_sync::FastDump& operator << |
| 1178 (browser_sync::FastDump&, const syncable::Blob&); | 1180 (browser_sync::FastDump&, const syncable::Blob&); |
| 1179 | 1181 |
| 1180 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ | 1182 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ |
| OLD | NEW |