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

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

Issue 515093002: FileAPI/sync file system cleanups for scoped_refptr operator T* cleanup. (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_manager.h" 5 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const PendingTask& left, 48 const PendingTask& left,
49 const PendingTask& right) const { 49 const PendingTask& right) const {
50 if (left.priority != right.priority) 50 if (left.priority != right.priority)
51 return left.priority < right.priority; 51 return left.priority < right.priority;
52 return left.seq > right.seq; 52 return left.seq > right.seq;
53 } 53 }
54 54
55 SyncTaskManager::SyncTaskManager( 55 SyncTaskManager::SyncTaskManager(
56 base::WeakPtr<Client> client, 56 base::WeakPtr<Client> client,
57 size_t maximum_background_task, 57 size_t maximum_background_task,
58 base::SequencedTaskRunner* task_runner) 58 const scoped_refptr<base::SequencedTaskRunner>& task_runner)
59 : client_(client), 59 : client_(client),
60 maximum_background_task_(maximum_background_task), 60 maximum_background_task_(maximum_background_task),
61 pending_task_seq_(0), 61 pending_task_seq_(0),
62 task_token_seq_(SyncTaskToken::kMinimumBackgroundTaskTokenID), 62 task_token_seq_(SyncTaskToken::kMinimumBackgroundTaskTokenID),
63 task_runner_(task_runner) { 63 task_runner_(task_runner) {
64 } 64 }
65 65
66 SyncTaskManager::~SyncTaskManager() { 66 SyncTaskManager::~SyncTaskManager() {
67 client_.reset(); 67 client_.reset();
68 token_.reset(); 68 token_.reset();
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 closure.Run(); 394 closure.Run();
395 return; 395 return;
396 } 396 }
397 397
398 if (client_) 398 if (client_)
399 client_->MaybeScheduleNextTask(); 399 client_->MaybeScheduleNextTask();
400 } 400 }
401 401
402 } // namespace drive_backend 402 } // namespace drive_backend
403 } // namespace sync_file_system 403 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698