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/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "base/sequenced_task_runner.h" | 11 #include "base/sequenced_task_runner.h" |
11 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" | 12 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" |
12 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" | 13 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" |
13 #include "chrome/browser/sync_file_system/sync_file_metadata.h" | 14 #include "chrome/browser/sync_file_system/sync_file_metadata.h" |
14 | 15 |
15 using storage::FileSystemURL; | 16 using storage::FileSystemURL; |
16 | 17 |
17 namespace sync_file_system { | 18 namespace sync_file_system { |
18 namespace drive_backend { | 19 namespace drive_backend { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 else | 183 else |
183 background_task_token = current_task_token.Pass(); | 184 background_task_token = current_task_token.Pass(); |
184 | 185 |
185 manager->UpdateTaskBlockerBody(foreground_task_token.Pass(), | 186 manager->UpdateTaskBlockerBody(foreground_task_token.Pass(), |
186 background_task_token.Pass(), | 187 background_task_token.Pass(), |
187 task_log.Pass(), | 188 task_log.Pass(), |
188 task_blocker.Pass(), | 189 task_blocker.Pass(), |
189 continuation); | 190 continuation); |
190 } | 191 } |
191 | 192 |
192 bool SyncTaskManager::IsRunningTask(int64 token_id) const { | 193 bool SyncTaskManager::IsRunningTask(int64_t token_id) const { |
193 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 194 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
194 | 195 |
195 // If the client is gone, all task should be aborted. | 196 // If the client is gone, all task should be aborted. |
196 if (!client_) | 197 if (!client_) |
197 return false; | 198 return false; |
198 | 199 |
199 if (token_id == SyncTaskToken::kForegroundTaskTokenID) | 200 if (token_id == SyncTaskToken::kForegroundTaskTokenID) |
200 return true; | 201 return true; |
201 | 202 |
202 return ContainsKey(running_background_tasks_, token_id); | 203 return ContainsKey(running_background_tasks_, token_id); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 closure.Run(); | 406 closure.Run(); |
406 return; | 407 return; |
407 } | 408 } |
408 | 409 |
409 if (client_) | 410 if (client_) |
410 client_->MaybeScheduleNextTask(); | 411 client_->MaybeScheduleNextTask(); |
411 } | 412 } |
412 | 413 |
413 } // namespace drive_backend | 414 } // namespace drive_backend |
414 } // namespace sync_file_system | 415 } // namespace sync_file_system |
OLD | NEW |