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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_engine.h

Issue 243583005: Revert of [SyncFS] Post tasks between SyncEngine and SyncWorker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 public: 55 public:
56 typedef Observer SyncServiceObserver; 56 typedef Observer SyncServiceObserver;
57 57
58 static scoped_ptr<SyncEngine> CreateForBrowserContext( 58 static scoped_ptr<SyncEngine> CreateForBrowserContext(
59 content::BrowserContext* context); 59 content::BrowserContext* context);
60 static void AppendDependsOnFactories( 60 static void AppendDependsOnFactories(
61 std::set<BrowserContextKeyedServiceFactory*>* factories); 61 std::set<BrowserContextKeyedServiceFactory*>* factories);
62 62
63 virtual ~SyncEngine(); 63 virtual ~SyncEngine();
64 64
65 void Initialize(const base::FilePath& base_dir, 65 void Initialize(
66 base::SequencedTaskRunner* file_task_runner, 66 const base::FilePath& base_dir,
67 leveldb::Env* env_override); 67 base::SequencedTaskRunner* task_runner,
68 leveldb::Env* env_override);
68 69
69 // RemoteFileSyncService overrides. 70 // RemoteFileSyncService overrides.
70 virtual void AddServiceObserver(SyncServiceObserver* observer) OVERRIDE; 71 virtual void AddServiceObserver(SyncServiceObserver* observer) OVERRIDE;
71 virtual void AddFileStatusObserver(FileStatusObserver* observer) OVERRIDE; 72 virtual void AddFileStatusObserver(FileStatusObserver* observer) OVERRIDE;
72 virtual void RegisterOrigin( 73 virtual void RegisterOrigin(
73 const GURL& origin, 74 const GURL& origin,
74 const SyncStatusCallback& callback) OVERRIDE; 75 const SyncStatusCallback& callback) OVERRIDE;
75 virtual void EnableOrigin( 76 virtual void EnableOrigin(
76 const GURL& origin, 77 const GURL& origin,
77 const SyncStatusCallback& callback) OVERRIDE; 78 const SyncStatusCallback& callback) OVERRIDE;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void UpdateSyncEnabled(bool enabled); 140 void UpdateSyncEnabled(bool enabled);
140 141
141 private: 142 private:
142 friend class DriveBackendSyncTest; 143 friend class DriveBackendSyncTest;
143 friend class SyncEngineTest; 144 friend class SyncEngineTest;
144 // TODO(peria): Remove friendship with SyncWorker 145 // TODO(peria): Remove friendship with SyncWorker
145 friend class SyncWorker; 146 friend class SyncWorker;
146 147
147 SyncEngine(scoped_ptr<drive::DriveServiceInterface> drive_service, 148 SyncEngine(scoped_ptr<drive::DriveServiceInterface> drive_service,
148 scoped_ptr<drive::DriveUploaderInterface> drive_uploader, 149 scoped_ptr<drive::DriveUploaderInterface> drive_uploader,
149 base::SequencedTaskRunner* worker_task_runner,
150 drive::DriveNotificationManager* notification_manager, 150 drive::DriveNotificationManager* notification_manager,
151 ExtensionServiceInterface* extension_service, 151 ExtensionServiceInterface* extension_service,
152 SigninManagerBase* signin_manager); 152 SigninManagerBase* signin_manager);
153 153
154 void DidProcessRemoteChange(RemoteToLocalSyncer* syncer); 154 void DidProcessRemoteChange(RemoteToLocalSyncer* syncer);
155 void DidApplyLocalChange(LocalToRemoteSyncer* syncer, 155 void DidApplyLocalChange(LocalToRemoteSyncer* syncer,
156 SyncStatusCode status); 156 SyncStatusCode status);
157 void UpdateServiceState(const std::string& description); 157 void UpdateServiceState(const std::string& description);
158 void UpdateRegisteredApps(); 158 void UpdateRegisteredApps();
159 void NotifyLastOperationStatus(); 159 void NotifyLastOperationStatus();
160 160
161 scoped_ptr<drive::DriveServiceInterface> drive_service_; 161 scoped_ptr<drive::DriveServiceInterface> drive_service_;
162 scoped_ptr<drive::DriveUploaderInterface> drive_uploader_; 162 scoped_ptr<drive::DriveUploaderInterface> drive_uploader_;
163 163
164 // These external services are not owned by SyncEngine. 164 // These external services are not owned by SyncEngine.
165 // The owner of the SyncEngine is responsible for their lifetime. 165 // The owner of the SyncEngine is responsible for their lifetime.
166 // I.e. the owner should declare the dependency explicitly by calling 166 // I.e. the owner should declare the dependency explicitly by calling
167 // KeyedService::DependsOn(). 167 // KeyedService::DependsOn().
168 drive::DriveNotificationManager* notification_manager_; 168 drive::DriveNotificationManager* notification_manager_;
169 ExtensionServiceInterface* extension_service_; 169 ExtensionServiceInterface* extension_service_;
170 SigninManagerBase* signin_manager_; 170 SigninManagerBase* signin_manager_;
171 171
172 ObserverList<SyncServiceObserver> service_observers_; 172 ObserverList<SyncServiceObserver> service_observers_;
173 ObserverList<FileStatusObserver> file_status_observers_; 173 ObserverList<FileStatusObserver> file_status_observers_;
174 174
175 scoped_ptr<SyncWorker> sync_worker_; 175 scoped_ptr<SyncWorker> sync_worker_;
176 scoped_refptr<base::SequencedTaskRunner> worker_task_runner_;
177 176
178 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_; 177 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_;
179 DISALLOW_COPY_AND_ASSIGN(SyncEngine); 178 DISALLOW_COPY_AND_ASSIGN(SyncEngine);
180 }; 179 };
181 180
182 } // namespace drive_backend 181 } // namespace drive_backend
183 } // namespace sync_file_system 182 } // namespace sync_file_system
184 183
185 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ 184 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698