// Copyright 2016 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_KEEP_ALIVE_REGISTRY_KEEP_ALIVE_REGISTRY_H_ #define COMPONENTS_KEEP_ALIVE_REGISTRY_KEEP_ALIVE_REGISTRY_H_ #include <unordered_map> #include <vector> #include "base/memory/singleton.h" #include "base/observer_list.h" enum class KeepAliveOrigin; enum class KeepAliveRestartOption; class KeepAliveStateObserver; // Centralized registry that objects in the browser can use to // express their requirements wrt the lifetime of the browser. // Observers registered with it can then react as those requirements // change. // In particular, this is how the browser process knows when to stop // or stay alive. // Note: BrowserProcessImpl registers to react on changes. // TestingBrowserProcess does not do it, meaning that the shutdown // sequence does not happen during unit tests. // Note: This is not thread-safe, and should only be used on the main thread. class KeepAliveRegistry { … }; #endif // COMPONENTS_KEEP_ALIVE_REGISTRY_KEEP_ALIVE_REGISTRY_H_