OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/sync/driver/sync_service_observer.h" | 10 #include "components/sync/driver/sync_service_observer.h" |
11 | 11 |
| 12 namespace browser_sync { |
12 class ProfileSyncService; | 13 class ProfileSyncService; |
| 14 } // namespace browser_sync |
13 | 15 |
14 namespace invalidation { | 16 namespace invalidation { |
15 class P2PInvalidationService; | 17 class P2PInvalidationService; |
16 }; | 18 } // namespace invalidation |
17 | 19 |
18 // This class links the ProfileSyncService to a P2PInvalidationService. | 20 // This class links the ProfileSyncService to a P2PInvalidationService. |
19 // | 21 // |
20 // It will observe ProfileSyncService events and emit invalidation events for | 22 // It will observe ProfileSyncService events and emit invalidation events for |
21 // any committed changes in observes. | 23 // any committed changes in observes. |
22 // | 24 // |
23 // It register and unregisters in its constructor and destructor. This is | 25 // It register and unregisters in its constructor and destructor. This is |
24 // intended to make it easy to manage with a scoped_ptr. | 26 // intended to make it easy to manage with a scoped_ptr. |
25 class P2PInvalidationForwarder : public sync_driver::SyncServiceObserver { | 27 class P2PInvalidationForwarder : public sync_driver::SyncServiceObserver { |
26 public: | 28 public: |
27 P2PInvalidationForwarder( | 29 P2PInvalidationForwarder( |
28 ProfileSyncService* sync_service, | 30 browser_sync::ProfileSyncService* sync_service, |
29 invalidation::P2PInvalidationService* invalidation_service); | 31 invalidation::P2PInvalidationService* invalidation_service); |
30 ~P2PInvalidationForwarder() override; | 32 ~P2PInvalidationForwarder() override; |
31 | 33 |
32 // Implementation of sync_driver::SyncServiceObserver | 34 // Implementation of sync_driver::SyncServiceObserver |
33 void OnStateChanged() override; | 35 void OnStateChanged() override; |
34 void OnSyncCycleCompleted() override; | 36 void OnSyncCycleCompleted() override; |
35 | 37 |
36 private: | 38 private: |
37 ProfileSyncService* sync_service_; | 39 browser_sync::ProfileSyncService* sync_service_; |
38 invalidation::P2PInvalidationService* invalidation_service_; | 40 invalidation::P2PInvalidationService* invalidation_service_; |
39 | 41 |
40 DISALLOW_COPY_AND_ASSIGN(P2PInvalidationForwarder); | 42 DISALLOW_COPY_AND_ASSIGN(P2PInvalidationForwarder); |
41 }; | 43 }; |
42 | 44 |
43 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ | 45 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ |
OLD | NEW |