Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement the entry global. #14840
Implement the entry global. #14840
Conversation
highfive
commented
Jan 4, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jan 4, 2017
|
r? @nox |
|
The code looks ok but I have many questions. |
| /// Returns the global scope from a JS global object. | ||
| #[allow(unsafe_code)] | ||
| pub unsafe fn from_global(global: *mut JSObject) -> Root<Self> { | ||
| global_scope_from_global(global) |
This comment has been minimized.
This comment has been minimized.
| fn drop(&mut self) { | ||
| let entry = STACK.with(|stack| { | ||
| let mut stack = stack.borrow_mut(); | ||
| stack.pop().unwrap() |
This comment has been minimized.
This comment has been minimized.
nox
Jan 5, 2017
Member
AutoEntryScript can move so these can be dropped out of order, I'm pretty sure that's not intended. Seems like we want something similar to rooted!, which would make the whole TLS stack useless AFAICT?
| /// Returns the ["entry"] global object. | ||
| /// | ||
| /// ["entry"]: https://html.spec.whatwg.org/multipage/#entry | ||
| pub fn entry_global() -> Root<GlobalScope> { |
This comment has been minimized.
This comment has been minimized.
nox
Jan 5, 2017
Member
Nit: could you make that a static method on AutoEntryScript? Less things to import that way.
| @@ -231,6 +232,7 @@ impl DedicatedWorkerGlobalScope { | |||
|
|
|||
| { | |||
| let _ar = AutoWorkerReset::new(&global, worker); | |||
| let _aes = AutoEntryScript::new(global.upcast()); | |||
This comment has been minimized.
This comment has been minimized.
nox
Jan 5, 2017
Member
Instead of manual RAII, can't we just call that in execute_script? Seems like just before it is the only call site you changed, no?
87a1c8e
to
0890a6e
|
This is good to go as far as I'm concerned. CC @jdm |
|
@bors-servo r=nox |
|
|
Implement the entry global. Partial fix for #10963. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14840) <!-- Reviewable:end -->
|
|
|
@bors-servo r=nox |
|
|
Implement the entry global. Partial fix for #10963. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14840) <!-- Reviewable:end -->
|
|
Ms2ger commentedJan 4, 2017
•
edited by larsbergstrom
Partial fix for #10963.
This change is