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

Side by Side Diff: sync/internal_api/public/attachments/task_queue.h

Issue 1539843002: Convert Pass()→std::move() in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up 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 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9
10 #include <deque> 9 #include <deque>
11 #include <set> 10 #include <set>
11 #include <utility>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "base/message_loop/message_loop.h" 17 #include "base/message_loop/message_loop.h"
18 #include "base/threading/non_thread_safe.h" 18 #include "base/threading/non_thread_safe.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "base/timer/timer.h" 20 #include "base/timer/timer.h"
21 #include "net/base/backoff_entry.h" 21 #include "net/base/backoff_entry.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 void TaskQueue<T>::ResetBackoff() { 228 void TaskQueue<T>::ResetBackoff() {
229 backoff_timer_->Stop(); 229 backoff_timer_->Stop();
230 backoff_entry_->Reset(); 230 backoff_entry_->Reset();
231 ScheduleDispatch(); 231 ScheduleDispatch();
232 } 232 }
233 233
234 template <typename T> 234 template <typename T>
235 void TaskQueue<T>::SetTimerForTest(scoped_ptr<base::Timer> timer) { 235 void TaskQueue<T>::SetTimerForTest(scoped_ptr<base::Timer> timer) {
236 DCHECK(CalledOnValidThread()); 236 DCHECK(CalledOnValidThread());
237 DCHECK(timer.get()); 237 DCHECK(timer.get());
238 backoff_timer_ = timer.Pass(); 238 backoff_timer_ = std::move(timer);
239 } 239 }
240 240
241 template <typename T> 241 template <typename T>
242 void TaskQueue<T>::FinishTask(const T& task) { 242 void TaskQueue<T>::FinishTask(const T& task) {
243 DCHECK(CalledOnValidThread()); 243 DCHECK(CalledOnValidThread());
244 DCHECK_GE(num_in_progress_, 1); 244 DCHECK_GE(num_in_progress_, 1);
245 --num_in_progress_; 245 --num_in_progress_;
246 const size_t num_erased = tasks_.erase(task); 246 const size_t num_erased = tasks_.erase(task);
247 DCHECK_EQ(1U, num_erased); 247 DCHECK_EQ(1U, num_erased);
248 } 248 }
(...skipping 26 matching lines...) Expand all
275 } 275 }
276 276
277 template <typename T> 277 template <typename T>
278 bool TaskQueue<T>::ShouldDispatch() { 278 bool TaskQueue<T>::ShouldDispatch() {
279 return num_in_progress_ < kMaxConcurrentTasks && !queue_.empty(); 279 return num_in_progress_ < kMaxConcurrentTasks && !queue_.empty();
280 } 280 }
281 281
282 } // namespace syncer 282 } // namespace syncer
283 283
284 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_ 284 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_TASK_QUEUE_H_
OLDNEW
« no previous file with comments | « sync/internal_api/protocol_event_buffer.cc ('k') | sync/internal_api/public/base/progress_marker_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698