[email protected] | fafdc84 | 2014-01-17 18:09:08 | [diff] [blame] | 1 | // Copyright 2014 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 EXTENSIONS_BROWSER_PROCESS_MAP_FACTORY_H_ | ||||
6 | #define EXTENSIONS_BROWSER_PROCESS_MAP_FACTORY_H_ | ||||
7 | |||||
8 | #include "base/compiler_specific.h" | ||||
avi | c9cec10 | 2015-12-23 00:39:26 | [diff] [blame] | 9 | #include "base/macros.h" |
[email protected] | fafdc84 | 2014-01-17 18:09:08 | [diff] [blame] | 10 | #include "base/memory/singleton.h" |
[email protected] | b33f0b11 | 2014-03-13 17:05:30 | [diff] [blame] | 11 | #include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
[email protected] | fafdc84 | 2014-01-17 18:09:08 | [diff] [blame] | 12 | |
13 | namespace extensions { | ||||
14 | |||||
15 | class ProcessMap; | ||||
16 | |||||
17 | // Factory for ProcessMap objects. ProcessMap objects are shared between an | ||||
18 | // incognito browser context and its master browser context. | ||||
19 | class ProcessMapFactory : public BrowserContextKeyedServiceFactory { | ||||
20 | public: | ||||
21 | static ProcessMap* GetForBrowserContext(content::BrowserContext* context); | ||||
22 | |||||
23 | static ProcessMapFactory* GetInstance(); | ||||
24 | |||||
25 | private: | ||||
olli.raula | 36aa8be | 2015-09-10 11:14:22 | [diff] [blame] | 26 | friend struct base::DefaultSingletonTraits<ProcessMapFactory>; |
[email protected] | fafdc84 | 2014-01-17 18:09:08 | [diff] [blame] | 27 | |
28 | ProcessMapFactory(); | ||||
dcheng | 9168b2f | 2014-10-21 12:38:24 | [diff] [blame] | 29 | ~ProcessMapFactory() override; |
[email protected] | fafdc84 | 2014-01-17 18:09:08 | [diff] [blame] | 30 | |
31 | // BrowserContextKeyedServiceFactory implementation: | ||||
dcheng | 9168b2f | 2014-10-21 12:38:24 | [diff] [blame] | 32 | KeyedService* BuildServiceInstanceFor( |
mostynb | 0eac4e1b | 2014-10-03 16:32:19 | [diff] [blame] | 33 | content::BrowserContext* context) const override; |
dcheng | 9168b2f | 2014-10-21 12:38:24 | [diff] [blame] | 34 | content::BrowserContext* GetBrowserContextToUse( |
mostynb | 0eac4e1b | 2014-10-03 16:32:19 | [diff] [blame] | 35 | content::BrowserContext* context) const override; |
[email protected] | fafdc84 | 2014-01-17 18:09:08 | [diff] [blame] | 36 | |
37 | private: | ||||
38 | DISALLOW_COPY_AND_ASSIGN(ProcessMapFactory); | ||||
39 | }; | ||||
40 | |||||
41 | } // namespace extensions | ||||
42 | |||||
43 | #endif // EXTENSIONS_BROWSER_PROCESS_MAP_FACTORY_H_ |