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

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

Issue 11187021: Add RemoteFileSyncService interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' 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/remote_file_sync_service.h
diff --git a/chrome/browser/sync_file_system/remote_file_sync_service.h b/chrome/browser/sync_file_system/remote_file_sync_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..80c203c033a8ab477b84f140829b4eb5880a31d8
--- /dev/null
+++ b/chrome/browser/sync_file_system/remote_file_sync_service.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_
+#define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_
+
+#include "base/basictypes.h"
+#include "base/observer_list.h"
+#include "chrome/browser/sync_file_system/sync_file_system_callbacks.h"
+
+class GURL;
+
+namespace sync_file_system {
+
+class RemoteChangeObserver;
+class RemoteChangeProcessor;
+
+// This class represents a backing service of the sync filesystem.
+// Owned by SyncFileSystemService.
+class RemoteFileSyncService {
+ public:
+ RemoteFileSyncService();
+ virtual ~RemoteFileSyncService();
+
+ void AddObserver(RemoteChangeObserver* observer);
+ void RemoveObserver(RemoteChangeObserver* observer);
kinuko 2012/10/23 08:12:14 It might be ok to leave them pure virtual too.. th
tzik 2012/10/24 03:32:33 Done.
+
+ // Registers |origin| to track remote side changes for the |origin|.
+ virtual void RegisterOriginForTrackingChanges(const GURL& origin) = 0;
+
+ // Unregisters |origin| to track remote side changes for the |origin|.
+ virtual void UnregisterOriginForTrackingChanges(const GURL& origin) = 0;
+
+ // Called by the sync engine to process one remote change.
+ // After a change is processed |callback| will be called (to return
+ // the control to the sync engine).
+ virtual void ProcessChange(RemoteChangeProcessor* processor,
+ StatusCallback& callback) = 0;
kinuko 2012/10/23 08:12:14 I think this should also let the caller know what
tzik 2012/10/24 03:32:33 Done.
+
+ protected:
+ void NotifyRemoteChangeAvailable(int64 pending_changes);
+
+ private:
+ ObserverList<RemoteChangeObserver> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService);
+};
+
+} // namespace sync_file_system
+
+#endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698