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

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

Issue 268413002: [SyncFS] Make DumpFiles async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: work for a nit 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
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 typedef std::map<GURL, std::string> OriginStatusMap; 113 typedef std::map<GURL, std::string> OriginStatusMap;
114 114
115 // For GetRemoteVersions. 115 // For GetRemoteVersions.
116 typedef base::Callback<void(SyncStatusCode status, 116 typedef base::Callback<void(SyncStatusCode status,
117 const std::vector<Version>& versions)> 117 const std::vector<Version>& versions)>
118 RemoteVersionsCallback; 118 RemoteVersionsCallback;
119 typedef base::Callback<void(SyncStatusCode status, 119 typedef base::Callback<void(SyncStatusCode status,
120 webkit_blob::ScopedFile downloaded)> 120 webkit_blob::ScopedFile downloaded)>
121 DownloadVersionCallback; 121 DownloadVersionCallback;
122 122
123 // For DumpFile.
124 typedef base::Callback<void(scoped_ptr<base::ListValue> list)> ListCallback;
125
123 // Creates an initialized RemoteFileSyncService for backend |version| 126 // Creates an initialized RemoteFileSyncService for backend |version|
124 // for |context|. 127 // for |context|.
125 static scoped_ptr<RemoteFileSyncService> CreateForBrowserContext( 128 static scoped_ptr<RemoteFileSyncService> CreateForBrowserContext(
126 BackendVersion version, 129 BackendVersion version,
127 content::BrowserContext* context); 130 content::BrowserContext* context);
128 131
129 // Returns BrowserContextKeyedServiceFactory's an instance of 132 // Returns BrowserContextKeyedServiceFactory's an instance of
130 // RemoteFileSyncService for backend |version| depends on. 133 // RemoteFileSyncService for backend |version| depends on.
131 static void AppendDependsOnFactories( 134 static void AppendDependsOnFactories(
132 BackendVersion version, 135 BackendVersion version,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 virtual bool IsConflicting(const fileapi::FileSystemURL& url) = 0; 187 virtual bool IsConflicting(const fileapi::FileSystemURL& url) = 0;
185 188
186 // Returns the current remote service state (should equal to the value 189 // Returns the current remote service state (should equal to the value
187 // returned by the last OnRemoteServiceStateUpdated notification. 190 // returned by the last OnRemoteServiceStateUpdated notification.
188 virtual RemoteServiceState GetCurrentState() const = 0; 191 virtual RemoteServiceState GetCurrentState() const = 0;
189 192
190 // Returns all origins along with an arbitrary string description of their 193 // Returns all origins along with an arbitrary string description of their
191 // corresponding sync statuses. 194 // corresponding sync statuses.
192 virtual void GetOriginStatusMap(OriginStatusMap* status_map) = 0; 195 virtual void GetOriginStatusMap(OriginStatusMap* status_map) = 0;
193 196
194 // Returns file metadata for |origin|. 197 // Returns file metadata for |origin| to call |callback|.
195 virtual scoped_ptr<base::ListValue> DumpFiles(const GURL& origin) = 0; 198 virtual void DumpFiles(const GURL& origin,
199 const ListCallback& callback) = 0;
196 200
197 // Returns the dump of internal database. 201 // Returns the dump of internal database.
198 virtual scoped_ptr<base::ListValue> DumpDatabase() = 0; 202 virtual scoped_ptr<base::ListValue> DumpDatabase() = 0;
199 203
200 // Enables or disables the background sync. 204 // Enables or disables the background sync.
201 // Setting this to false should disable the synchronization (and make 205 // Setting this to false should disable the synchronization (and make
202 // the service state to REMOTE_SERVICE_DISABLED), while setting this to 206 // the service state to REMOTE_SERVICE_DISABLED), while setting this to
203 // true does not necessarily mean the service is actually turned on 207 // true does not necessarily mean the service is actually turned on
204 // (for example if Chrome is offline the service state will become 208 // (for example if Chrome is offline the service state will become
205 // REMOTE_SERVICE_TEMPORARY_UNAVAILABLE). 209 // REMOTE_SERVICE_TEMPORARY_UNAVAILABLE).
(...skipping 29 matching lines...) Expand all
235 239
236 virtual void PromoteDemotedChanges() = 0; 240 virtual void PromoteDemotedChanges() = 0;
237 241
238 private: 242 private:
239 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService); 243 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService);
240 }; 244 };
241 245
242 } // namespace sync_file_system 246 } // namespace sync_file_system
243 247
244 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ 248 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698