OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <bitset> | 10 #include <bitset> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "base/memory/ref_counted.h" | 26 #include "base/memory/ref_counted.h" |
27 #include "base/observer_list_threadsafe.h" | 27 #include "base/observer_list_threadsafe.h" |
28 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
29 #include "base/time.h" | 29 #include "base/time.h" |
30 #include "chrome/browser/sync/protocol/sync.pb.h" | 30 #include "chrome/browser/sync/protocol/sync.pb.h" |
31 #include "chrome/browser/sync/syncable/blob.h" | 31 #include "chrome/browser/sync/syncable/blob.h" |
32 #include "chrome/browser/sync/syncable/dir_open_result.h" | 32 #include "chrome/browser/sync/syncable/dir_open_result.h" |
33 #include "chrome/browser/sync/syncable/directory_event.h" | 33 #include "chrome/browser/sync/syncable/directory_event.h" |
34 #include "chrome/browser/sync/syncable/syncable_id.h" | 34 #include "chrome/browser/sync/syncable/syncable_id.h" |
35 #include "chrome/browser/sync/syncable/model_type.h" | 35 #include "chrome/browser/sync/syncable/model_type.h" |
36 #include "chrome/browser/sync/util/dbgq.h" | |
37 #include "chrome/browser/sync/util/immutable.h" | 36 #include "chrome/browser/sync/util/immutable.h" |
38 #include "chrome/browser/sync/util/time.h" | 37 #include "chrome/browser/sync/util/time.h" |
39 | 38 |
40 struct PurgeInfo; | 39 struct PurgeInfo; |
41 | 40 |
42 namespace base { | 41 namespace base { |
43 class DictionaryValue; | 42 class DictionaryValue; |
44 class ListValue; | 43 class ListValue; |
45 } | 44 } |
46 | 45 |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 // unique server IDs. No need to lock, only written at init time. | 1121 // unique server IDs. No need to lock, only written at init time. |
1123 const std::string cache_guid; | 1122 const std::string cache_guid; |
1124 | 1123 |
1125 // It doesn't make sense for two threads to run SaveChanges at the same | 1124 // It doesn't make sense for two threads to run SaveChanges at the same |
1126 // time; this mutex protects that activity. | 1125 // time; this mutex protects that activity. |
1127 base::Lock save_changes_mutex; | 1126 base::Lock save_changes_mutex; |
1128 | 1127 |
1129 // The next metahandle is protected by kernel mutex. | 1128 // The next metahandle is protected by kernel mutex. |
1130 int64 next_metahandle; | 1129 int64 next_metahandle; |
1131 | 1130 |
1132 // Keep a history of recently flushed metahandles for debugging | |
1133 // purposes. Protected by the save_changes_mutex. | |
1134 DebugQueue<int64, 1000> flushed_metahandles; | |
1135 | |
1136 // The delegate for directory change events. Can be NULL. | 1131 // The delegate for directory change events. Can be NULL. |
1137 DirectoryChangeDelegate* const delegate; | 1132 DirectoryChangeDelegate* const delegate; |
1138 | 1133 |
1139 // The transaction observers. | 1134 // The transaction observers. |
1140 scoped_refptr<ObserverListThreadSafe<TransactionObserver> > observers; | 1135 scoped_refptr<ObserverListThreadSafe<TransactionObserver> > observers; |
1141 }; | 1136 }; |
1142 | 1137 |
1143 // Helper method used to do searches on |parent_id_child_index|. | 1138 // Helper method used to do searches on |parent_id_child_index|. |
1144 ParentIdChildIndex::iterator LocateInParentChildIndex( | 1139 ParentIdChildIndex::iterator LocateInParentChildIndex( |
1145 const ScopedKernelLock& lock, | 1140 const ScopedKernelLock& lock, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 bool IsLegalNewParent(BaseTransaction* trans, const Id& id, const Id& parentid); | 1269 bool IsLegalNewParent(BaseTransaction* trans, const Id& id, const Id& parentid); |
1275 | 1270 |
1276 // This function sets only the flags needed to get this entry to sync. | 1271 // This function sets only the flags needed to get this entry to sync. |
1277 void MarkForSyncing(syncable::MutableEntry* e); | 1272 void MarkForSyncing(syncable::MutableEntry* e); |
1278 | 1273 |
1279 } // namespace syncable | 1274 } // namespace syncable |
1280 | 1275 |
1281 std::ostream& operator <<(std::ostream&, const syncable::Blob&); | 1276 std::ostream& operator <<(std::ostream&, const syncable::Blob&); |
1282 | 1277 |
1283 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ | 1278 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_H_ |
OLD | NEW |