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

Issue 1567103005: Replace base::CallbackList with base::ObserverList in CastConfigDelegate (Closed)

Created:
4 years, 11 months ago by jdufault
Modified:
4 years, 11 months ago
CC:
chromium-reviews, kalyank, sadrul
Base URL:
https://chromium.googlesource.com/chromium/src.git@lkgr
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace base::CallbackList with base::ObserverList in CastConfigDelegate base::CallbackList::Observer invoked a destructor inside of TrayCast. Due to wonky deinitialization order between the system tray delegate and the status area, this caused a crash. base::ObserverList deinitialization is more easily controlled than base::CallbackList. Switch to that so we don't deinitialize the observer if it's already been removed. Fixing the deinitialization order between the system tray delegate and the status area is the correct fix, but it will take significantly more time and needs to be thoroughly tested. BUG=574874 Committed: https://crrev.com/6b717bb1e3bed46518e5410fbf80683114cdcb69 Cr-Commit-Position: refs/heads/master@{#369508}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Remove subscription, support at most one listener #

Patch Set 3 : Replace with ObserverList instead of base::Callback #

Total comments: 12

Patch Set 4 : Fix compilation and address comments #

Patch Set 5 : Add DLL export to fix windows build #

Total comments: 27

Patch Set 6 : Address feedback #

Patch Set 7 : Add DISALLOW_ASSIGN to Observer #

Total comments: 3

Patch Set 8 : Add TODO for proper fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -70 lines) Patch
M ash/cast_config_delegate.h View 1 2 3 4 5 6 4 chunks +16 lines, -12 lines 0 comments Download
M ash/system/cast/tray_cast.h View 1 2 3 4 5 4 chunks +9 lines, -10 lines 0 comments Download
M ash/system/cast/tray_cast.cc View 1 2 3 4 5 6 7 7 chunks +26 lines, -17 lines 0 comments Download
M ash/test/tray_cast_test_api.cc View 1 2 3 4 5 2 chunks +12 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.h View 1 2 3 3 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.cc View 1 2 1 chunk +10 lines, -5 lines 0 comments Download
M chrome/browser/ui/ash/cast_config_delegate_chromeos.h View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/cast_config_delegate_chromeos.cc View 1 2 3 4 5 2 chunks +12 lines, -7 lines 0 comments Download
M chrome/browser/ui/ash/cast_config_delegate_media_router.h View 1 2 3 4 5 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/ash/cast_config_delegate_media_router.cc View 1 2 3 4 5 3 chunks +12 lines, -7 lines 0 comments Download

Messages

Total messages: 51 (19 generated)
jdufault
Oshima, PTAL. This should be what we discussed. achuith@ for FYI, since this is causing ...
4 years, 11 months ago (2016-01-09 00:29:56 UTC) #3
oshima
https://codereview.chromium.org/1567103005/diff/1/ash/shell.cc File ash/shell.cc (right): https://codereview.chromium.org/1567103005/diff/1/ash/shell.cc#newcode732 ash/shell.cc:732: // Destroy SystemTrayDelegate before destroying the status area(s). Make ...
4 years, 11 months ago (2016-01-09 01:05:11 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1567103005/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1567103005/1
4 years, 11 months ago (2016-01-11 20:52:17 UTC) #6
jdufault
https://codereview.chromium.org/1567103005/diff/1/ash/shell.cc File ash/shell.cc (right): https://codereview.chromium.org/1567103005/diff/1/ash/shell.cc#newcode732 ash/shell.cc:732: // Destroy SystemTrayDelegate before destroying the status area(s). Make ...
4 years, 11 months ago (2016-01-11 20:59:34 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/150617)
4 years, 11 months ago (2016-01-11 21:26:58 UTC) #9
oshima
On 2016/01/11 20:59:34, jdufault wrote: > https://codereview.chromium.org/1567103005/diff/1/ash/shell.cc > File ash/shell.cc (right): > > https://codereview.chromium.org/1567103005/diff/1/ash/shell.cc#newcode732 > ...
4 years, 11 months ago (2016-01-11 21:58:22 UTC) #10
jdufault
bshe@ / stevenjb@, the deinitialization order for TrayCast (part of the status area) is causing ...
4 years, 11 months ago (2016-01-12 00:21:09 UTC) #12
stevenjb
Unfortunately, SystemTrayDelegateChromeOS has become a catch-all for Chrome specific Ash code. Despite some efforts to ...
4 years, 11 months ago (2016-01-12 01:06:58 UTC) #13
jdufault
oshima@/achuith@, PTAL. Given that this fix needs to be merged into m48, I've worked around ...
4 years, 11 months ago (2016-01-12 21:20:35 UTC) #15
stevenjb
This seems awkward. Why not define an Observer and use an ObserverList?
4 years, 11 months ago (2016-01-12 22:19:26 UTC) #16
jdufault
On 2016/01/12 22:19:26, stevenjb wrote: > This seems awkward. Why not define an Observer and ...
4 years, 11 months ago (2016-01-12 22:33:00 UTC) #17
jdufault
On 2016/01/12 22:19:26, stevenjb wrote: > This seems awkward. Why not define an Observer and ...
4 years, 11 months ago (2016-01-12 23:00:38 UTC) #19
stevenjb
https://codereview.chromium.org/1567103005/diff/40001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/40001/ash/cast_config_delegate.h#newcode80 ash/cast_config_delegate.h:80: Typically an observer class with only one or two ...
4 years, 11 months ago (2016-01-12 23:31:50 UTC) #20
jdufault
https://codereview.chromium.org/1567103005/diff/40001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/40001/ash/cast_config_delegate.h#newcode80 ash/cast_config_delegate.h:80: On 2016/01/12 23:31:49, stevenjb wrote: > Typically an observer ...
4 years, 11 months ago (2016-01-12 23:59:22 UTC) #21
stevenjb
lgtm
4 years, 11 months ago (2016-01-13 00:06:03 UTC) #22
achuithb
WallpaperManagerBrowserTest.DisplayChange seems to be a real failure. https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h#newcode12 ash/cast_config_delegate.h:12: #include "base/callback.h" ...
4 years, 11 months ago (2016-01-13 09:21:25 UTC) #23
jdufault
On 2016/01/13 09:21:25, achuithb wrote: > WallpaperManagerBrowserTest.DisplayChange seems to be a real failure. I'm unable ...
4 years, 11 months ago (2016-01-13 19:43:26 UTC) #24
stevenjb
https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h#newcode77 ash/cast_config_delegate.h:77: virtual ~Observer() {} On 2016/01/13 19:43:26, jdufault wrote: > ...
4 years, 11 months ago (2016-01-13 20:02:18 UTC) #25
achuithb
https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h#newcode77 ash/cast_config_delegate.h:77: virtual ~Observer() {} On 2016/01/13 20:02:18, stevenjb wrote: > ...
4 years, 11 months ago (2016-01-13 21:08:33 UTC) #26
jdufault
https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/80001/ash/cast_config_delegate.h#newcode81 ash/cast_config_delegate.h:81: }; On 2016/01/13 21:08:33, achuithb wrote: > On 2016/01/13 ...
4 years, 11 months ago (2016-01-13 22:02:23 UTC) #27
achuithb
https://codereview.chromium.org/1567103005/diff/120001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/120001/ash/cast_config_delegate.h#newcode83 ash/cast_config_delegate.h:83: DISALLOW_ASSIGN(Observer); Isn't DISALLOW_COPY_AND_ASSIGN better here?
4 years, 11 months ago (2016-01-13 22:05:44 UTC) #28
achuithb
lgtm regardless
4 years, 11 months ago (2016-01-13 22:06:04 UTC) #29
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1567103005/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1567103005/120001
4 years, 11 months ago (2016-01-13 22:07:32 UTC) #31
jdufault
rockot@, PTAL. I need owner lgtm in chrome/browser/extensions/api/cast_devices_private/*, thanks! https://codereview.chromium.org/1567103005/diff/120001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/120001/ash/cast_config_delegate.h#newcode83 ash/cast_config_delegate.h:83: ...
4 years, 11 months ago (2016-01-13 22:12:14 UTC) #33
achuithb
lgtm https://codereview.chromium.org/1567103005/diff/120001/ash/cast_config_delegate.h File ash/cast_config_delegate.h (right): https://codereview.chromium.org/1567103005/diff/120001/ash/cast_config_delegate.h#newcode83 ash/cast_config_delegate.h:83: DISALLOW_ASSIGN(Observer); On 2016/01/13 22:12:14, jdufault wrote: > On ...
4 years, 11 months ago (2016-01-13 22:19:27 UTC) #34
Ken Rockot(use gerrit already)
rs lgtm
4 years, 11 months ago (2016-01-13 22:22:02 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1567103005/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1567103005/120001
4 years, 11 months ago (2016-01-13 23:01:03 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1567103005/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1567103005/120001
4 years, 11 months ago (2016-01-14 18:41:33 UTC) #42
oshima
lgtm
4 years, 11 months ago (2016-01-14 18:54:28 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1567103005/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1567103005/140001
4 years, 11 months ago (2016-01-14 18:56:02 UTC) #47
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 11 months ago (2016-01-14 19:39:04 UTC) #49
commit-bot: I haz the power
4 years, 11 months ago (2016-01-14 19:41:23 UTC) #51
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/6b717bb1e3bed46518e5410fbf80683114cdcb69
Cr-Commit-Position: refs/heads/master@{#369508}

Powered by Google App Engine
This is Rietveld 408576698