Reland "PaymentRequest: Fix a memory leak in retry()"
Reason for revert: A crash occurs because two animations runs in the same time. In the current implementation, the ViewStack class seems to be able to run only one animation per one time. So, before one animation finishes, if another animation runs, it might cause a crash. The ShowInitialPaymentSheet() doesn't make animation internally but the GoBackToPaymentSheet() do. So, after retry() calls, if shipping address or contact editor runs, it might cause a crash because two animations runs in the same time. To resolve this issue, this CL adds a parameter to GoBackToPaymentSheet() to control whether animation runs or not. If the `animate` parameter is false, just runs without animation. We don't need to run animation when retry() calls because the payment sheet is already hidden and the processing spinner is showing. Original change's description: > In the current implementation, memory leaks occur becuase the internal > view_stack_ for payment sheet grows incrementally whenver calling > retry(). So, this patch uses GoBackToPaymentSheet() instead of > ShowInitialPaymentSheet() in RetryDialog(). The method has a logic to > reduce stack's size internally. > > Bug: 861704 > Change-Id: I2cb94772485165d1fa96463f16f39edf20ccf7bc > Reviewed-on: https://chromium-review.googlesource.com/1255082 > Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org> > Commit-Queue: Jinho Bang <jinho.bang@samsung.com> > Cr-Commit-Position: refs/heads/master@{#595644} Bug: 861704 Change-Id: I5ab64423697aa11de97bf68ec9d9f262d7676bb5 Reviewed-on: https://chromium-review.googlesource.com/c/1258813Reviewed-by:Rouslan Solomakhin <rouslan@chromium.org> Commit-Queue: Jinho Bang <jinho.bang@samsung.com> Cr-Commit-Position: refs/heads/master@{#596232}
Showing
Please register or sign in to comment