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

Side by Side Diff: chrome/browser/sessions/session_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sessions/session_service_factory.h" 5 #include "chrome/browser/sessions/session_service_factory.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sessions/session_data_deleter.h" 8 #include "chrome/browser/sessions/session_data_deleter.h"
9 #include "chrome/browser/sessions/session_service.h" 9 #include "chrome/browser/sessions/session_service.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" 10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 factory->GetServiceForBrowserContext(profile, true); 56 factory->GetServiceForBrowserContext(profile, true);
57 57
58 // Shut down and remove the reference to the session service, and replace it 58 // Shut down and remove the reference to the session service, and replace it
59 // with an explicit NULL to prevent it being recreated on the next access. 59 // with an explicit NULL to prevent it being recreated on the next access.
60 factory->BrowserContextShutdown(profile); 60 factory->BrowserContextShutdown(profile);
61 factory->BrowserContextDestroyed(profile); 61 factory->BrowserContextDestroyed(profile);
62 factory->Associate(profile, NULL); 62 factory->Associate(profile, NULL);
63 } 63 }
64 64
65 SessionServiceFactory* SessionServiceFactory::GetInstance() { 65 SessionServiceFactory* SessionServiceFactory::GetInstance() {
66 return Singleton<SessionServiceFactory>::get(); 66 return base::Singleton<SessionServiceFactory>::get();
67 } 67 }
68 68
69 SessionServiceFactory::SessionServiceFactory() 69 SessionServiceFactory::SessionServiceFactory()
70 : BrowserContextKeyedServiceFactory( 70 : BrowserContextKeyedServiceFactory(
71 "SessionService", 71 "SessionService",
72 BrowserContextDependencyManager::GetInstance()) { 72 BrowserContextDependencyManager::GetInstance()) {
73 } 73 }
74 74
75 SessionServiceFactory::~SessionServiceFactory() { 75 SessionServiceFactory::~SessionServiceFactory() {
76 } 76 }
77 77
78 KeyedService* SessionServiceFactory::BuildServiceInstanceFor( 78 KeyedService* SessionServiceFactory::BuildServiceInstanceFor(
79 content::BrowserContext* profile) const { 79 content::BrowserContext* profile) const {
80 SessionService* service = NULL; 80 SessionService* service = NULL;
81 service = new SessionService(static_cast<Profile*>(profile)); 81 service = new SessionService(static_cast<Profile*>(profile));
82 service->ResetFromCurrentBrowsers(); 82 service->ResetFromCurrentBrowsers();
83 return service; 83 return service;
84 } 84 }
85 85
86 bool SessionServiceFactory::ServiceIsCreatedWithBrowserContext() const { 86 bool SessionServiceFactory::ServiceIsCreatedWithBrowserContext() const {
87 return true; 87 return true;
88 } 88 }
89 89
90 bool SessionServiceFactory::ServiceIsNULLWhileTesting() const { 90 bool SessionServiceFactory::ServiceIsNULLWhileTesting() const {
91 return true; 91 return true;
92 } 92 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service_factory.h ('k') | chrome/browser/sessions/tab_restore_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698