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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_worker.h

Issue 318353002: [SyncFS] Create SyncWorkerInterface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync_file_system/drive_backend/sync_worker.h
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker.h b/chrome/browser/sync_file_system/drive_backend/sync_worker.h
index 8367bbb54bb37e83c7172278479b8611b3debacd..4fb91a58afdfb580eb20d228728cd9755a12cf77 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_worker.h
+++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.h
@@ -5,31 +5,30 @@
#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_H_
#define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_H_
-#include <set>
#include <string>
+#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
-#include "chrome/browser/drive/drive_notification_observer.h"
-#include "chrome/browser/drive/drive_service_interface.h"
+#include "base/values.h"
#include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h"
-#include "chrome/browser/sync_file_system/local_change_processor.h"
+#include "chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h"
+#include "chrome/browser/sync_file_system/file_change.h"
#include "chrome/browser/sync_file_system/remote_file_sync_service.h"
#include "chrome/browser/sync_file_system/sync_action.h"
+#include "chrome/browser/sync_file_system/sync_callbacks.h"
#include "chrome/browser/sync_file_system/sync_direction.h"
+#include "chrome/browser/sync_file_system/sync_file_metadata.h"
#include "chrome/browser/sync_file_system/task_logger.h"
#include "net/base/network_change_notifier.h"
+#include "url/gurl.h"
+#include "webkit/browser/fileapi/file_system_url.h"
tzik 2014/06/09 08:04:23 I think file_path, gurl and file_system_url can be
peria 2014/06/10 04:31:07 Done.
class ExtensionServiceInterface;
-namespace base {
-class SequencedTaskRunner;
-}
-
namespace drive {
class DriveServiceInterface;
-class DriveNotificationManager;
class DriveUploaderInterface;
}
@@ -38,9 +37,6 @@ class Env;
}
namespace sync_file_system {
-
-class RemoteChangeProcessor;
-
namespace drive_backend {
class LocalToRemoteSyncer;
@@ -50,7 +46,8 @@ class RemoteToLocalSyncer;
class SyncEngineContext;
class SyncEngineInitializer;
-class SyncWorker : public SyncTaskManager::Client {
+class SyncWorker : public SyncWorkerInterface,
+ public SyncTaskManager::Client {
public:
enum AppStatus {
APP_STATUS_ENABLED,
@@ -81,7 +78,7 @@ class SyncWorker : public SyncTaskManager::Client {
virtual ~SyncWorker();
- void Initialize();
+ virtual void Initialize() OVERRIDE;
// SyncTaskManager::Client overrides
virtual void MaybeScheduleNextTask() OVERRIDE;
@@ -89,59 +86,60 @@ class SyncWorker : public SyncTaskManager::Client {
SyncStatusCode sync_status, bool used_network) OVERRIDE;
virtual void RecordTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log) OVERRIDE;
- void RegisterOrigin(const GURL& origin, const SyncStatusCallback& callback);
- void EnableOrigin(const GURL& origin, const SyncStatusCallback& callback);
- void DisableOrigin(const GURL& origin, const SyncStatusCallback& callback);
- void UninstallOrigin(
+ // SyncWorkerInterface overrides
+ virtual void RegisterOrigin(const GURL& origin,
+ const SyncStatusCallback& callback) OVERRIDE;
+ virtual void EnableOrigin(const GURL& origin,
+ const SyncStatusCallback& callback) OVERRIDE;
+ virtual void DisableOrigin(const GURL& origin,
+ const SyncStatusCallback& callback) OVERRIDE;
nhiroki 2014/06/10 04:00:48 nit: Can you make arguments of these functions ali
peria 2014/06/10 04:31:07 Done.
+ virtual void UninstallOrigin(
const GURL& origin,
RemoteFileSyncService::UninstallFlag flag,
- const SyncStatusCallback& callback);
- void ProcessRemoteChange(const SyncFileCallback& callback);
- void SetRemoteChangeProcessor(
- RemoteChangeProcessorOnWorker* remote_change_processor_on_worker);
- RemoteServiceState GetCurrentState() const;
- void GetOriginStatusMap(
- const RemoteFileSyncService::StatusMapCallback& callback);
- scoped_ptr<base::ListValue> DumpFiles(const GURL& origin);
- scoped_ptr<base::ListValue> DumpDatabase();
- void SetSyncEnabled(bool enabled);
- void PromoteDemotedChanges();
- SyncStatusCode SetDefaultConflictResolutionPolicy(
- ConflictResolutionPolicy policy);
- SyncStatusCode SetConflictResolutionPolicy(
- const GURL& origin,
- ConflictResolutionPolicy policy);
- ConflictResolutionPolicy GetDefaultConflictResolutionPolicy()
- const;
- ConflictResolutionPolicy GetConflictResolutionPolicy(
- const GURL& origin) const;
-
- void ApplyLocalChange(
+ const SyncStatusCallback& callback) OVERRIDE;
+ virtual void ProcessRemoteChange(const SyncFileCallback& callback) OVERRIDE;
+ virtual void SetRemoteChangeProcessor(
+ RemoteChangeProcessorOnWorker* remote_change_processor_on_worker)
+ OVERRIDE;
+ virtual RemoteServiceState GetCurrentState() const OVERRIDE;
+ virtual void GetOriginStatusMap(
+ const RemoteFileSyncService::StatusMapCallback& callback) OVERRIDE;
+ virtual scoped_ptr<base::ListValue> DumpFiles(const GURL& origin) OVERRIDE;
+ virtual scoped_ptr<base::ListValue> DumpDatabase() OVERRIDE;
+ virtual void SetSyncEnabled(bool enabled) OVERRIDE;
+ virtual void PromoteDemotedChanges() OVERRIDE;
+
+ virtual void ApplyLocalChange(
const FileChange& local_change,
const base::FilePath& local_path,
const SyncFileMetadata& local_metadata,
const fileapi::FileSystemURL& url,
- const SyncStatusCallback& callback);
+ const SyncStatusCallback& callback) OVERRIDE;
- void OnNotificationReceived();
+ virtual void OnNotificationReceived() OVERRIDE;
- void OnReadyToSendRequests(const std::string& account_id);
- void OnRefreshTokenInvalid();
+ virtual void OnReadyToSendRequests(const std::string& account_id) OVERRIDE;
+ virtual void OnRefreshTokenInvalid() OVERRIDE;
- void OnNetworkChanged(net::NetworkChangeNotifier::ConnectionType type);
+ virtual void OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
- drive::DriveServiceInterface* GetDriveService();
- drive::DriveUploaderInterface* GetDriveUploader();
- MetadataDatabase* GetMetadataDatabase();
- SyncTaskManager* GetSyncTaskManager();
+ virtual drive::DriveServiceInterface* GetDriveService() OVERRIDE;
+ virtual drive::DriveUploaderInterface* GetDriveUploader() OVERRIDE;
+ virtual MetadataDatabase* GetMetadataDatabase() OVERRIDE;
+ virtual SyncTaskManager* GetSyncTaskManager() OVERRIDE;
- void AddObserver(Observer* observer);
+ virtual void DetachFromSequence() OVERRIDE;
- void DetachFromSequence();
+ void AddObserver(Observer* observer);
private:
friend class SyncEngineTest;
+ // SyncWorkerInterface overrides.
+ // TODO(peria): Remove this interface after making FakeSyncWorker class.
+ virtual void SetHasRefreshToken(bool has_refresh_token) OVERRIDE;
+
void DoDisableApp(const std::string& app_id,
const SyncStatusCallback& callback);
void DoEnableApp(const std::string& app_id,

Powered by Google App Engine
This is Rietveld 408576698