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

Side by Side Diff: chrome/browser/tabs/pinned_tab_service_factory.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/tabs/pinned_tab_service_factory.h" 5 #include "chrome/browser/tabs/pinned_tab_service_factory.h"
6 6
7 #include "chrome/browser/tabs/pinned_tab_service.h" 7 #include "chrome/browser/tabs/pinned_tab_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h" 9 #include "chrome/browser/profiles/profile_dependency_manager.h"
10 10
11 namespace { 11 namespace {
12 base::LazyInstance<PinnedTabServiceFactory> g_pinned_tab_service_factory( 12 base::LazyInstance<PinnedTabServiceFactory> g_pinned_tab_service_factory =
13 base::LINKER_INITIALIZED); 13 LAZY_INSTANCE_INITIALIZER;
14 } 14 }
15 15
16 // static 16 // static
17 void PinnedTabServiceFactory::InitForProfile(Profile* profile) { 17 void PinnedTabServiceFactory::InitForProfile(Profile* profile) {
18 g_pinned_tab_service_factory.Get().GetServiceForProfile(profile, true); 18 g_pinned_tab_service_factory.Get().GetServiceForProfile(profile, true);
19 } 19 }
20 20
21 PinnedTabServiceFactory::PinnedTabServiceFactory() 21 PinnedTabServiceFactory::PinnedTabServiceFactory()
22 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { 22 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
23 } 23 }
24 24
25 PinnedTabServiceFactory::~PinnedTabServiceFactory() { 25 PinnedTabServiceFactory::~PinnedTabServiceFactory() {
26 } 26 }
27 27
28 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( 28 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor(
29 Profile* profile) const { 29 Profile* profile) const {
30 return new PinnedTabService(profile); 30 return new PinnedTabService(profile);
31 } 31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698