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

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

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

Powered by Google App Engine
This is Rietveld 408576698