arc_app_id_provider.cc 608 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2019 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. #include "ash/public/cpp/arc_app_id_provider.h"
  5. #include "base/check_op.h"
  6. namespace ash {
  7. namespace {
  8. ArcAppIdProvider* g_instance = nullptr;
  9. }
  10. // static
  11. ArcAppIdProvider* ArcAppIdProvider::Get() {
  12. return g_instance;
  13. }
  14. ArcAppIdProvider::ArcAppIdProvider() {
  15. DCHECK_EQ(nullptr, g_instance);
  16. g_instance = this;
  17. }
  18. ArcAppIdProvider::~ArcAppIdProvider() {
  19. DCHECK_EQ(this, g_instance);
  20. g_instance = nullptr;
  21. }
  22. } // namespace ash