Skip to content

Use DOMRefCell in script crate - #3737

Merged
bors-servo merged 14 commits into
servo:masterfrom
tetsuharuohzeki:cell
Oct 22, 2014
Merged

bors-servo merged 14 commits into
servo:masterfrom
tetsuharuohzeki:cell

Conversation

@tetsuharuohzeki

Copy link
Copy Markdown
Contributor

#3050

Altough LayoutDataRef is touched from layout, we don't use DOMRefCell in it becasuse
it's expected to manipulate in layout task.

@hoppipolla-critic-bot

Copy link
Copy Markdown

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

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.

@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

I have not converted yet XMLHttpRequest, URLSearchParams, ServoHTMLParser, Page, ScriptTask, and TimerManager. I thought that it's might be very rare cases that they're touched from layout task, thus it's should be checked in code review process.

Should we use DOMRefCell in them for checking unsafe borrowing at all points?

@jdm

jdm commented Oct 20, 2014

Copy link
Copy Markdown
Member

@saneyuki I think we should. In the future I'd like to add a lint to disallow RefCell in the script crate.

@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

@jdm ok. I'll push their patches.

@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

After merge this, I'll open the pull request which introduce dynamic checking about borrowing.

@jdm

jdm commented Oct 20, 2014

Copy link
Copy Markdown
Member

Thanks!

bors-servo pushed a commit that referenced this pull request Oct 21, 2014
#3050

Altough LayoutDataRef is touched from layout, we don't use DOMRefCell in it becasuse
it's expected to manipulate in layout task.
bors-servo pushed a commit that referenced this pull request Oct 21, 2014
#3050

Altough LayoutDataRef is touched from layout, we don't use DOMRefCell in it becasuse
it's expected to manipulate in layout task.
@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

I feel the last bors build error is similar to the one which we encounter in #3742.

Perhaps the previous base commit might have some latent issues, so I rebased this changeset on a latest master now.

bors-servo pushed a commit that referenced this pull request Oct 22, 2014
#3050

Altough LayoutDataRef is touched from layout, we don't use DOMRefCell in it becasuse
it's expected to manipulate in layout task.
@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

In this pull request, I replaced almost RefCell<T> to DOMRefCell<T>, but I didn't add to use DOMRefCell<T>.borrow_for_layout(). So it will use only parts of RefCell<T> embed in the new type, I think it will not cause any side effects...

@jdm

jdm commented Oct 22, 2014

Copy link
Copy Markdown
Member

Yes, I don't believe any of the members being changed should be in use by the layout task.

bors-servo pushed a commit that referenced this pull request Oct 22, 2014
#3050

Altough LayoutDataRef is touched from layout, we don't use DOMRefCell in it becasuse
it's expected to manipulate in layout task.
@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

Can only reviewers command to build to bors?

@jdm

jdm commented Oct 22, 2014

Copy link
Copy Markdown
Member

Yeah :/

@tetsuharuohzeki

Copy link
Copy Markdown
Contributor Author

😢

bors-servo pushed a commit that referenced this pull request Oct 22, 2014
#3050

Altough LayoutDataRef is touched from layout, we don't use DOMRefCell in it becasuse
it's expected to manipulate in layout task.
@bors-servo bors-servo closed this Oct 22, 2014
@bors-servo
bors-servo merged commit f1c840d into servo:master Oct 22, 2014
@tetsuharuohzeki
tetsuharuohzeki deleted the cell branch October 22, 2014 14:33
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