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

Unified Diff: chrome/browser/password_manager/password_store_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/password_manager/password_store_factory.cc
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index a143c28ade0060238de2d7da5ee172954d82b450..e70b1cf8d3d16d613c270da1ff20434282a09389 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/environment.h"
#include "chrome/browser/password_manager/login_database.h"
+#include "chrome/browser/password_manager/password_store.h"
#include "chrome/browser/password_manager/password_store_default.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile_dependency_manager.h"
@@ -40,7 +41,7 @@ const LocalProfileId kInvalidLocalProfileId =
} // namespace
#endif
-PasswordStore* PasswordStoreFactory::GetForProfile(
+scoped_refptr<PasswordStore> PasswordStoreFactory::GetForProfile(
Profile* profile,
Profile::ServiceAccessType sat) {
if (sat == Profile::IMPLICIT_ACCESS && profile->IsOffTheRecord()) {
@@ -48,8 +49,8 @@ PasswordStore* PasswordStoreFactory::GetForProfile(
return NULL;
}
- return static_cast<PasswordStore*>(GetInstance()->GetBaseForProfile(
- profile, true));
+ return static_cast<PasswordStore*>(
+ GetInstance()->GetServiceForProfile(profile, true).get());
}
// static
@@ -91,8 +92,8 @@ LocalProfileId PasswordStoreFactory::GetLocalProfileId(
}
#endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX)
-RefcountedProfileKeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
- Profile* profile) const {
+scoped_refptr<RefcountedProfileKeyedService>
+PasswordStoreFactory::BuildServiceInstanceFor(Profile* profile) const {
scoped_refptr<PasswordStore> ps;
FilePath login_db_file_path = profile->GetPath();
login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName);
@@ -185,7 +186,7 @@ RefcountedProfileKeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
return NULL;
}
- return ps.release();
+ return ps;
}
void PasswordStoreFactory::RegisterUserPrefs(PrefService* prefs) {
« no previous file with comments | « chrome/browser/password_manager/password_store_factory.h ('k') | chrome/browser/password_manager/password_store_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698