OLD | NEW |
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 "athena/screen_lock/screen_lock_manager_base.h" | 5 #include "athena/screen_lock/screen_lock_manager_base.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace athena { | 9 namespace athena { |
10 namespace { | 10 namespace { |
11 | 11 |
12 ScreenLockManager* instance = NULL; | 12 ScreenLockManager* instance = nullptr; |
13 | 13 |
14 } // namespace | 14 } // namespace |
15 | 15 |
16 ScreenLockManagerBase::ScreenLockManagerBase() { | 16 ScreenLockManagerBase::ScreenLockManagerBase() { |
17 DCHECK(!instance); | 17 DCHECK(!instance); |
18 instance = this; | 18 instance = this; |
19 } | 19 } |
20 | 20 |
21 ScreenLockManagerBase::~ScreenLockManagerBase() { | 21 ScreenLockManagerBase::~ScreenLockManagerBase() { |
22 DCHECK_EQ(instance, this); | 22 DCHECK_EQ(instance, this); |
23 instance = NULL; | 23 instance = nullptr; |
24 } | 24 } |
25 | 25 |
26 // static | 26 // static |
27 ScreenLockManager* ScreenLockManager::Get() { | 27 ScreenLockManager* ScreenLockManager::Get() { |
28 return instance; | 28 return instance; |
29 } | 29 } |
30 | 30 |
31 // static | 31 // static |
32 void ScreenLockManager::Shutdown() { | 32 void ScreenLockManager::Shutdown() { |
33 if (instance) { | 33 if (instance) { |
34 delete instance; | 34 delete instance; |
35 DCHECK(!instance); | 35 DCHECK(!instance); |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 } // namespace athena | 39 } // namespace athena |
OLD | NEW |