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

Unified Diff: chrome/browser/android/banners/app_banner_manager.cc

Issue 942633002: Switch AppBannerManager on use of Unretained to use it's weakptr factory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/banners/app_banner_manager.cc
diff --git a/chrome/browser/android/banners/app_banner_manager.cc b/chrome/browser/android/banners/app_banner_manager.cc
index 56a954143f32a26ecbb06cbff117773e610d10ed..8da89910b030580d004918cecc061be37c969c67 100644
--- a/chrome/browser/android/banners/app_banner_manager.cc
+++ b/chrome/browser/android/banners/app_banner_manager.cc
@@ -138,11 +138,9 @@ void AppBannerManager::DidFinishLoad(
if (!validated_url_.SchemeIsSecure() && !gDisableSecureCheckForTesting)
return;
- // See if the page has a manifest. Using Unretained(this) here is safe as the
- // lifetime of this object extends beyond the lifetime of the web_contents(),
- // and when web_contents() is destroyed it will call OnDidGetManifest.
+ // See if the page has a manifest.
web_contents()->GetManifest(base::Bind(&AppBannerManager::OnDidGetManifest,
- base::Unretained(this)));
+ weak_factory_.GetWeakPtr()));
}
void AppBannerManager::OnDidGetManifest(const content::Manifest& manifest) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698