| 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_token.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/thread_task_runner_handle.h" |
| 9 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" | 10 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" |
| 10 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager.
h" | 11 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager.
h" |
| 11 | 12 |
| 12 namespace sync_file_system { | 13 namespace sync_file_system { |
| 13 namespace drive_backend { | 14 namespace drive_backend { |
| 14 | 15 |
| 15 const int64 SyncTaskToken::kTestingTaskTokenID = -1; | 16 const int64 SyncTaskToken::kTestingTaskTokenID = -1; |
| 16 const int64 SyncTaskToken::kForegroundTaskTokenID = 0; | 17 const int64 SyncTaskToken::kForegroundTaskTokenID = 0; |
| 17 const int64 SyncTaskToken::kMinimumBackgroundTaskTokenID = 1; | 18 const int64 SyncTaskToken::kMinimumBackgroundTaskTokenID = 1; |
| 18 | 19 |
| 19 // static | 20 // static |
| 20 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForTesting( | 21 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForTesting( |
| 21 const SyncStatusCallback& callback) { | 22 const SyncStatusCallback& callback) { |
| 22 return make_scoped_ptr(new SyncTaskToken( | 23 return make_scoped_ptr(new SyncTaskToken( |
| 23 base::WeakPtr<SyncTaskManager>(), | 24 base::WeakPtr<SyncTaskManager>(), |
| 24 base::MessageLoopProxy::current(), | 25 base::ThreadTaskRunnerHandle::Get(), |
| 25 kTestingTaskTokenID, | 26 kTestingTaskTokenID, |
| 26 scoped_ptr<BlockingFactor>(), | 27 scoped_ptr<BlockingFactor>(), |
| 27 callback)); | 28 callback)); |
| 28 } | 29 } |
| 29 | 30 |
| 30 // static | 31 // static |
| 31 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForForegroundTask( | 32 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForForegroundTask( |
| 32 const base::WeakPtr<SyncTaskManager>& manager, | 33 const base::WeakPtr<SyncTaskManager>& manager, |
| 33 base::SequencedTaskRunner* task_runner) { | 34 base::SequencedTaskRunner* task_runner) { |
| 34 return make_scoped_ptr(new SyncTaskToken( | 35 return make_scoped_ptr(new SyncTaskToken( |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 const SyncStatusCallback& callback) | 143 const SyncStatusCallback& callback) |
| 143 : manager_(manager), | 144 : manager_(manager), |
| 144 task_runner_(task_runner), | 145 task_runner_(task_runner), |
| 145 token_id_(token_id), | 146 token_id_(token_id), |
| 146 callback_(callback), | 147 callback_(callback), |
| 147 blocking_factor_(blocking_factor.Pass()) { | 148 blocking_factor_(blocking_factor.Pass()) { |
| 148 } | 149 } |
| 149 | 150 |
| 150 } // namespace drive_backend | 151 } // namespace drive_backend |
| 151 } // namespace sync_file_system | 152 } // namespace sync_file_system |
| OLD | NEW |