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

Unified Diff: chrome/browser/ui/webui/settings/profile_info_handler.cc

Issue 2629083002: MD Settings: fix crash from strongly bound handler that goes away (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/webui/settings/profile_info_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/profile_info_handler.cc
diff --git a/chrome/browser/ui/webui/settings/profile_info_handler.cc b/chrome/browser/ui/webui/settings/profile_info_handler.cc
index 48bfbed68c44ac7f0ba73766821c01785ed372a2..cd7151484ffe2892d7a04d3204c2dbe0d86353bc 100644
--- a/chrome/browser/ui/webui/settings/profile_info_handler.cc
+++ b/chrome/browser/ui/webui/settings/profile_info_handler.cc
@@ -44,7 +44,8 @@ ProfileInfoHandler::ProfileInfoHandler(Profile* profile)
#if defined(OS_CHROMEOS)
user_manager_observer_(this),
#endif
- profile_observer_(this) {
+ profile_observer_(this),
+ weak_ptr_factory_(this) {
#if defined(OS_CHROMEOS)
// Set up the chrome://userimage/ source.
content::URLDataSource::Add(profile,
@@ -133,7 +134,7 @@ void ProfileInfoHandler::HandleGetProfileStats(const base::ListValue* args) {
// (e.g., |item.success| is false). Therefore, query the actual statistics.
ProfileStatisticsFactory::GetForProfile(profile_)->GatherStatistics(
base::Bind(&ProfileInfoHandler::PushProfileStatsCount,
- base::Unretained(this)));
+ weak_ptr_factory_.GetWeakPtr()));
}
void ProfileInfoHandler::PushProfileStatsCount(
« no previous file with comments | « chrome/browser/ui/webui/settings/profile_info_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698