OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 | |
5 #ifndef CHROME_BROWSER_LIFETIME_KEEP_ALIVE_REGISTRY_H_ | |
6 #define CHROME_BROWSER_LIFETIME_KEEP_ALIVE_REGISTRY_H_ | |
7 | |
8 #include <set> | |
9 #include <string> | |
10 | |
11 #include "base/macros.h" | |
12 #include "base/memory/singleton.h" | |
13 | |
14 enum class OptimizationOptions { | |
15 NONE = 0, | |
16 RESTART_ALLOWED, | |
17 OPTIMIZATION_OPTIONS_LAST = RESTART_ALLOWED | |
18 }; | |
19 | |
20 class KeepAliveRegistry { | |
Bernhard Bauer
2016/02/19 17:39:28
You might be able to move this whole class into an
dgn
2016/02/19 18:04:28
Can I do that at the end of the migration? I'm not
Bernhard Bauer
2016/02/22 18:19:38
Okay… Could you make the Register/Unregister metho
dgn
2016/02/22 19:07:19
Done.
| |
21 public: | |
22 static KeepAliveRegistry* GetInstance(); | |
23 | |
24 void RegisterToken(const std::string& token, OptimizationOptions opt); | |
25 void UnregisterToken(const std::string& token, OptimizationOptions opt); | |
26 | |
27 private: | |
28 friend struct base::DefaultSingletonTraits<KeepAliveRegistry>; | |
29 | |
30 KeepAliveRegistry(); | |
31 virtual ~KeepAliveRegistry(); | |
32 | |
33 std::multiset<std::string> registered_tokens_; | |
34 std::multiset<std::string> reset_allowed_tokens_; | |
Bernhard Bauer
2016/02/19 17:39:28
|restart_allowed_tokens_|?
dgn
2016/02/19 18:04:28
oops forgot to fix that. Done.
| |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(KeepAliveRegistry); | |
37 }; | |
38 | |
39 #endif // CHROME_BROWSER_LIFETIME_KEEP_ALIVE_REGISTRY_H_ | |
OLD | NEW |