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

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

Issue 1873683002: Convert //chrome/browser/sync_file_system from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_task.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.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/sync_task_token.h" 11 #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h"
12 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager. h" 12 #include "chrome/browser/sync_file_system/drive_backend/task_dependency_manager. h"
13 13
14 namespace sync_file_system { 14 namespace sync_file_system {
15 namespace drive_backend { 15 namespace drive_backend {
16 16
17 namespace { 17 namespace {
18 18
19 void CallRunExclusive(const base::WeakPtr<ExclusiveTask>& task, 19 void CallRunExclusive(const base::WeakPtr<ExclusiveTask>& task,
20 scoped_ptr<SyncTaskToken> token) { 20 std::unique_ptr<SyncTaskToken> token) {
21 if (task) 21 if (task)
22 task->RunExclusive(SyncTaskToken::WrapToCallback(std::move(token))); 22 task->RunExclusive(SyncTaskToken::WrapToCallback(std::move(token)));
23 } 23 }
24 24
25 } // namespace 25 } // namespace
26 26
27 ExclusiveTask::ExclusiveTask() : weak_ptr_factory_(this) {} 27 ExclusiveTask::ExclusiveTask() : weak_ptr_factory_(this) {}
28 ExclusiveTask::~ExclusiveTask() {} 28 ExclusiveTask::~ExclusiveTask() {}
29 29
30 void ExclusiveTask::RunPreflight(scoped_ptr<SyncTaskToken> token) { 30 void ExclusiveTask::RunPreflight(std::unique_ptr<SyncTaskToken> token) {
31 scoped_ptr<TaskBlocker> task_blocker(new TaskBlocker); 31 std::unique_ptr<TaskBlocker> task_blocker(new TaskBlocker);
32 task_blocker->exclusive = true; 32 task_blocker->exclusive = true;
33 33
34 SyncTaskManager::UpdateTaskBlocker( 34 SyncTaskManager::UpdateTaskBlocker(
35 std::move(token), std::move(task_blocker), 35 std::move(token), std::move(task_blocker),
36 base::Bind(&CallRunExclusive, weak_ptr_factory_.GetWeakPtr())); 36 base::Bind(&CallRunExclusive, weak_ptr_factory_.GetWeakPtr()));
37 } 37 }
38 38
39 } // namespace drive_backend 39 } // namespace drive_backend
40 } // namespace sync_file_system 40 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698