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

Side by Side Diff: chrome/browser/sync_file_system/remote_file_sync_service.h

Issue 294893005: [SyncFS] Make GetOriginStatusMap asynchronous (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactoring Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_REMOTE_FILE_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 SyncFileMetadata metadata; 104 SyncFileMetadata metadata;
105 }; 105 };
106 106
107 enum UninstallFlag { 107 enum UninstallFlag {
108 UNINSTALL_AND_PURGE_REMOTE, 108 UNINSTALL_AND_PURGE_REMOTE,
109 UNINSTALL_AND_KEEP_REMOTE, 109 UNINSTALL_AND_KEEP_REMOTE,
110 }; 110 };
111 111
112 // For GetOriginStatusMap. 112 // For GetOriginStatusMap.
113 typedef std::map<GURL, std::string> OriginStatusMap; 113 typedef std::map<GURL, std::string> OriginStatusMap;
114 typedef base::Callback<void(const OriginStatusMap&)> StatusMapCallback;
114 115
115 // For GetRemoteVersions. 116 // For GetRemoteVersions.
116 typedef base::Callback<void(SyncStatusCode status, 117 typedef base::Callback<void(SyncStatusCode, const std::vector<Version>&)>
117 const std::vector<Version>& versions)>
118 RemoteVersionsCallback; 118 RemoteVersionsCallback;
119 typedef base::Callback<void(SyncStatusCode status, 119 typedef base::Callback<void(SyncStatusCode, webkit_blob::ScopedFile)>
tzik 2014/05/21 10:52:33 please keep these parameter names
120 webkit_blob::ScopedFile downloaded)>
121 DownloadVersionCallback; 120 DownloadVersionCallback;
122 121
123 // For DumpFile. 122 // For DumpFile.
124 typedef base::Callback<void(scoped_ptr<base::ListValue> list)> ListCallback; 123 typedef base::Callback<void(scoped_ptr<base::ListValue>)> ListCallback;
125 124
126 // Creates an initialized RemoteFileSyncService for backend |version| 125 // Creates an initialized RemoteFileSyncService for backend |version|
127 // for |context|. 126 // for |context|.
128 static scoped_ptr<RemoteFileSyncService> CreateForBrowserContext( 127 static scoped_ptr<RemoteFileSyncService> CreateForBrowserContext(
129 BackendVersion version, 128 BackendVersion version,
130 content::BrowserContext* context); 129 content::BrowserContext* context);
131 130
132 // Returns BrowserContextKeyedServiceFactory's an instance of 131 // Returns BrowserContextKeyedServiceFactory's an instance of
133 // RemoteFileSyncService for backend |version| depends on. 132 // RemoteFileSyncService for backend |version| depends on.
134 static void AppendDependsOnFactories( 133 static void AppendDependsOnFactories(
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 184
186 // Returns true if the file |url| is marked conflicted in the remote service. 185 // Returns true if the file |url| is marked conflicted in the remote service.
187 virtual bool IsConflicting(const fileapi::FileSystemURL& url) = 0; 186 virtual bool IsConflicting(const fileapi::FileSystemURL& url) = 0;
188 187
189 // Returns the current remote service state (should equal to the value 188 // Returns the current remote service state (should equal to the value
190 // returned by the last OnRemoteServiceStateUpdated notification. 189 // returned by the last OnRemoteServiceStateUpdated notification.
191 virtual RemoteServiceState GetCurrentState() const = 0; 190 virtual RemoteServiceState GetCurrentState() const = 0;
192 191
193 // Returns all origins along with an arbitrary string description of their 192 // Returns all origins along with an arbitrary string description of their
194 // corresponding sync statuses. 193 // corresponding sync statuses.
195 virtual void GetOriginStatusMap(OriginStatusMap* status_map) = 0; 194 virtual void GetOriginStatusMap(const StatusMapCallback& callback) = 0;
196 195
197 // Returns file metadata for |origin| to call |callback|. 196 // Returns file metadata for |origin| to call |callback|.
198 virtual void DumpFiles(const GURL& origin, 197 virtual void DumpFiles(const GURL& origin,
199 const ListCallback& callback) = 0; 198 const ListCallback& callback) = 0;
200 199
201 // Returns the dump of internal database. 200 // Returns the dump of internal database.
202 virtual void DumpDatabase(const ListCallback& callback) = 0; 201 virtual void DumpDatabase(const ListCallback& callback) = 0;
203 202
204 // Enables or disables the background sync. 203 // Enables or disables the background sync.
205 // Setting this to false should disable the synchronization (and make 204 // Setting this to false should disable the synchronization (and make
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 238
240 virtual void PromoteDemotedChanges() = 0; 239 virtual void PromoteDemotedChanges() = 0;
241 240
242 private: 241 private:
243 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService); 242 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService);
244 }; 243 };
245 244
246 } // namespace sync_file_system 245 } // namespace sync_file_system
247 246
248 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ 247 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698