| 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/activity/public/activity_factory.h" | 5 #include "athena/activity/public/activity_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace athena { | 9 namespace athena { |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 ActivityFactory* instance = NULL; | 13 ActivityFactory* instance = nullptr; |
| 14 | |
| 15 } | 14 } |
| 16 | 15 |
| 17 // static | 16 // static |
| 18 void ActivityFactory::RegisterActivityFactory(ActivityFactory* factory) { | 17 void ActivityFactory::RegisterActivityFactory(ActivityFactory* factory) { |
| 19 DCHECK(!instance); | 18 DCHECK(!instance); |
| 20 instance = factory; | 19 instance = factory; |
| 21 } | 20 } |
| 22 | 21 |
| 23 // static | 22 // static |
| 24 ActivityFactory* ActivityFactory::Get() { | 23 ActivityFactory* ActivityFactory::Get() { |
| 25 DCHECK(instance); | 24 DCHECK(instance); |
| 26 return instance; | 25 return instance; |
| 27 } | 26 } |
| 28 | 27 |
| 29 // static | 28 // static |
| 30 void ActivityFactory::Shutdown() { | 29 void ActivityFactory::Shutdown() { |
| 31 DCHECK(instance); | 30 DCHECK(instance); |
| 32 delete instance; | 31 delete instance; |
| 33 instance = NULL; | 32 instance = nullptr; |
| 34 } | 33 } |
| 35 | 34 |
| 36 } // namespace athena | 35 } // namespace athena |
| OLD | NEW |