keyed_service_shutdown_notifier.cc 686 B

123456789101112131415161718
  1. // Copyright 2015 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 "components/keyed_service/core/keyed_service_export.h"
  5. #include "components/keyed_service/core/keyed_service_shutdown_notifier.h"
  6. KeyedServiceShutdownNotifier::KeyedServiceShutdownNotifier() = default;
  7. KeyedServiceShutdownNotifier::~KeyedServiceShutdownNotifier() = default;
  8. base::CallbackListSubscription KeyedServiceShutdownNotifier::Subscribe(
  9. base::OnceClosure callback) {
  10. return closure_list_.Add(std::move(callback));
  11. }
  12. void KeyedServiceShutdownNotifier::Shutdown() {
  13. closure_list_.Notify();
  14. }