Skip to content

Introduce safe checking whether DOMRefCell<T>.borrow_for_layout() is called from layout task - #3770

Closed
tetsuharuohzeki wants to merge 1 commit into
servo:masterfrom
tetsuharuohzeki:safe
Closed

tetsuharuohzeki wants to merge 1 commit into
servo:masterfrom
tetsuharuohzeki:safe

Conversation

@tetsuharuohzeki

Copy link
Copy Markdown
Contributor

Abstract

This pull request introduce these things for #3050:

  • dynamically check for DOMRefCell<T>.borrow_for_layout() method is only called from layout task.
  • dynamically check for DOMRefCell<T>.borrow***() methods are NOT called from layout task.

These approach do check dynamically whether methods can get a task local data if we call them on debug build.

Note

  • This should be merged into the tree after Use DOMRefCell in script crate #3737 was merged.
  • In the future, we might need to add some lint to forbid using normal RefCell<T> in script task. But this pull request does not include it.

@jdm

jdm commented Oct 22, 2014

Copy link
Copy Markdown
Member

Fantastic!

…called from layout task.

This also introduces that checking DOMRefCell<T>'s borrow methods are NOT
called from layout task.
@hoppipolla-critic-bot

Copy link
Copy Markdown

Critic review: https://critic.hoppipolla.co.uk/r/2946

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@kmcallister

Copy link
Copy Markdown
Contributor

I think I'll extend this to check access for GC tracing as well (see #3716)

@kmcallister

Copy link
Copy Markdown
Contributor

Hm, the other parts of servo use cfg(ndebug) and cfg(not(ndebug)).

@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

we'll migrate to #3797

@tetsuharuohzeki
tetsuharuohzeki deleted the safe branch October 24, 2014 02:49
bors-servo pushed a commit that referenced this pull request Oct 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants