blob: 051df65315027220f0a3579cda8f7e4c15104e96 [file] [log] [blame]
[email protected]fafdc842014-01-17 18:09:081// 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"
avic9cec102015-12-23 00:39:269#include "base/macros.h"
[email protected]fafdc842014-01-17 18:09:0810#include "base/memory/singleton.h"
[email protected]b33f0b112014-03-13 17:05:3011#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
[email protected]fafdc842014-01-17 18:09:0812
13namespace extensions {
14
15class ProcessMap;
16
17// Factory for ProcessMap objects. ProcessMap objects are shared between an
18// incognito browser context and its master browser context.
19class ProcessMapFactory : public BrowserContextKeyedServiceFactory {
20 public:
21 static ProcessMap* GetForBrowserContext(content::BrowserContext* context);
22
23 static ProcessMapFactory* GetInstance();
24
25 private:
olli.raula36aa8be2015-09-10 11:14:2226 friend struct base::DefaultSingletonTraits<ProcessMapFactory>;
[email protected]fafdc842014-01-17 18:09:0827
28 ProcessMapFactory();
dcheng9168b2f2014-10-21 12:38:2429 ~ProcessMapFactory() override;
[email protected]fafdc842014-01-17 18:09:0830
31 // BrowserContextKeyedServiceFactory implementation:
dcheng9168b2f2014-10-21 12:38:2432 KeyedService* BuildServiceInstanceFor(
mostynb0eac4e1b2014-10-03 16:32:1933 content::BrowserContext* context) const override;
dcheng9168b2f2014-10-21 12:38:2434 content::BrowserContext* GetBrowserContextToUse(
mostynb0eac4e1b2014-10-03 16:32:1935 content::BrowserContext* context) const override;
[email protected]fafdc842014-01-17 18:09:0836
37 private:
38 DISALLOW_COPY_AND_ASSIGN(ProcessMapFactory);
39};
40
41} // namespace extensions
42
43#endif // EXTENSIONS_BROWSER_PROCESS_MAP_FACTORY_H_