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 // Interface to the sync notifier, which is an object that receives | 5 // Interface to the sync notifier, which is an object that receives |
6 // notifications when updates are available for a set of sync types. | 6 // notifications when updates are available for a set of sync types. |
7 // All the observers are notified when such an event happens. | 7 // All the observers are notified when such an event happens. |
| 8 // |
| 9 // A SyncNotifier must be destroyed on the same thread it was created on, |
| 10 // and all its methods must be called on the same thread (not necessarily |
| 11 // the one it was created on). If the methods thread is different from the |
| 12 // creation thread, then the methods thread must not exist when the SyncNotifier |
| 13 // is created and destroyed. |
| 14 // |
| 15 // In particular, the SyncNotifier will be created on the UI thread, the syncer |
| 16 // core thread will be created, the SyncNotifier will be used on that core |
| 17 // thread, the syncer core thread will be destroyed, and then the SyncNotifier |
| 18 // will be destroyed. |
| 19 // |
| 20 // TODO(akalin): Remove the code to deal with this situation once the syncer |
| 21 // core thread goes away. |
8 | 22 |
9 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_ | 23 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_ |
10 #define CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_ | 24 #define CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_ |
11 | 25 |
12 #include <string> | 26 #include <string> |
13 | 27 |
14 #include "chrome/browser/sync/syncable/model_type.h" | 28 #include "chrome/browser/sync/syncable/model_type.h" |
15 | 29 |
16 namespace sync_notifier { | 30 namespace sync_notifier { |
17 class SyncNotifierObserver; | 31 class SyncNotifierObserver; |
(...skipping 20 matching lines...) Expand all Loading... |
38 // This is here only to support the old p2p notification implementation, | 52 // This is here only to support the old p2p notification implementation, |
39 // which is still used by sync integration tests. | 53 // which is still used by sync integration tests. |
40 // TODO(akalin): Remove this once we move the integration tests off p2p | 54 // TODO(akalin): Remove this once we move the integration tests off p2p |
41 // notifications. | 55 // notifications. |
42 virtual void SendNotification() = 0; | 56 virtual void SendNotification() = 0; |
43 }; | 57 }; |
44 } // namespace sync_notifier | 58 } // namespace sync_notifier |
45 | 59 |
46 #endif // CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_ | 60 #endif // CHROME_BROWSER_SYNC_NOTIFIER_SYNC_NOTIFIER_H_ |
47 | 61 |
OLD | NEW |