Index: chrome/browser/sessions/session_service.cc |
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc |
index 7b36c75f8efd9c0ec30384b0a6491f74536022c3..0a0ac5a6c65288e31cfe8a539c92e909cc807a2e 100644 |
--- a/chrome/browser/sessions/session_service.cc |
+++ b/chrome/browser/sessions/session_service.cc |
@@ -234,7 +234,8 @@ SessionService::SessionService(Profile* profile) |
save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)), |
save_delay_in_mins_(base::TimeDelta::FromMinutes(10)), |
save_delay_in_hrs_(base::TimeDelta::FromHours(8)), |
- force_browser_not_alive_with_no_windows_(false) { |
+ force_browser_not_alive_with_no_windows_(false), |
+ weak_factory_(this) { |
Init(); |
} |
@@ -245,7 +246,8 @@ SessionService::SessionService(const base::FilePath& save_path) |
save_delay_in_millis_(base::TimeDelta::FromMilliseconds(2500)), |
save_delay_in_mins_(base::TimeDelta::FromMinutes(10)), |
save_delay_in_hrs_(base::TimeDelta::FromHours(8)), |
- force_browser_not_alive_with_no_windows_(false) { |
+ force_browser_not_alive_with_no_windows_(false), |
+ weak_factory_(this) { |
Init(); |
} |
@@ -571,7 +573,7 @@ base::CancelableTaskTracker::TaskId SessionService::GetLastSession( |
// the callback. |
return ScheduleGetLastSessionCommands( |
base::Bind(&SessionService::OnGotSessionCommands, |
- base::Unretained(this), callback), |
+ weak_factory_.GetWeakPtr(), callback), |
tracker); |
} |