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

Unified Diff: chrome/browser/plugin_prefs_factory.cc

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/plugin_prefs_factory.cc
diff --git a/chrome/browser/plugin_prefs_factory.cc b/chrome/browser/plugin_prefs_factory.cc
index 804caa0f0b50ed645604edc05f041e3b4707e6d2..b43be37b455985e51292f272ec223045df8bf748 100644
--- a/chrome/browser/plugin_prefs_factory.cc
+++ b/chrome/browser/plugin_prefs_factory.cc
@@ -19,13 +19,17 @@ PluginPrefsFactory* PluginPrefsFactory::GetInstance() {
}
// static
-ProfileKeyedBase* PluginPrefsFactory::CreatePrefsForProfile(
+scoped_refptr<PluginPrefs> PluginPrefsFactory::GetPrefsForProfile(
Profile* profile) {
- return GetInstance()->BuildServiceInstanceFor(profile);
+ return static_cast<PluginPrefs*>(
+ GetInstance()->GetServiceForProfile(profile, true).get());
}
-PluginPrefs* PluginPrefsFactory::GetPrefsForProfile(Profile* profile) {
- return static_cast<PluginPrefs*>(GetBaseForProfile(profile, true));
+// static
+scoped_refptr<RefcountedProfileKeyedService>
+PluginPrefsFactory::CreateForTestingProfile(Profile* profile) {
+ return static_cast<PluginPrefs*>(
+ GetInstance()->BuildServiceInstanceFor(profile).get());
}
PluginPrefsFactory::PluginPrefsFactory()
@@ -35,9 +39,9 @@ PluginPrefsFactory::PluginPrefsFactory()
PluginPrefsFactory::~PluginPrefsFactory() {}
-RefcountedProfileKeyedService* PluginPrefsFactory::BuildServiceInstanceFor(
- Profile* profile) const {
- PluginPrefs* plugin_prefs = new PluginPrefs();
+scoped_refptr<RefcountedProfileKeyedService>
+PluginPrefsFactory::BuildServiceInstanceFor(Profile* profile) const {
+ scoped_refptr<PluginPrefs> plugin_prefs(new PluginPrefs());
plugin_prefs->set_profile(profile->GetOriginalProfile());
plugin_prefs->SetPrefs(profile->GetPrefs());
return plugin_prefs;
« no previous file with comments | « chrome/browser/plugin_prefs_factory.h ('k') | chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698