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

Issue 1059383003: Make sure observers are not nullptr (Closed)

Created:
5 years, 8 months ago by oshima
Modified:
5 years, 8 months ago
Reviewers:
danakj, sadrul
CC:
chromium-reviews, tfarina, tdanderson+views_chromium.org, erikwright+watch_chromium.org, willchan no longer on Chromium
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make sure observers are not nullptr I believe there is no good reason to allow nullptr observer, and the bug seems to be hitting this. This is to catch such bug early. BUG=471649 Committed: https://crrev.com/8750dd91b2d1b9e48db1c97ca6cbb059d005991d Cr-Commit-Position: refs/heads/master@{#324299}

Patch Set 1 : #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Total comments: 3

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -14 lines) Patch
M base/observer_list.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M ui/gfx/display_change_notifier_unittest.cc View 2 chunks +0 lines, -14 lines 0 comments Download
M ui/views/widget/widget.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (7 generated)
oshima
Dana, can you review this? willchan@ may be the best person to review, but he's ...
5 years, 8 months ago (2015-04-03 23:07:41 UTC) #3
oshima
https://codereview.chromium.org/1059383003/diff/40001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/1059383003/diff/40001/base/observer_list.h#newcode157 base/observer_list.h:157: DCHECK(obs); This will most likely lead to crash, so ...
5 years, 8 months ago (2015-04-03 23:09:28 UTC) #4
danakj
Is the telemetry unittest failure this crashing? https://codereview.chromium.org/1059383003/diff/40001/base/observer_list.h File base/observer_list.h (right): https://codereview.chromium.org/1059383003/diff/40001/base/observer_list.h#newcode157 base/observer_list.h:157: DCHECK(obs); On ...
5 years, 8 months ago (2015-04-06 17:18:47 UTC) #5
oshima
On 2015/04/06 17:18:47, danakj wrote: > Is the telemetry unittest failure this crashing? 2nd try ...
5 years, 8 months ago (2015-04-06 20:25:37 UTC) #6
danakj
LGTM
5 years, 8 months ago (2015-04-06 21:33:32 UTC) #7
oshima
sadrul -> ui/views OWNERS
5 years, 8 months ago (2015-04-06 21:35:03 UTC) #9
oshima
On 2015/04/06 21:35:03, oshima wrote: > sadrul -> ui/views OWNERS sadrul: ping?
5 years, 8 months ago (2015-04-07 20:39:24 UTC) #10
sadrul
lgtm https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc#newcode392 ui/views/widget/widget.cc:392: // TODO(oshima): Remove this CHECK once crbug.com/471649 is ...
5 years, 8 months ago (2015-04-08 19:12:33 UTC) #12
oshima
https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc#newcode392 ui/views/widget/widget.cc:392: // TODO(oshima): Remove this CHECK once crbug.com/471649 is resolved. ...
5 years, 8 months ago (2015-04-08 19:17:11 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1059383003/80001
5 years, 8 months ago (2015-04-08 19:17:52 UTC) #17
danakj
https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc#newcode392 ui/views/widget/widget.cc:392: // TODO(oshima): Remove this CHECK once crbug.com/471649 is resolved. ...
5 years, 8 months ago (2015-04-08 20:03:45 UTC) #18
oshima
On 2015/04/08 20:03:45, danakj wrote: > https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc > File ui/views/widget/widget.cc (right): > > https://codereview.chromium.org/1059383003/diff/60001/ui/views/widget/widget.cc#newcode392 > ...
5 years, 8 months ago (2015-04-08 20:14:12 UTC) #19
danakj
On Wed, Apr 8, 2015 at 1:14 PM, <oshima@chromium.org> wrote: > On 2015/04/08 20:03:45, danakj ...
5 years, 8 months ago (2015-04-08 20:26:59 UTC) #20
oshima
On Wed, Apr 8, 2015 at 1:26 PM, Dana Jansens <danakj@chromium.org> wrote: > On Wed, ...
5 years, 8 months ago (2015-04-08 20:50:57 UTC) #21
sadrul
On 2015/04/08 20:50:57, oshima wrote: > On Wed, Apr 8, 2015 at 1:26 PM, Dana ...
5 years, 8 months ago (2015-04-08 21:01:28 UTC) #22
danakj
On Wed, Apr 8, 2015 at 2:01 PM, <sadrul@chromium.org> wrote: > On 2015/04/08 20:50:57, oshima ...
5 years, 8 months ago (2015-04-08 21:05:18 UTC) #23
oshima
On 2015/04/08 21:01:28, sadrul wrote: > On 2015/04/08 20:50:57, oshima wrote: > > On Wed, ...
5 years, 8 months ago (2015-04-08 21:09:08 UTC) #24
sadrul
On 2015/04/08 21:05:18, danakj wrote: > On Wed, Apr 8, 2015 at 2:01 PM, <mailto:sadrul@chromium.org> ...
5 years, 8 months ago (2015-04-08 21:20:42 UTC) #25
danakj
On Wed, Apr 8, 2015 at 2:20 PM, <sadrul@chromium.org> wrote: > On 2015/04/08 21:05:18, danakj ...
5 years, 8 months ago (2015-04-08 21:22:28 UTC) #26
commit-bot: I haz the power
Committed patchset #4 (id:80001)
5 years, 8 months ago (2015-04-08 22:58:01 UTC) #27
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/8750dd91b2d1b9e48db1c97ca6cbb059d005991d Cr-Commit-Position: refs/heads/master@{#324299}
5 years, 8 months ago (2015-04-08 22:58:57 UTC) #28
oshima
5 years, 8 months ago (2015-04-08 23:17:32 UTC) #29
Message was sent while issue was closed.
Okay, I'll remove it once this is fixed. We can revisit when we've got more
similar reports after fix.

On Wed, Apr 8, 2015 at 2:22 PM, Dana Jansens <danakj@chromium.org> wrote:

> On Wed, Apr 8, 2015 at 2:20 PM, <sadrul@chromium.org> wrote:
>
>> On 2015/04/08 21:05:18, danakj wrote:
>>
>>  On Wed, Apr 8, 2015 at 2:01 PM, <mailto:sadrul@chromium.org> wrote:
>>>
>>
>>  > On 2015/04/08 20:50:57, oshima wrote:
>>> >
>>> >> On Wed, Apr 8, 2015 at 1:26 PM, Dana Jansens <mailto:
>>> danakj@chromium.org>
>>> >>
>>> > wrote:
>>> >
>>> >  > On Wed, Apr 8, 2015 at 1:14 PM, <mailto:oshima@chromium.org> wrote:
>>> >> >
>>> >> >> On 2015/04/08 20:03:45, danakj wrote:
>>> >> >>
>>> >> >> https://codereview.chromium.org/1059383003/diff/60001/ui/
>>> >> >> views/widget/widget.cc
>>> >> >>
>>> >> >>> File ui/views/widget/widget.cc (right):
>>> >> >>>
>>> >> >>
>>> >> >>
>>> >> >> https://codereview.chromium.org/1059383003/diff/60001/ui/
>>> >> >> views/widget/widget.cc#newcode392
>>> >> >>
>>> >> >>> ui/views/widget/widget.cc:392: // TODO(oshima): Remove this CHECK
>>> once
>>> >> >>> crbug.com/471649 is resolved.
>>> >> >>> On 2015/04/08 19:17:10, oshima wrote:
>>> >> >>> > On 2015/04/08 19:12:33, sadrul wrote:
>>> >> >>> > > I actually like this check. Maybe just always keep it and
>>> remove
>>> >> the
>>> >> >>> TODO?
>>> >> >>> >
>>> >> >>> > Sure. I just updated the comment to give more context.
>>> >> >>>
>>> >> >>
>>> >> >>  Why CHECK instead of DCHECK? It adds code/strings to the binary we
>>> >> ship.
>>> >> >>>
>>> >> >>
>>> >> >> This has to be CHECK now to diagnose the issue. I don't have strong
>>> >> >> opinion if
>>> >> >> we should remove this after that.
>>> >> >>
>>> >> >
>>> >> > Ya, I'm wondering about after we resolve the bug. I don't think
>>> there's
>>> >> a
>>> >> > reason to ship CHECKs most of the time.
>>> >> >
>>> >>
>>> >
>>> >  sadrul, what's your opinion?
>>> >>
>>> >
>>> > I suppose the dchecks in ObserverListBase would be equivalent if we do
>>> > dcheck
>>> > here too (and so we don't need this dcheck in widget), but presumably,
>>> that
>>> > wouldn't have caught this particular issue?
>>> >
>>>
>>
>>  My thought is: It would in a debug build/on the bots, which may very well
>>> have been enough. If crashes make it past DCHECKs, you figure out the
>>> crash, write a unit test, and put it back to a DCHECK state. CHECKs "just
>>> in case" lead to binary bloat without a strong value proposition most of
>>> the time.
>>>
>>
>>  If you really like you can keep the CHECK, but I want to push back
>>> against
>>> it, I think we have a bad practice of using CHECKs when we don't need to
>>> in
>>> general.
>>>
>>
>> I agree with all of this.
>>
>>  ... If crashes make it past DCHECKs, you figure out the
>>> crash, ...
>>>
>>
>> This is the step that requires the CHECKs, and I want to avoid having to
>> do this
>> add/remove too often. But I suppose we can keep the CHECK iff it does
>> happen
>> often enough. So I am OK with removing the CHECK for now once the
>> mentioned bug
>> is fixed.
>>
>
> I agree, if it's a super frequent problem we could consider changing it to
> CHECK in ObserverListBase.
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698