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

Unified Diff: chrome/browser/sync_file_system/drive_backend/sync_task_token.cc

Issue 297803011: [SyncFS] Run LocalToRemoteSyncer as SyncTask (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/sync_task_token.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/sync_task_token.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc
index ed95abdbdda0f36ee3a072af014228237b677f30..458b9cd436301a2088e6768870d0640932395e05 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc
@@ -11,16 +11,28 @@
namespace sync_file_system {
namespace drive_backend {
+const int64 SyncTaskToken::kTestingTaskTokenID = -1;
const int64 SyncTaskToken::kForegroundTaskTokenID = 0;
const int64 SyncTaskToken::kMinimumBackgroundTaskTokenID = 1;
// static
+scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForTesting(
+ const SyncStatusCallback& callback) {
+ return make_scoped_ptr(new SyncTaskToken(
+ base::WeakPtr<SyncTaskManager>(),
+ kTestingTaskTokenID,
+ scoped_ptr<BlockingFactor>(),
+ callback));
+}
+
+// static
scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForForegroundTask(
const base::WeakPtr<SyncTaskManager>& manager) {
return make_scoped_ptr(new SyncTaskToken(
manager,
kForegroundTaskTokenID,
- scoped_ptr<BlockingFactor>()));
+ scoped_ptr<BlockingFactor>(),
+ SyncStatusCallback()));
}
// static
@@ -31,7 +43,8 @@ scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForBackgroundTask(
return make_scoped_ptr(new SyncTaskToken(
manager,
token_id,
- blocking_factor.Pass()));
+ blocking_factor.Pass(),
+ SyncStatusCallback()));
}
void SyncTaskToken::UpdateTask(const tracked_objects::Location& location,
@@ -55,7 +68,8 @@ SyncTaskToken::~SyncTaskToken() {
// Reinitializes the token.
SyncTaskManager::NotifyTaskDone(
make_scoped_ptr(new SyncTaskToken(
- manager_, token_id_, blocking_factor_.Pass())),
+ manager_, token_id_, blocking_factor_.Pass(),
+ SyncStatusCallback())),
SYNC_STATUS_OK);
}
}
@@ -81,9 +95,11 @@ void SyncTaskToken::clear_blocking_factor() {
SyncTaskToken::SyncTaskToken(const base::WeakPtr<SyncTaskManager>& manager,
int64 token_id,
- scoped_ptr<BlockingFactor> blocking_factor)
+ scoped_ptr<BlockingFactor> blocking_factor,
+ const SyncStatusCallback& callback)
: manager_(manager),
token_id_(token_id),
+ callback_(callback),
blocking_factor_(blocking_factor.Pass()) {
}
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/sync_task_token.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698