OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ | 5 #ifndef SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ |
6 #define SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ | 6 #define SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "sync/base/sync_export.h" | 11 #include "sync/base/sync_export.h" |
12 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" | 12 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" |
13 | 13 |
14 namespace syncable { | 14 namespace syncable { |
15 class Id; | 15 class Id; |
16 } | 16 } |
17 | 17 |
18 namespace syncer { | 18 namespace syncer { |
19 | 19 |
20 struct SYNC_EXPORT_PRIVATE SyncEngineEvent { | 20 struct SYNC_EXPORT_PRIVATE SyncEngineEvent { |
21 enum EventCause { | 21 enum EventCause { |
22 //////////////////////////////////////////////////////////////// | 22 //////////////////////////////////////////////////////////////// |
23 // Sent on entry of Syncer state machine | 23 // Sent on entry of Syncer state machine |
24 SYNC_CYCLE_BEGIN, | 24 SYNC_CYCLE_BEGIN, |
25 | 25 |
26 // SyncerCommand generated events. | 26 // Sent any time progress is made during a sync cycle. |
27 STATUS_CHANGED, | 27 STATUS_CHANGED, |
28 | 28 |
29 // We have reached the SYNCER_END state in the main sync loop. | 29 // We have reached the SYNCER_END state in the main sync loop. |
30 SYNC_CYCLE_ENDED, | 30 SYNC_CYCLE_ENDED, |
31 | 31 |
32 //////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////// |
33 // Generated in response to specific protocol actions or events. | 33 // Generated in response to specific protocol actions or events. |
34 | 34 |
35 // This is sent after the Syncer (and SyncerThread) have initiated self | 35 // This is sent after the Syncer (and SyncerThread) have initiated self |
36 // halt due to no longer being permitted to communicate with the server. | 36 // halt due to no longer being permitted to communicate with the server. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // TODO(tim): Consider splitting this up to multiple callbacks, rather than | 74 // TODO(tim): Consider splitting this up to multiple callbacks, rather than |
75 // have to do Event e(type); OnSyncEngineEvent(e); at all callsites, | 75 // have to do Event e(type); OnSyncEngineEvent(e); at all callsites, |
76 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) = 0; | 76 virtual void OnSyncEngineEvent(const SyncEngineEvent& event) = 0; |
77 protected: | 77 protected: |
78 virtual ~SyncEngineEventListener() {} | 78 virtual ~SyncEngineEventListener() {} |
79 }; | 79 }; |
80 | 80 |
81 } // namespace syncer | 81 } // namespace syncer |
82 | 82 |
83 #endif // SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ | 83 #endif // SYNC_ENGINE_SYNC_ENGINE_EVENT_H_ |
OLD | NEW |