New issue
Advanced search Search tips

Issue 649479 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Task



Sign in to add a comment

make Frame::Settings() always non-null

Project Member Reported by skobes@chromium.org, Sep 22 2016

Issue description

Frame::settings() is marked "can be null", which leads to a lot of cumbersome null checks and confusion about when they are needed.

We should fix Frame::settings() to never return null.  I think we can just make Settings garbage-collected, like Frame and Page are already?
 

Comment 1 by dcheng@chromium.org, Sep 23 2016

We'd have to make the Settings object shared directly as well: the problem is it lives on Page/FrameHost, so Frame gets to it via its Page/FrameHost. However, Frame::detach() clears the m_host pointer, so the Frame no longer has a way of getting to the Settings object.

Fixing this would be valuable: we currently have code like https://chromium.googlesource.com/chromium/src/+blame/master/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp#298 where one developer read the comment and another didn't, so one line null checks even though the prior line unconditionally dereferences =)

However, one potentially tricky thing to consider: what should happen if code tries to change settings for a detached frame? It'd still point to the shared Settings object. I feel like this should be a programming error as well, but I'm not sure how we'd catch it.

Comment 2 by skobes@chromium.org, Sep 23 2016

Yeah the Frame should hold a Member<Settings> so that it can access the settings when m_host is null.  But it would still be shared, i.e. one Settings per Page.  Why should be an error for a detached frame to change settings?

Comment 3 by kojii@chromium.org, Sep 26 2016

Components: -Blink Blink>HTML>Frame
Labels: OS-All
Project Member

Comment 4 by sheriffbot@chromium.org, Sep 26 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by tkent@chromium.org, Sep 28 2017

Cc: -esprehn@chromium.org
Components: -Blink>HTML>Frame Blink>Internals>Frames
Labels: -Type-Bug -Hotlist-Recharge-Cold Type-Task
Status: Available (was: Untriaged)
Summary: make Frame::Settings() always non-null (was: make Frame::settings() always non-null)
Project Member

Comment 6 by sheriffbot@chromium.org, Sep 28

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment