Index: chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc |
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc |
index 1a330b80cb72a88a5eebdec2624a38da433d0d8b..94132d2d55425e9359c2662203653d8f8eb90cab 100644 |
--- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc |
+++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc |
@@ -155,6 +155,7 @@ void SyncTaskManager::UpdateBlockingFactor( |
scoped_ptr<SyncTaskToken> foreground_task_token; |
scoped_ptr<SyncTaskToken> background_task_token; |
+ scoped_ptr<TaskLogger::TaskLog> task_log = current_task_token->PassTaskLog(); |
if (current_task_token->token_id() == SyncTaskToken::kForegroundTaskTokenID) |
foreground_task_token = current_task_token.Pass(); |
else |
@@ -162,6 +163,7 @@ void SyncTaskManager::UpdateBlockingFactor( |
manager->UpdateBlockingFactorBody(foreground_task_token.Pass(), |
background_task_token.Pass(), |
+ task_log.Pass(), |
blocking_factor.Pass(), |
continuation); |
} |
@@ -190,7 +192,8 @@ void SyncTaskManager::NotifyTaskDoneBody(scoped_ptr<SyncTaskToken> token, |
token->clear_blocking_factor(); |
} |
- // TODO(tzik): Record TaskLog to |client_| here. |
+ if (client_) |
+ client_->RecordTaskLog(token->PassTaskLog()); |
scoped_ptr<SyncTask> task; |
SyncStatusCallback callback = token->callback(); |
@@ -218,6 +221,7 @@ void SyncTaskManager::NotifyTaskDoneBody(scoped_ptr<SyncTaskToken> token, |
void SyncTaskManager::UpdateBlockingFactorBody( |
scoped_ptr<SyncTaskToken> foreground_task_token, |
scoped_ptr<SyncTaskToken> background_task_token, |
+ scoped_ptr<TaskLogger::TaskLog> task_log, |
scoped_ptr<BlockingFactor> blocking_factor, |
const Continuation& continuation) { |
// Run the task directly if the parallelization is disabled. |
@@ -247,6 +251,7 @@ void SyncTaskManager::UpdateBlockingFactorBody( |
AsWeakPtr(), |
base::Passed(&foreground_task_token), |
base::Passed(&background_task_token), |
+ base::Passed(&task_log), |
base::Passed(&blocking_factor), |
continuation), |
PRIORITY_HIGH); |
@@ -272,6 +277,7 @@ void SyncTaskManager::UpdateBlockingFactorBody( |
AsWeakPtr(), |
base::Passed(&foreground_task_token), |
base::Passed(&background_task_token), |
+ base::Passed(&task_log), |
base::Passed(&blocking_factor), |
continuation); |
return; |
@@ -296,6 +302,7 @@ void SyncTaskManager::UpdateBlockingFactorBody( |
token_ = foreground_task_token.Pass(); |
StartNextTask(); |
+ background_task_token->SetTaskLog(task_log.Pass()); |
continuation.Run(background_task_token.Pass()); |
} |
@@ -316,6 +323,9 @@ void SyncTaskManager::PushPendingTask( |
void SyncTaskManager::RunTask(scoped_ptr<SyncTaskToken> token, |
scoped_ptr<SyncTask> task) { |
DCHECK(!running_foreground_task_); |
+ |
+ token->SetTaskLog(make_scoped_ptr(new TaskLogger::TaskLog)); |
+ |
running_foreground_task_ = task.Pass(); |
running_foreground_task_->RunPreflight(token.Pass()); |
} |