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

Side by Side Diff: components/power/origin_power_map_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
« no previous file with comments | « components/power/origin_power_map_factory.h ('k') | components/rlz/rlz_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/power/origin_power_map_factory.h" 5 #include "components/power/origin_power_map_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "components/power/origin_power_map.h" 9 #include "components/power/origin_power_map.h"
10 10
11 namespace power { 11 namespace power {
12 // static 12 // static
13 OriginPowerMap* OriginPowerMapFactory::GetForBrowserContext( 13 OriginPowerMap* OriginPowerMapFactory::GetForBrowserContext(
14 content::BrowserContext* context) { 14 content::BrowserContext* context) {
15 return static_cast<OriginPowerMap*>( 15 return static_cast<OriginPowerMap*>(
16 GetInstance()->GetServiceForBrowserContext(context, true)); 16 GetInstance()->GetServiceForBrowserContext(context, true));
17 } 17 }
18 18
19 // static 19 // static
20 OriginPowerMapFactory* OriginPowerMapFactory::GetInstance() { 20 OriginPowerMapFactory* OriginPowerMapFactory::GetInstance() {
21 return Singleton<OriginPowerMapFactory>::get(); 21 return base::Singleton<OriginPowerMapFactory>::get();
22 } 22 }
23 23
24 OriginPowerMapFactory::OriginPowerMapFactory() 24 OriginPowerMapFactory::OriginPowerMapFactory()
25 : BrowserContextKeyedServiceFactory( 25 : BrowserContextKeyedServiceFactory(
26 "OriginPowerMap", 26 "OriginPowerMap",
27 BrowserContextDependencyManager::GetInstance()) { 27 BrowserContextDependencyManager::GetInstance()) {
28 } 28 }
29 29
30 OriginPowerMapFactory::~OriginPowerMapFactory() { 30 OriginPowerMapFactory::~OriginPowerMapFactory() {
31 } 31 }
32 32
33 KeyedService* OriginPowerMapFactory::BuildServiceInstanceFor( 33 KeyedService* OriginPowerMapFactory::BuildServiceInstanceFor(
34 content::BrowserContext* context) const { 34 content::BrowserContext* context) const {
35 return new OriginPowerMap(); 35 return new OriginPowerMap();
36 } 36 }
37 37
38 } // namespace power 38 } // namespace power
OLDNEW
« no previous file with comments | « components/power/origin_power_map_factory.h ('k') | components/rlz/rlz_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698