dbaa77d49e5f6d84f3fa3b22d9aff05f2c586129
[platform/framework/web/crosswalk.git] / src / athena / activity / activity_factory.cc
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
3 // found in the LICENSE file.
4
5 #include "athena/activity/public/activity_factory.h"
6
7 #include "base/logging.h"
8
9 namespace athena {
10
11 namespace {
12
13 ActivityFactory* instance = nullptr;
14 }
15
16 // static
17 void ActivityFactory::RegisterActivityFactory(ActivityFactory* factory) {
18   DCHECK(!instance);
19   instance = factory;
20 }
21
22 // static
23 ActivityFactory* ActivityFactory::Get() {
24   DCHECK(instance);
25   return instance;
26 }
27
28 // static
29 void ActivityFactory::Shutdown() {
30   DCHECK(instance);
31   delete instance;
32   instance = nullptr;
33 }
34
35 }  // namespace athena