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

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

Issue 11234025: Add skeleton code to wire Local- and Remote- file sync services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix 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/local_file_sync_service.h
diff --git a/chrome/browser/sync_file_system/local_file_sync_service.h b/chrome/browser/sync_file_system/local_file_sync_service.h
index 7a559587ff250a6ee284157e38a8957a967d5c35..044a0048701844ebf10680a2d4d513eb793fe6d3 100644
--- a/chrome/browser/sync_file_system/local_file_sync_service.h
+++ b/chrome/browser/sync_file_system/local_file_sync_service.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
+#include "chrome/browser/sync_file_system/remote_change_processor.h"
#include "webkit/fileapi/syncable/sync_status_code.h"
class GURL;
@@ -19,14 +20,20 @@ class LocalFileSyncContext;
namespace sync_file_system {
+class LocalChangeProcessor;
+
// Maintains local file change tracker and sync status.
// Owned by SyncFileSystemService (which is a per-profile object).
-class LocalFileSyncService {
+class LocalFileSyncService : public RemoteChangeProcessor {
public:
typedef base::Callback<void(fileapi::SyncStatusCode)> StatusCallback;
+ typedef base::Callback<
+ void(fileapi::SyncStatusCode status, fileapi::FileSystemURL& url)>
+ SyncCompletionCallback;
+
LocalFileSyncService();
- ~LocalFileSyncService();
+ virtual ~LocalFileSyncService();
void Shutdown();
@@ -35,6 +42,21 @@ class LocalFileSyncService {
fileapi::FileSystemContext* file_system_context,
const StatusCallback& callback);
+ // Synchronize one local change (to the remote server) using |processor|.
+ // |processor| must have same or longer lifetime than this service.
+ void ProcessChange(LocalChangeProcessor* processor,
+ const SyncCompletionCallback& callback);
+
+ // RemoteChangeProcessor overrides.
+ virtual void PrepareForProcessRemoteChange(
+ const fileapi::FileSystemURL& url,
+ const PrepareChangeCallback& callback) OVERRIDE;
+ virtual void ApplyRemoteChange(
+ const fileapi::FileChange& change,
+ const FilePath& local_path,
+ const fileapi::FileSystemURL& url,
+ const StatusCallback& callback) OVERRIDE;
+
private:
scoped_refptr<fileapi::LocalFileSyncContext> sync_context_;

Powered by Google App Engine
This is Rietveld 408576698