Commit d6a7a9af authored by Alfonso Garza's avatar Alfonso Garza Committed by Commit Bot

[AF] Fix crash on Card Name Fix Flow.

Crash was caused as the bridge's dealloc was calling OnDimissed on the
controller, which is meant to notify that the user explicitly dimissed
the dialog, instead of OnConfirmNameDialogCLosed. This in turn caused
the controller to retain the bridge even thought it had already been
deleted.


Change-Id: If47970e04aacf4ce1d628b5663f60835a7277378
Bug: 1013292
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1860981Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Alfonso Garza <alfonsogarza@google.com>
Auto-Submit: Alfonso Garza <alfonsogarza@google.com>
Cr-Commit-Position: refs/heads/master@{#706089}
parent bfcca558
......@@ -33,6 +33,9 @@ class CardNameFixFlowViewBridge : public CardNameFixFlowView {
// Called when the user confirms their name.
void OnConfirmedName(const base::string16& confirmed_name);
// Called when the user cancels the card name fix flow.
void OnDismissed();
// Closes the view.
void PerformClose();
......
......@@ -42,7 +42,7 @@ CardNameFixFlowViewBridge::CardNameFixFlowViewBridge(
CardNameFixFlowViewBridge::~CardNameFixFlowViewBridge() {
if (controller_)
controller_->OnDismissed();
controller_->OnConfirmNameDialogClosed();
}
void CardNameFixFlowViewBridge::Show() {
......@@ -71,6 +71,11 @@ void CardNameFixFlowViewBridge::OnConfirmedName(
PerformClose();
}
void CardNameFixFlowViewBridge::OnDismissed() {
controller_->OnDismissed();
PerformClose();
}
void CardNameFixFlowViewBridge::PerformClose() {
base::WeakPtr<CardNameFixFlowViewBridge> weakSelf =
weak_ptr_factory_.GetWeakPtr();
......@@ -220,7 +225,7 @@ void CardNameFixFlowViewBridge::DeleteSelf() {
#pragma mark - Private
- (void)onCancel:(id)sender {
_bridge->PerformClose();
_bridge->OnDismissed();
}
- (void)onConfirm:(id)sender {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment