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

Issue 2926413004: Cancel dialogs for Tabs when they are removed from their TabModels. (Closed)

Created:
3 years, 6 months ago by kkhorimoto
Modified:
3 years, 6 months ago
CC:
chromium-reviews, marq+watch_chromium.org, ios-reviews+chrome_chromium.org, noyau+watch_chromium.org, ios-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Cancel dialogs for Tabs when they are removed from their TabModels. A WebState attempts to cancel its dialogs in its destructor. However, the BVC uninstalls itself as the WebStateDelegate before the WebState is deallocated, so the WebStateImpl doesn't have access to its JavaScriptDialogPresenter to handle the cancellation. This CL adds a call to |-cancelDialogForWebState:| when the delegates are uninstalled for a Tab to ensure that alerts aren't queued in the DialogPresenter for WebStates that have been deallocated. BUG=720778 Review-Url: https://codereview.chromium.org/2926413004 Cr-Commit-Position: refs/heads/master@{#478729} Committed: https://chromium.googlesource.com/chromium/src/+/496fdd75e503c044babb47801e772c7255da94fa

Patch Set 1 #

Total comments: 1

Patch Set 2 : Allow cancelling the presented dialog #

Patch Set 3 : Revert to patch #1; DCHECK fix is non-essential and will be in follow-up CL #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M ios/chrome/browser/ui/browser_view_controller.mm View 1 chunk +3 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 22 (8 generated)
kkhorimoto
3 years, 6 months ago (2017-06-09 20:28:58 UTC) #2
kkhorimoto
+ Rohit, so we can land this faster
3 years, 6 months ago (2017-06-09 23:39:44 UTC) #4
kkhorimoto
3 years, 6 months ago (2017-06-09 23:49:16 UTC) #6
sdefresne
lgtm with a question https://codereview.chromium.org/2926413004/diff/1/ios/chrome/browser/ui/browser_view_controller.mm File ios/chrome/browser/ui/browser_view_controller.mm (right): https://codereview.chromium.org/2926413004/diff/1/ios/chrome/browser/ui/browser_view_controller.mm#newcode4636 ios/chrome/browser/ui/browser_view_controller.mm:4636: [self.dialogPresenter cancelDialogForWebState:tab.webState]; There is the ...
3 years, 6 months ago (2017-06-10 16:43:40 UTC) #7
frankzamorano350
3 years, 6 months ago (2017-06-10 17:11:59 UTC) #9
rohitrao (ping after 24h)
lgtm Seems reasonable to remove the dialogs at the same time that we uninstall the ...
3 years, 6 months ago (2017-06-12 12:33:34 UTC) #10
sdefresne
On 2017/06/12 12:33:34, rohitrao (ping after 24h) wrote: > lgtm > > Seems reasonable to ...
3 years, 6 months ago (2017-06-12 12:41:28 UTC) #11
marq (ping after 24h)
lgtm
3 years, 6 months ago (2017-06-12 17:35:25 UTC) #12
kkhorimoto
Sylvain: You're right, there's nothing preventing the currently-presented dialog from being cancelled. For example, if ...
3 years, 6 months ago (2017-06-12 19:05:54 UTC) #13
kkhorimoto
Reverted to patch #1 after offline discussion with Rohit. Patch #2 will be uploaded as ...
3 years, 6 months ago (2017-06-12 19:24:44 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2926413004/40001
3 years, 6 months ago (2017-06-12 19:25:39 UTC) #17
rohitrao (ping after 24h)
There's a substantial amount of additional code in patchset #2 -- I'm wary of landing ...
3 years, 6 months ago (2017-06-12 19:26:00 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/496fdd75e503c044babb47801e772c7255da94fa
3 years, 6 months ago (2017-06-12 19:56:49 UTC) #21
sdefresne
3 years, 6 months ago (2017-06-13 09:57:19 UTC) #22
Message was sent while issue was closed.
I agree with rohitrao that we should only land patchset #1 on M59 (to get back
to the state that M58 was).

Powered by Google App Engine
This is Rietveld 408576698