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

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

Issue 608133002: [SyncFS] Use nullptr for scoped_ptr initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nullptr
Patch Set: Created 6 years, 2 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/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.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 SyncTaskToken::kTestingTaskTokenID = -1;
17 const int64 SyncTaskToken::kForegroundTaskTokenID = 0; 17 const int64 SyncTaskToken::kForegroundTaskTokenID = 0;
18 const int64 SyncTaskToken::kMinimumBackgroundTaskTokenID = 1; 18 const int64 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 scoped_ptr<TaskBlocker>(), 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 scoped_ptr<TaskBlocker>(), 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 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(
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const SyncStatusCallback& callback) 146 const SyncStatusCallback& callback)
147 : manager_(manager), 147 : manager_(manager),
148 task_runner_(task_runner), 148 task_runner_(task_runner),
149 token_id_(token_id), 149 token_id_(token_id),
150 callback_(callback), 150 callback_(callback),
151 task_blocker_(task_blocker.Pass()) { 151 task_blocker_(task_blocker.Pass()) {
152 } 152 }
153 153
154 } // namespace drive_backend 154 } // namespace drive_backend
155 } // namespace sync_file_system 155 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698