| Index: chrome/browser/lifetime/keep_alive_registry.h
|
| diff --git a/chrome/browser/lifetime/keep_alive_registry.h b/chrome/browser/lifetime/keep_alive_registry.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dc545ffaa1d8fc50b91b9aa0f356ea58402c4683
|
| --- /dev/null
|
| +++ b/chrome/browser/lifetime/keep_alive_registry.h
|
| @@ -0,0 +1,33 @@
|
| +// 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.
|
| +
|
| +#ifndef CHROME_BROWSER_LIFETIME_KEEP_ALIVE_REGISTRY_H_
|
| +#define CHROME_BROWSER_LIFETIME_KEEP_ALIVE_REGISTRY_H_
|
| +
|
| +#include <set>
|
| +
|
| +#include "base/macros.h"
|
| +#include "base/memory/singleton.h"
|
| +
|
| +struct KeepAliveOptions;
|
| +
|
| +class KeepAliveRegistry {
|
| + public:
|
| + static KeepAliveRegistry* GetInstance();
|
| +
|
| + void Register(const KeepAliveOptions* options);
|
| + void Unregister(const KeepAliveOptions* options);
|
| +
|
| + private:
|
| + friend struct base::DefaultSingletonTraits<KeepAliveRegistry>;
|
| +
|
| + KeepAliveRegistry();
|
| + ~KeepAliveRegistry();
|
| +
|
| + std::multiset<const KeepAliveOptions*> registered_keep_alives_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(KeepAliveRegistry);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_LIFETIME_KEEP_ALIVE_REGISTRY_H_
|
|
|