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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_task_token.cc

Issue 1545223002: Switch to standard integer types in chrome/browser/, part 4 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 12 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 unified diff | Download patch
OLDNEW
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/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #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"
11 #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"
12 12
13 namespace sync_file_system { 13 namespace sync_file_system {
14 namespace drive_backend { 14 namespace drive_backend {
15 15
16 const int64 SyncTaskToken::kTestingTaskTokenID = -1; 16 const int64_t SyncTaskToken::kTestingTaskTokenID = -1;
17 const int64 SyncTaskToken::kForegroundTaskTokenID = 0; 17 const int64_t SyncTaskToken::kForegroundTaskTokenID = 0;
18 const int64 SyncTaskToken::kMinimumBackgroundTaskTokenID = 1; 18 const int64_t SyncTaskToken::kMinimumBackgroundTaskTokenID = 1;
19 19
20 // static 20 // static
21 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForTesting( 21 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForTesting(
22 const SyncStatusCallback& callback) { 22 const SyncStatusCallback& callback) {
23 return make_scoped_ptr(new SyncTaskToken( 23 return make_scoped_ptr(new SyncTaskToken(
24 base::WeakPtr<SyncTaskManager>(), 24 base::WeakPtr<SyncTaskManager>(),
25 base::ThreadTaskRunnerHandle::Get(), 25 base::ThreadTaskRunnerHandle::Get(),
26 kTestingTaskTokenID, 26 kTestingTaskTokenID,
27 nullptr, // task_blocker 27 nullptr, // task_blocker
28 callback)); 28 callback));
29 } 29 }
30 30
31 // static 31 // static
32 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForForegroundTask( 32 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForForegroundTask(
33 const base::WeakPtr<SyncTaskManager>& manager, 33 const base::WeakPtr<SyncTaskManager>& manager,
34 base::SequencedTaskRunner* task_runner) { 34 base::SequencedTaskRunner* task_runner) {
35 return make_scoped_ptr(new SyncTaskToken( 35 return make_scoped_ptr(new SyncTaskToken(
36 manager, 36 manager,
37 task_runner, 37 task_runner,
38 kForegroundTaskTokenID, 38 kForegroundTaskTokenID,
39 nullptr, // task_blocker 39 nullptr, // task_blocker
40 SyncStatusCallback())); 40 SyncStatusCallback()));
41 } 41 }
42 42
43 // static 43 // static
44 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForBackgroundTask( 44 scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForBackgroundTask(
45 const base::WeakPtr<SyncTaskManager>& manager, 45 const base::WeakPtr<SyncTaskManager>& manager,
46 base::SequencedTaskRunner* task_runner, 46 base::SequencedTaskRunner* task_runner,
47 int64 token_id, 47 int64_t token_id,
48 scoped_ptr<TaskBlocker> task_blocker) { 48 scoped_ptr<TaskBlocker> task_blocker) {
49 return make_scoped_ptr(new SyncTaskToken( 49 return make_scoped_ptr(new SyncTaskToken(
50 manager, 50 manager,
51 task_runner, 51 task_runner,
52 token_id, 52 token_id,
53 task_blocker.Pass(), 53 task_blocker.Pass(),
54 SyncStatusCallback())); 54 SyncStatusCallback()));
55 } 55 }
56 56
57 void SyncTaskToken::UpdateTask(const tracked_objects::Location& location, 57 void SyncTaskToken::UpdateTask(const tracked_objects::Location& location,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 task_log_ = task_log.Pass(); 137 task_log_ = task_log.Pass();
138 } 138 }
139 139
140 scoped_ptr<TaskLogger::TaskLog> SyncTaskToken::PassTaskLog() { 140 scoped_ptr<TaskLogger::TaskLog> SyncTaskToken::PassTaskLog() {
141 return task_log_.Pass(); 141 return task_log_.Pass();
142 } 142 }
143 143
144 SyncTaskToken::SyncTaskToken( 144 SyncTaskToken::SyncTaskToken(
145 const base::WeakPtr<SyncTaskManager>& manager, 145 const base::WeakPtr<SyncTaskManager>& manager,
146 const scoped_refptr<base::SequencedTaskRunner>& task_runner, 146 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
147 int64 token_id, 147 int64_t token_id,
148 scoped_ptr<TaskBlocker> task_blocker, 148 scoped_ptr<TaskBlocker> task_blocker,
149 const SyncStatusCallback& callback) 149 const SyncStatusCallback& callback)
150 : manager_(manager), 150 : manager_(manager),
151 task_runner_(task_runner), 151 task_runner_(task_runner),
152 token_id_(token_id), 152 token_id_(token_id),
153 callback_(callback), 153 callback_(callback),
154 task_blocker_(task_blocker.Pass()) { 154 task_blocker_(task_blocker.Pass()) {}
155 }
156 155
157 } // namespace drive_backend 156 } // namespace drive_backend
158 } // namespace sync_file_system 157 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698