OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" | 10 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 DVLOG(3) << "NotifyTaskDone: " << "finished with status=" << status | 184 DVLOG(3) << "NotifyTaskDone: " << "finished with status=" << status |
185 << " (" << SyncStatusCodeToString(status) << ")" | 185 << " (" << SyncStatusCodeToString(status) << ")" |
186 << " " << token_->location().ToString(); | 186 << " " << token_->location().ToString(); |
187 | 187 |
188 if (token->blocking_factor()) { | 188 if (token->blocking_factor()) { |
189 dependency_manager_.Erase(token->blocking_factor()); | 189 dependency_manager_.Erase(token->blocking_factor()); |
190 token->clear_blocking_factor(); | 190 token->clear_blocking_factor(); |
191 } | 191 } |
192 | 192 |
| 193 // TODO(tzik): Record TaskLog to |client_| here. |
| 194 |
193 scoped_ptr<SyncTask> task; | 195 scoped_ptr<SyncTask> task; |
194 SyncStatusCallback callback = token->callback(); | 196 SyncStatusCallback callback = token->callback(); |
195 token->clear_callback(); | 197 token->clear_callback(); |
196 if (token->token_id() == SyncTaskToken::kForegroundTaskTokenID) { | 198 if (token->token_id() == SyncTaskToken::kForegroundTaskTokenID) { |
197 token_ = token.Pass(); | 199 token_ = token.Pass(); |
198 task = running_foreground_task_.Pass(); | 200 task = running_foreground_task_.Pass(); |
199 } else { | 201 } else { |
200 task = running_background_tasks_.take_and_erase(token->token_id()); | 202 task = running_background_tasks_.take_and_erase(token->token_id()); |
201 } | 203 } |
202 | 204 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 closure.Run(); | 334 closure.Run(); |
333 return; | 335 return; |
334 } | 336 } |
335 | 337 |
336 if (client_) | 338 if (client_) |
337 client_->MaybeScheduleNextTask(); | 339 client_->MaybeScheduleNextTask(); |
338 } | 340 } |
339 | 341 |
340 } // namespace drive_backend | 342 } // namespace drive_backend |
341 } // namespace sync_file_system | 343 } // namespace sync_file_system |
OLD | NEW |