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

Side by Side Diff: chrome/browser/sync/test_profile_sync_service.h

Issue 666733003: Standardize usage of virtual/override/final in chrome/browser/sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « chrome/browser/sync/test/test_http_bridge_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 23 matching lines...) Expand all
34 34
35 namespace browser_sync { 35 namespace browser_sync {
36 36
37 class SyncBackendHostForProfileSyncTest : public SyncBackendHostImpl { 37 class SyncBackendHostForProfileSyncTest : public SyncBackendHostImpl {
38 public: 38 public:
39 SyncBackendHostForProfileSyncTest( 39 SyncBackendHostForProfileSyncTest(
40 Profile* profile, 40 Profile* profile,
41 invalidation::InvalidationService* invalidator, 41 invalidation::InvalidationService* invalidator,
42 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, 42 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs,
43 base::Closure callback); 43 base::Closure callback);
44 virtual ~SyncBackendHostForProfileSyncTest(); 44 ~SyncBackendHostForProfileSyncTest() override;
45 45
46 virtual void RequestConfigureSyncer( 46 void RequestConfigureSyncer(
47 syncer::ConfigureReason reason, 47 syncer::ConfigureReason reason,
48 syncer::ModelTypeSet to_download, 48 syncer::ModelTypeSet to_download,
49 syncer::ModelTypeSet to_purge, 49 syncer::ModelTypeSet to_purge,
50 syncer::ModelTypeSet to_journal, 50 syncer::ModelTypeSet to_journal,
51 syncer::ModelTypeSet to_unapply, 51 syncer::ModelTypeSet to_unapply,
52 syncer::ModelTypeSet to_ignore, 52 syncer::ModelTypeSet to_ignore,
53 const syncer::ModelSafeRoutingInfo& routing_info, 53 const syncer::ModelSafeRoutingInfo& routing_info,
54 const base::Callback<void(syncer::ModelTypeSet, 54 const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>&
55 syncer::ModelTypeSet)>& ready_task, 55 ready_task,
56 const base::Closure& retry_callback) override; 56 const base::Closure& retry_callback) override;
57 57
58 protected: 58 protected:
59 virtual void InitCore(scoped_ptr<DoInitializeOptions> options) override; 59 void InitCore(scoped_ptr<DoInitializeOptions> options) override;
60 60
61 private: 61 private:
62 // Invoked at the start of HandleSyncManagerInitializationOnFrontendLoop. 62 // Invoked at the start of HandleSyncManagerInitializationOnFrontendLoop.
63 // Allows extra initialization work to be performed before the backend comes 63 // Allows extra initialization work to be performed before the backend comes
64 // up. 64 // up.
65 base::Closure callback_; 65 base::Closure callback_;
66 }; 66 };
67 67
68 } // namespace browser_sync 68 } // namespace browser_sync
69 69
70 class TestProfileSyncService : public ProfileSyncService { 70 class TestProfileSyncService : public ProfileSyncService {
71 public: 71 public:
72 // TODO(tim): Add ability to inject TokenService alongside SigninManager. 72 // TODO(tim): Add ability to inject TokenService alongside SigninManager.
73 // TODO(rogerta): what does above comment mean? 73 // TODO(rogerta): what does above comment mean?
74 TestProfileSyncService( 74 TestProfileSyncService(
75 scoped_ptr<ProfileSyncComponentsFactory> factory, 75 scoped_ptr<ProfileSyncComponentsFactory> factory,
76 Profile* profile, 76 Profile* profile,
77 SigninManagerBase* signin, 77 SigninManagerBase* signin,
78 ProfileOAuth2TokenService* oauth2_token_service, 78 ProfileOAuth2TokenService* oauth2_token_service,
79 browser_sync::ProfileSyncServiceStartBehavior behavior); 79 browser_sync::ProfileSyncServiceStartBehavior behavior);
80 80
81 virtual ~TestProfileSyncService(); 81 ~TestProfileSyncService() override;
82 82
83 virtual void OnConfigureDone( 83 void OnConfigureDone(
84 const sync_driver::DataTypeManager::ConfigureResult& result) override; 84 const sync_driver::DataTypeManager::ConfigureResult& result) override;
85 85
86 // We implement our own version to avoid some DCHECKs. 86 // We implement our own version to avoid some DCHECKs.
87 virtual syncer::UserShare* GetUserShare() const override; 87 syncer::UserShare* GetUserShare() const override;
88 88
89 static TestProfileSyncService* BuildAutoStartAsyncInit( 89 static TestProfileSyncService* BuildAutoStartAsyncInit(
90 Profile* profile, base::Closure callback); 90 Profile* profile, base::Closure callback);
91 91
92 ProfileSyncComponentsFactoryMock* components_factory_mock(); 92 ProfileSyncComponentsFactoryMock* components_factory_mock();
93 93
94 syncer::TestIdFactory* id_factory(); 94 syncer::TestIdFactory* id_factory();
95 95
96 // Raise visibility to ease testing. 96 // Raise visibility to ease testing.
97 using ProfileSyncService::NotifyObservers; 97 using ProfileSyncService::NotifyObservers;
98 98
99 protected: 99 protected:
100 static KeyedService* TestFactoryFunction(content::BrowserContext* profile); 100 static KeyedService* TestFactoryFunction(content::BrowserContext* profile);
101 101
102 // Return NULL handle to use in backend initialization to avoid receiving 102 // Return NULL handle to use in backend initialization to avoid receiving
103 // js messages on UI loop when it's being destroyed, which are not deleted 103 // js messages on UI loop when it's being destroyed, which are not deleted
104 // and cause memory leak in test. 104 // and cause memory leak in test.
105 virtual syncer::WeakHandle<syncer::JsEventHandler> GetJsEventHandler() 105 syncer::WeakHandle<syncer::JsEventHandler> GetJsEventHandler() override;
106 override;
107 106
108 virtual bool NeedBackup() const override; 107 bool NeedBackup() const override;
109 108
110 private: 109 private:
111 syncer::TestIdFactory id_factory_; 110 syncer::TestIdFactory id_factory_;
112 }; 111 };
113 112
114 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ 113 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/test_http_bridge_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698