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

Unified Diff: chrome/browser/sync_file_system/sync_file_system_service.h

Issue 11187021: Add RemoteFileSyncService interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +DCHECK Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync_file_system/sync_file_system_service.h
diff --git a/chrome/browser/sync_file_system/sync_file_system_service.h b/chrome/browser/sync_file_system/sync_file_system_service.h
index 61918cf631b7c710c4183b925e8cca2139b8584b..15cbdcf5f6e9ba2985bd674c120a7b35af5630d0 100644
--- a/chrome/browser/sync_file_system/sync_file_system_service.h
+++ b/chrome/browser/sync_file_system/sync_file_system_service.h
@@ -11,27 +11,41 @@
#include "base/callback_forward.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+#include "chrome/browser/sync_file_system/remote_file_provider.h"
#include "webkit/fileapi/syncable/sync_status_code.h"
class GURL;
namespace fileapi {
class FileSystemContext;
+class FileSystemURL;
}
namespace sync_file_system {
class LocalFileSyncService;
-class SyncFileSystemService : public ProfileKeyedService {
+class SyncFileSystemService
+ : public ProfileKeyedService,
+ public RemoteFileObserver,
+ public base::SupportsWeakPtr<SyncFileSystemService> {
public:
typedef base::Callback<void(fileapi::SyncStatusCode status)> StatusCallback;
// ProfileKeyedService overrides.
virtual void Shutdown() OVERRIDE;
+ // RemoteFileObserver override.
+ virtual void OnRemoteChangeAvailable(RemoteFileProvider* remote_file_provider)
+ OVERRIDE;
+
+ void RegisterRemoteFileProvider(
+ const std::string& service_name,
+ scoped_ptr<RemoteFileProvider> remote_file_provider);
+
void InitializeForApp(
fileapi::FileSystemContext* file_system_context,
const std::string& service_name,
@@ -40,15 +54,26 @@ class SyncFileSystemService : public ProfileKeyedService {
private:
friend class SyncFileSystemServiceFactory;
+ typedef std::map<std::string, RemoteFileProvider*> RemoteFileProviderMap;
explicit SyncFileSystemService(Profile* profile);
virtual ~SyncFileSystemService();
void Initialize(scoped_ptr<LocalFileSyncService> local_file_service);
+ void MayStartRemoteSync();
+ void DidDownloadFile(scoped_ptr<RemoteChange> change,
+ fileapi::SyncStatusCode status,
+ const FilePath& file_path);
+ void DidDeleteFile(const fileapi::FileSystemURL& url,
+ fileapi::SyncStatusCode status);
+
Profile* profile_;
scoped_ptr<LocalFileSyncService> local_file_service_;
+ RemoteFileProviderMap remote_file_providers_;
+ std::set<RemoteFileProvider*> pending_providers_;
kinuko 2012/10/17 09:22:57 I haven't looked closely at the .cc file but what
tzik 2012/10/18 07:18:08 Removed. In this version of patchset, I considere
+ bool sync_is_running_;
DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService);
};

Powered by Google App Engine
This is Rietveld 408576698