Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: extensions/browser/process_map_factory.cc

Issue 139943005: Convert extensions::ProcessMap to BrowserContextKeyedService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase process_map Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « extensions/browser/process_map_factory.h ('k') | extensions/extensions.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 #include "extensions/browser/process_map_factory.h"
6
7 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
8 #include "extensions/browser/extensions_browser_client.h"
9 #include "extensions/browser/process_map.h"
10
11 using content::BrowserContext;
12
13 namespace extensions {
14
15 // static
16 ProcessMap* ProcessMapFactory::GetForBrowserContext(BrowserContext* context) {
17 return static_cast<ProcessMap*>(
18 GetInstance()->GetServiceForBrowserContext(context, true));
19 }
20
21 // static
22 ProcessMapFactory* ProcessMapFactory::GetInstance() {
23 return Singleton<ProcessMapFactory>::get();
24 }
25
26 ProcessMapFactory::ProcessMapFactory()
27 : BrowserContextKeyedServiceFactory(
28 "ProcessMap",
29 BrowserContextDependencyManager::GetInstance()) {
30 // No dependencies on other services.
31 }
32
33 ProcessMapFactory::~ProcessMapFactory() {}
34
35 BrowserContextKeyedService* ProcessMapFactory::BuildServiceInstanceFor(
36 BrowserContext* context) const {
37 return new ProcessMap;
38 }
39
40 BrowserContext* ProcessMapFactory::GetBrowserContextToUse(
41 BrowserContext* context) const {
42 // Redirected in incognito.
43 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
44 }
45
46 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/process_map_factory.h ('k') | extensions/extensions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698