Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/browser/sync/test/integration/p2p_sync_refresher.h

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_SYNC_REFRESHER_H_ 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/sync/driver/sync_service_observer.h" 9 #include "components/sync/driver/sync_service_observer.h"
10 10
11 class Profile; 11 class Profile;
12 12
13 namespace browser_sync { 13 namespace browser_sync {
14 class ProfileSyncService; 14 class ProfileSyncService;
15 } // namespace browser_sync 15 } // namespace browser_sync
16 16
17 // This class observes ProfileSyncService events and emits refresh notifications 17 // This class observes ProfileSyncService events and emits refresh notifications
18 // to other test profiles for any committed changes it observes. 18 // to other test profiles for any committed changes it observes.
19 // 19 //
20 // It register and unregisters in its constructor and destructor. This is 20 // It register and unregisters in its constructor and destructor. This is
21 // intended to make it easy to manage with a scoped_ptr. 21 // intended to make it easy to manage with a scoped_ptr.
22 class P2PSyncRefresher : public syncer::SyncServiceObserver { 22 class P2PSyncRefresher : public syncer::SyncServiceObserver {
23 public: 23 public:
24 P2PSyncRefresher(Profile* profile, 24 P2PSyncRefresher(Profile* profile,
25 browser_sync::ProfileSyncService* sync_service); 25 browser_sync::ProfileSyncService* sync_service);
26 ~P2PSyncRefresher() override; 26 ~P2PSyncRefresher() override;
27 27
28 // Implementation of syncer::SyncServiceObserver 28 // Implementation of syncer::SyncServiceObserver
29 void OnStateChanged() override; 29 void OnSyncCycleCompleted(syncer::SyncService* sync) override;
30 void OnSyncCycleCompleted() override;
31 30
32 private: 31 private:
33 Profile* const profile_; // weak 32 Profile* const profile_; // weak
34 browser_sync::ProfileSyncService* sync_service_; // weak 33 browser_sync::ProfileSyncService* sync_service_; // weak
35 34
36 DISALLOW_COPY_AND_ASSIGN(P2PSyncRefresher); 35 DISALLOW_COPY_AND_ASSIGN(P2PSyncRefresher);
37 }; 36 };
38 37
39 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ 38 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698