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

Side by Side Diff: base/task_scheduler/scheduler_lock_impl.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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
« no previous file with comments | « base/task_scheduler/scheduler_lock.h ('k') | base/task_scheduler/scheduler_lock_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H
6 #define BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H 6 #define BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H
7 7
8 #include <memory>
9
8 #include "base/base_export.h" 10 #include "base/base_export.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
12 13
13 namespace base { 14 namespace base {
14 15
15 class ConditionVariable; 16 class ConditionVariable;
16 17
17 namespace internal { 18 namespace internal {
18 19
19 // A regular lock with simple deadlock correctness checking. 20 // A regular lock with simple deadlock correctness checking.
20 // This lock tracks all of the available locks to make sure that any locks are 21 // This lock tracks all of the available locks to make sure that any locks are
21 // acquired in an expected order. 22 // acquired in an expected order.
22 // See scheduler_lock.h for details. 23 // See scheduler_lock.h for details.
23 class BASE_EXPORT SchedulerLockImpl { 24 class BASE_EXPORT SchedulerLockImpl {
24 public: 25 public:
25 SchedulerLockImpl(); 26 SchedulerLockImpl();
26 explicit SchedulerLockImpl(const SchedulerLockImpl* predecessor); 27 explicit SchedulerLockImpl(const SchedulerLockImpl* predecessor);
27 ~SchedulerLockImpl(); 28 ~SchedulerLockImpl();
28 29
29 void Acquire(); 30 void Acquire();
30 void Release(); 31 void Release();
31 32
32 void AssertAcquired() const; 33 void AssertAcquired() const;
33 34
34 scoped_ptr<ConditionVariable> CreateConditionVariable(); 35 std::unique_ptr<ConditionVariable> CreateConditionVariable();
35 36
36 private: 37 private:
37 Lock lock_; 38 Lock lock_;
38 39
39 DISALLOW_COPY_AND_ASSIGN(SchedulerLockImpl); 40 DISALLOW_COPY_AND_ASSIGN(SchedulerLockImpl);
40 }; 41 };
41 42
42 } // namespace internal 43 } // namespace internal
43 } // namespace base 44 } // namespace base
44 45
45 #endif // BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H 46 #endif // BASE_TASK_SCHEDULER_SCHEDULER_LOCK_IMPL_H
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_lock.h ('k') | base/task_scheduler/scheduler_lock_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698