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

Unified Diff: ios/chrome/browser/passwords/update_password_infobar_controller.mm

Issue 2933833002: [iOS] Break retain cycle in InfoBars. (Closed)
Patch Set: Addressed comments. Created 3 years, 6 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: ios/chrome/browser/passwords/update_password_infobar_controller.mm
diff --git a/ios/chrome/browser/passwords/update_password_infobar_controller.mm b/ios/chrome/browser/passwords/update_password_infobar_controller.mm
index 656b3bb2f88bf4630890b2e793e8359657edceeb..ed3e4510bd4c9f9d0f8cb60379b06952f99c4d43 100644
--- a/ios/chrome/browser/passwords/update_password_infobar_controller.mm
+++ b/ios/chrome/browser/passwords/update_password_infobar_controller.mm
@@ -4,6 +4,7 @@
#import "ios/chrome/browser/passwords/update_password_infobar_controller.h"
+#include "base/ios/weak_nsobject.h"
#import "base/mac/objc_property_releaser.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
@@ -61,9 +62,10 @@ - (void)updateInfobarLabel:(InfoBarView*)view {
&messageText, 0, _delegate->selected_account(), usernameLink);
}
+ base::WeakNSObject<UpdatePasswordInfoBarController> weakSelf(self);
[view addLabel:base::SysUTF16ToNSString(messageText)
action:^(NSUInteger tag) {
- [self infobarLinkDidPress:tag];
+ [weakSelf infobarLinkDidPress:tag];
}];
}

Powered by Google App Engine
This is Rietveld 408576698