| 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 namespace browser_sync { |
| 13 class ProfileSyncService; | 13 class ProfileSyncService; |
| 14 } // namespace browser_sync | 14 } // namespace browser_sync |
| 15 | 15 |
| 16 namespace invalidation { | 16 namespace invalidation { |
| 17 class P2PInvalidationService; | 17 class P2PInvalidationService; |
| 18 } // namespace invalidation | 18 } // namespace invalidation |
| 19 | 19 |
| 20 // This class links the ProfileSyncService to a P2PInvalidationService. | 20 // This class links the ProfileSyncService to a P2PInvalidationService. |
| 21 // | 21 // |
| 22 // It will observe ProfileSyncService events and emit invalidation events for | 22 // It will observe ProfileSyncService events and emit invalidation events for |
| 23 // any committed changes in observes. | 23 // any committed changes in observes. |
| 24 // | 24 // |
| 25 // It register and unregisters in its constructor and destructor. This is | 25 // It register and unregisters in its constructor and destructor. This is |
| 26 // intended to make it easy to manage with a scoped_ptr. | 26 // intended to make it easy to manage with a scoped_ptr. |
| 27 class P2PInvalidationForwarder : public syncer::SyncServiceObserver { | 27 class P2PInvalidationForwarder : public sync_driver::SyncServiceObserver { |
| 28 public: | 28 public: |
| 29 P2PInvalidationForwarder( | 29 P2PInvalidationForwarder( |
| 30 browser_sync::ProfileSyncService* sync_service, | 30 browser_sync::ProfileSyncService* sync_service, |
| 31 invalidation::P2PInvalidationService* invalidation_service); | 31 invalidation::P2PInvalidationService* invalidation_service); |
| 32 ~P2PInvalidationForwarder() override; | 32 ~P2PInvalidationForwarder() override; |
| 33 | 33 |
| 34 // Implementation of syncer::SyncServiceObserver | 34 // Implementation of sync_driver::SyncServiceObserver |
| 35 void OnStateChanged() override; | 35 void OnStateChanged() override; |
| 36 void OnSyncCycleCompleted() override; | 36 void OnSyncCycleCompleted() override; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 browser_sync::ProfileSyncService* sync_service_; | 39 browser_sync::ProfileSyncService* sync_service_; |
| 40 invalidation::P2PInvalidationService* invalidation_service_; | 40 invalidation::P2PInvalidationService* invalidation_service_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(P2PInvalidationForwarder); | 42 DISALLOW_COPY_AND_ASSIGN(P2PInvalidationForwarder); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ | 45 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ |
| OLD | NEW |