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

Issue 1494433003: Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (Closed)

Created:
5 years ago by varkha
Modified:
5 years ago
Reviewers:
Devlin, sadrul, bruthig
CC:
chromium-reviews, tfarina, bruthig
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost When a CustomButton that has an InkDropDelegate installed on it is deleted it needs to clear the InkDropDelegate first since the delegate may need to call methods on its host (which is the CustomButton that is being deleted). BUG=563358 Committed: https://crrev.com/8dcd56e004a9d3dcd269aaf95ffbb70ea1fb5f20 Cr-Commit-Position: refs/heads/master@{#363848}

Patch Set 1 #

Patch Set 2 : Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (corrections and test) #

Total comments: 8

Patch Set 3 : Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (comments) #

Total comments: 2

Patch Set 4 : Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (using ViewHierarchyChanged) #

Patch Set 5 : Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (restore to PS3) #

Total comments: 5

Patch Set 6 : Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (delegate owned by a leaf c… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -13 lines) Patch
M chrome/browser/ui/views/toolbar/toolbar_action_view.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/toolbar/toolbar_action_view.cc View 1 2 3 4 5 2 chunks +4 lines, -3 lines 0 comments Download
A ui/views/animation/ink_drop_delegate_unittest.cc View 1 2 3 4 5 1 chunk +113 lines, -0 lines 0 comments Download
M ui/views/controls/button/custom_button.h View 1 2 3 4 5 2 chunks +7 lines, -5 lines 0 comments Download
M ui/views/controls/button/custom_button.cc View 1 2 3 4 5 3 chunks +4 lines, -5 lines 0 comments Download
M ui/views/views.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 57 (20 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1494433003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1494433003/1
5 years ago (2015-12-02 20:18:11 UTC) #2
varkha
sadrul@, can you please take a look? I have traces that prove both the crash ...
5 years ago (2015-12-02 20:19:58 UTC) #4
sadrul
On 2015/12/02 20:19:58, varkha wrote: > sadrul@, can you please take a look? I have ...
5 years ago (2015-12-02 20:22:06 UTC) #5
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/130167)
5 years ago (2015-12-02 20:27:13 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1494433003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1494433003/60001
5 years ago (2015-12-03 03:56:20 UTC) #11
varkha
sadrul@, this has proven to be a bit more involving since the first solution was ...
5 years ago (2015-12-03 04:00:59 UTC) #12
bruthig
Drive by https://codereview.chromium.org/1494433003/diff/60001/ui/views/animation/ink_drop_delegate_unittest.cc File ui/views/animation/ink_drop_delegate_unittest.cc (right): https://codereview.chromium.org/1494433003/diff/60001/ui/views/animation/ink_drop_delegate_unittest.cc#newcode15 ui/views/animation/ink_drop_delegate_unittest.cc:15: // An InkDropDelegate that handles animations for ...
5 years ago (2015-12-03 04:11:35 UTC) #14
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/builds/74665)
5 years ago (2015-12-03 04:22:05 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1494433003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1494433003/80001
5 years ago (2015-12-03 19:19:52 UTC) #18
varkha
Talked about ASSERTs vs. EXPECTs offline. The 2 setup classes are essential parts of the ...
5 years ago (2015-12-03 19:20:43 UTC) #19
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-03 20:06:51 UTC) #21
bruthig
lgtm
5 years ago (2015-12-03 23:41:36 UTC) #22
varkha
sadrul@, ping?
5 years ago (2015-12-07 16:27:33 UTC) #23
sadrul
https://codereview.chromium.org/1494433003/diff/80001/ui/views/controls/button/custom_button.cc File ui/views/controls/button/custom_button.cc (right): https://codereview.chromium.org/1494433003/diff/80001/ui/views/controls/button/custom_button.cc#newcode61 ui/views/controls/button/custom_button.cc:61: DCHECK(!ink_drop_delegate_); It seems somewhat unfortunate to require the subclass ...
5 years ago (2015-12-07 18:04:17 UTC) #24
varkha
Is patch set #4 what you had in mind, sadrul@? https://codereview.chromium.org/1494433003/diff/80001/ui/views/controls/button/custom_button.cc File ui/views/controls/button/custom_button.cc (right): https://codereview.chromium.org/1494433003/diff/80001/ui/views/controls/button/custom_button.cc#newcode61 ...
5 years ago (2015-12-07 21:35:30 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1494433003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1494433003/100001
5 years ago (2015-12-07 21:41:08 UTC) #27
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/151751)
5 years ago (2015-12-07 23:01:35 UTC) #29
varkha
Looks like hierarchy change notification is not guaranteed. Sadrul@, would you research that or return ...
5 years ago (2015-12-08 01:36:06 UTC) #30
sadrul
Hrm, OK, yeah, let's go back to PS3 then. PS3 lgtm
5 years ago (2015-12-08 06:15:01 UTC) #31
varkha
+rdevlin.cronin for OWNERS in chrome/browser/ui/views/toolbar/toolbar_action_view.cc
5 years ago (2015-12-08 15:37:52 UTC) #33
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1494433003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1494433003/120001
5 years ago (2015-12-08 15:38:12 UTC) #35
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/167856)
5 years ago (2015-12-08 16:13:12 UTC) #37
Devlin
https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc File chrome/browser/ui/views/toolbar/toolbar_action_view.cc (right): https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc#newcode112 chrome/browser/ui/views/toolbar/toolbar_action_view.cc:112: SetInkDropDelegate(scoped_ptr<views::InkDropDelegate>()); Would it be better to move this to ...
5 years ago (2015-12-08 16:56:37 UTC) #38
varkha
https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc File chrome/browser/ui/views/toolbar/toolbar_action_view.cc (right): https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc#newcode112 chrome/browser/ui/views/toolbar/toolbar_action_view.cc:112: SetInkDropDelegate(scoped_ptr<views::InkDropDelegate>()); On 2015/12/08 16:56:37, Devlin wrote: > Would it ...
5 years ago (2015-12-08 17:09:15 UTC) #39
Devlin
https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc File chrome/browser/ui/views/toolbar/toolbar_action_view.cc (right): https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc#newcode112 chrome/browser/ui/views/toolbar/toolbar_action_view.cc:112: SetInkDropDelegate(scoped_ptr<views::InkDropDelegate>()); On 2015/12/08 17:09:15, varkha wrote: > On 2015/12/08 ...
5 years ago (2015-12-08 17:33:39 UTC) #40
varkha
PTAL, see if you prefer this version. https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc File chrome/browser/ui/views/toolbar/toolbar_action_view.cc (right): https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc#newcode112 chrome/browser/ui/views/toolbar/toolbar_action_view.cc:112: SetInkDropDelegate(scoped_ptr<views::InkDropDelegate>()); On ...
5 years ago (2015-12-08 19:00:51 UTC) #41
varkha
> We get a pure virtual when ~InkDropDelegate() is called in ~CustomButton. What actually happens ...
5 years ago (2015-12-08 19:09:26 UTC) #42
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1494433003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1494433003/140001
5 years ago (2015-12-08 19:11:04 UTC) #44
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/167969)
5 years ago (2015-12-08 19:40:43 UTC) #46
Devlin
https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc File chrome/browser/ui/views/toolbar/toolbar_action_view.cc (right): https://codereview.chromium.org/1494433003/diff/120001/chrome/browser/ui/views/toolbar/toolbar_action_view.cc#newcode112 chrome/browser/ui/views/toolbar/toolbar_action_view.cc:112: SetInkDropDelegate(scoped_ptr<views::InkDropDelegate>()); On 2015/12/08 19:00:50, varkha wrote: > On 2015/12/08 ...
5 years ago (2015-12-08 19:44:06 UTC) #47
varkha
We don't technically need to call reset() in dtor but we still get a call ...
5 years ago (2015-12-08 19:55:41 UTC) #48
Devlin
On 2015/12/08 19:55:41, varkha wrote: > We don't technically need to call reset() in dtor ...
5 years ago (2015-12-08 20:04:23 UTC) #49
varkha
> I might still have a slight preference for having the ToolbarActionView own the delegate... ...
5 years ago (2015-12-08 21:19:54 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1494433003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1494433003/140001
5 years ago (2015-12-08 21:22:04 UTC) #53
varkha
FTR I was also thinking of possibility of forcing dynamic allocation on CustomButton, Button or ...
5 years ago (2015-12-08 22:22:26 UTC) #54
commit-bot: I haz the power
Committed patchset #6 (id:140001)
5 years ago (2015-12-09 00:29:50 UTC) #55
commit-bot: I haz the power
5 years ago (2015-12-09 00:30:44 UTC) #57
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/8dcd56e004a9d3dcd269aaf95ffbb70ea1fb5f20
Cr-Commit-Position: refs/heads/master@{#363848}

Powered by Google App Engine
This is Rietveld 408576698