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

Unified Diff: webkit/fileapi/syncable/local_file_sync_context.cc

Issue 11421197: Implement SyncFileSystemService::GetFileSyncStatus method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: indent fix Created 8 years 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
« no previous file with comments | « webkit/fileapi/syncable/local_file_sync_context.h ('k') | webkit/fileapi/syncable/sync_callbacks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/syncable/local_file_sync_context.cc
diff --git a/webkit/fileapi/syncable/local_file_sync_context.cc b/webkit/fileapi/syncable/local_file_sync_context.cc
index 889078f4c0861a5b2f34536b8bf3218f179901cd..ec8f0e53cd7e2b8048726dd0dd430e88ba4a2dc0 100644
--- a/webkit/fileapi/syncable/local_file_sync_context.cc
+++ b/webkit/fileapi/syncable/local_file_sync_context.cc
@@ -232,6 +232,31 @@ void LocalFileSyncContext::GetFileMetadata(
this, callback));
}
+void LocalFileSyncContext::HasPendingLocalChanges(
+ FileSystemContext* file_system_context,
+ const FileSystemURL& url,
+ const HasPendingLocalChangeCallback& callback) {
+ // This gets called on UI thread and relays the task on FILE thread.
+ DCHECK(file_system_context);
+ if (!file_system_context->task_runners()->file_task_runner()->
+ RunsTasksOnCurrentThread()) {
+ DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ file_system_context->task_runners()->file_task_runner()->PostTask(
+ FROM_HERE,
+ base::Bind(&LocalFileSyncContext::HasPendingLocalChanges,
+ this, make_scoped_refptr(file_system_context),
+ url, callback));
+ return;
+ }
+
+ DCHECK(file_system_context->change_tracker());
+ FileChangeList changes;
+ file_system_context->change_tracker()->GetChangesForURL(url, &changes);
+
+ // Fire the callback on UI thread.
+ ui_task_runner_->PostTask(FROM_HERE, base::Bind(callback, !changes.empty()));
+}
+
void LocalFileSyncContext::AddOriginChangeObserver(
LocalOriginChangeObserver* observer) {
origin_change_observers_.AddObserver(observer);
« no previous file with comments | « webkit/fileapi/syncable/local_file_sync_context.h ('k') | webkit/fileapi/syncable/sync_callbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698