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

Side by Side Diff: chrome/browser/bitmap_fetcher/bitmap_fetcher_service_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
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 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h" 4 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h"
5 5
6 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" 6 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 9
10 /// Factory 10 /// Factory
11 BitmapFetcherService* BitmapFetcherServiceFactory::GetForBrowserContext( 11 BitmapFetcherService* BitmapFetcherServiceFactory::GetForBrowserContext(
12 content::BrowserContext* profile) { 12 content::BrowserContext* profile) {
13 return static_cast<BitmapFetcherService*>( 13 return static_cast<BitmapFetcherService*>(
14 GetInstance()->GetServiceForBrowserContext(profile, true)); 14 GetInstance()->GetServiceForBrowserContext(profile, true));
15 } 15 }
16 16
17 // static 17 // static
18 BitmapFetcherServiceFactory* BitmapFetcherServiceFactory::GetInstance() { 18 BitmapFetcherServiceFactory* BitmapFetcherServiceFactory::GetInstance() {
19 return Singleton<BitmapFetcherServiceFactory>::get(); 19 return base::Singleton<BitmapFetcherServiceFactory>::get();
20 } 20 }
21 21
22 BitmapFetcherServiceFactory::BitmapFetcherServiceFactory() 22 BitmapFetcherServiceFactory::BitmapFetcherServiceFactory()
23 : BrowserContextKeyedServiceFactory( 23 : BrowserContextKeyedServiceFactory(
24 "BitmapFetcherService", 24 "BitmapFetcherService",
25 BrowserContextDependencyManager::GetInstance()) { 25 BrowserContextDependencyManager::GetInstance()) {
26 } 26 }
27 27
28 BitmapFetcherServiceFactory::~BitmapFetcherServiceFactory() { 28 BitmapFetcherServiceFactory::~BitmapFetcherServiceFactory() {
29 } 29 }
30 30
31 KeyedService* BitmapFetcherServiceFactory::BuildServiceInstanceFor( 31 KeyedService* BitmapFetcherServiceFactory::BuildServiceInstanceFor(
32 content::BrowserContext* context) const { 32 content::BrowserContext* context) const {
33 Profile* profile = static_cast<Profile*>(context); 33 Profile* profile = static_cast<Profile*>(context);
34 DCHECK(!profile->IsOffTheRecord()); 34 DCHECK(!profile->IsOffTheRecord());
35 return new BitmapFetcherService(profile); 35 return new BitmapFetcherService(profile);
36 } 36 }
OLDNEW
« no previous file with comments | « chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h ('k') | chrome/browser/bookmarks/bookmark_model_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698