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

Unified Diff: chrome/browser/ui/webui/help/version_updater_chromeos.cc

Issue 10409025: Use WeakPtr in VersionUpdaterCros for safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/help/version_updater_chromeos.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/help/version_updater_chromeos.cc
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.cc b/chrome/browser/ui/webui/help/version_updater_chromeos.cc
index 640a2fe833893e21eff4fc0663ae27ca435370de..1ebca5414a5d9fb2eed4b8d041b149b8b0354598 100644
--- a/chrome/browser/ui/webui/help/version_updater_chromeos.cc
+++ b/chrome/browser/ui/webui/help/version_updater_chromeos.cc
@@ -34,7 +34,8 @@ void VersionUpdaterCros::CheckForUpdate(const StatusCallback& callback) {
if (!WizardController::default_controller() ||
WizardController::IsDeviceRegistered()) {
update_engine_client->RequestUpdateCheck(
- base::Bind(&VersionUpdaterCros::OnUpdateCheck, base::Unretained(this)));
+ base::Bind(&VersionUpdaterCros::OnUpdateCheck,
+ weak_ptr_factory_.GetWeakPtr()));
}
}
@@ -60,10 +61,10 @@ void VersionUpdaterCros::GetReleaseChannel(const ChannelCallback& cb) {
// handler and ensure it does not get deleted before the callback.
update_engine_client->GetReleaseTrack(
base::Bind(&VersionUpdaterCros::UpdateSelectedChannel,
- base::Unretained(this)));
+ weak_ptr_factory_.GetWeakPtr()));
}
-VersionUpdaterCros::VersionUpdaterCros() {}
+VersionUpdaterCros::VersionUpdaterCros() : weak_ptr_factory_(this) {}
VersionUpdaterCros::~VersionUpdaterCros() {
UpdateEngineClient* update_engine_client =
« no previous file with comments | « chrome/browser/ui/webui/help/version_updater_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698