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

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

Issue 11411352: Clear syncing flag after a remote or local sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: also check REMOTE_SERVICE_DISABLED state 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') | no next file » | 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 ec8f0e53cd7e2b8048726dd0dd430e88ba4a2dc0..16d95a13cdba8475568f32fddca981257428fac9 100644
--- a/webkit/fileapi/syncable/local_file_sync_context.cc
+++ b/webkit/fileapi/syncable/local_file_sync_context.cc
@@ -92,9 +92,10 @@ void LocalFileSyncContext::GetFileForLocalSync(
base::Owned(urls), callback));
}
-void LocalFileSyncContext::FinalizeSyncForURL(
+void LocalFileSyncContext::ClearChangesForURL(
FileSystemContext* file_system_context,
- const FileSystemURL& url) {
+ const FileSystemURL& url,
+ const base::Closure& done_callback) {
// This is initially called on UI thread and to be relayed to FILE thread.
DCHECK(file_system_context);
if (!file_system_context->task_runners()->file_task_runner()->
@@ -102,14 +103,20 @@ void LocalFileSyncContext::FinalizeSyncForURL(
DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
file_system_context->task_runners()->file_task_runner()->PostTask(
FROM_HERE,
- base::Bind(&LocalFileSyncContext::FinalizeSyncForURL,
- this, make_scoped_refptr(file_system_context), url));
+ base::Bind(&LocalFileSyncContext::ClearChangesForURL,
+ this, make_scoped_refptr(file_system_context),
+ url, done_callback));
return;
}
DCHECK(file_system_context->change_tracker());
file_system_context->change_tracker()->ClearChangesForURL(url);
- // Call out to the IO thread to re-enable writing.
+ // Call the completion callback on UI thread.
+ ui_task_runner_->PostTask(FROM_HERE, done_callback);
+}
+
+void LocalFileSyncContext::ClearSyncFlagForURL(const FileSystemURL& url) {
+ // This is initially called on UI thread and to be relayed to IO thread.
io_task_runner_->PostTask(
FROM_HERE,
base::Bind(&LocalFileSyncContext::EnableWritingOnIOThread,
« no previous file with comments | « webkit/fileapi/syncable/local_file_sync_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698