Chromium Code Reviews| Index: services/ui/display/platform_screen.cc |
| diff --git a/services/ui/display/platform_screen.cc b/services/ui/display/platform_screen.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eb170701cb5e43293d4812be07ef308a3b20702d |
| --- /dev/null |
| +++ b/services/ui/display/platform_screen.cc |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "services/ui/display/platform_screen.h" |
| + |
| +#include "base/logging.h" |
| + |
| +namespace display { |
| + |
| +PlatformScreen* PlatformScreen::instance_ = nullptr; |
|
sky
2016/09/08 18:03:35
Typically we comment with a
// static
on the previ
kylechar
2016/09/08 18:12:03
Done.
|
| + |
| +PlatformScreen::PlatformScreen() { |
| + DCHECK(!instance_); |
| + instance_ = this; |
| +} |
| + |
| +PlatformScreen::~PlatformScreen() { |
| + DCHECK_EQ(instance_, this); |
| + instance_ = nullptr; |
| +} |
| + |
| +// static |
| +PlatformScreen* PlatformScreen::GetInstance() { |
| + DCHECK(instance_); |
| + return instance_; |
| +} |
| + |
| +} // namespace display |