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

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

Issue 11238054: Add OnSyncEnabled/OnWriteEnabled notification handling to operation runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added export 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
« no previous file with comments | « webkit/fileapi/syncable/local_file_sync_context.h ('k') | webkit/fileapi/syncable/local_file_sync_status.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 a3258295124644efbe4fd4da89c5807b5f0a148d..531e67fdaefa89b665d532416539737a7953ac9d 100644
--- a/webkit/fileapi/syncable/local_file_sync_context.cc
+++ b/webkit/fileapi/syncable/local_file_sync_context.cc
@@ -17,6 +17,10 @@
namespace fileapi {
+namespace {
+const int kMaxConcurrentSyncableOperation = 3;
+} // namespace
+
LocalFileSyncContext::LocalFileSyncContext(
base::SingleThreadTaskRunner* ui_task_runner,
base::SingleThreadTaskRunner* io_task_runner)
@@ -68,12 +72,18 @@ LocalFileSyncContext::operation_runner() const {
return base::WeakPtr<SyncableFileOperationRunner>();
}
+LocalFileSyncStatus* LocalFileSyncContext::sync_status() const {
+ DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
+ return sync_status_.get();
+}
+
LocalFileSyncContext::~LocalFileSyncContext() {
}
void LocalFileSyncContext::ShutdownOnIOThread() {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
operation_runner_.reset();
+ sync_status_.reset();
}
void LocalFileSyncContext::InitializeFileSystemContextOnIOThread(
@@ -98,8 +108,13 @@ void LocalFileSyncContext::InitializeFileSystemContextOnIOThread(
make_scoped_refptr(file_system_context)));
return;
}
- if (!operation_runner_.get())
- operation_runner_.reset(new SyncableFileOperationRunner);
+ if (!operation_runner_.get()) {
+ DCHECK(!sync_status_.get());
+ sync_status_.reset(new LocalFileSyncStatus);
+ operation_runner_.reset(new SyncableFileOperationRunner(
+ kMaxConcurrentSyncableOperation,
+ sync_status_.get()));
+ }
file_system_context->set_sync_context(this);
DidInitialize(source_url, file_system_context, SYNC_STATUS_OK);
}
« no previous file with comments | « webkit/fileapi/syncable/local_file_sync_context.h ('k') | webkit/fileapi/syncable/local_file_sync_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698