Yesterday was Labor Day, so we celebrated it by not working! Woohoo! Malisa is traveling back today, so I (Jeena) worked alone today.
Things we did:
- Promise in Fetch
- jdm is back! He rebased his promises branch!
The rust compiler still panics instead of throwing error as it uses the older rust version, but that’s ok! I can work around it. - It turns out there’s a lot more to do with implementing promise in
fetchso I spent the day trying to understand what I need to do. Roughly, there are two things I can do:- figure out how to reject/resolve Promise in
fetch.Promise::maybe_resolve_nativeis probably a better choice thanPromise::maybe_resolvebecause they take regular DOM objects. This seems partially dependent on the next thing. - implement
FetchResponseListenerinfetch.rs. This turns out to have a lot more pre-requisite infrastructure!fetch.rsneeds aFetchContextstruct that will store the intermediate fetch.XMLHttpRequestis done very similarly tofetch, so I should look into how XHR is implemented in Servo. How XHR implementsFetchResponseListeneris here.
- figure out how to reject/resolve Promise in
- jdm is back! He rebased his promises branch!
Things we learned:
- jdm drew a great diagram describing how
XMLHttpRequestinteracts with resource thread andXHRContext - Promise doesn’t have to be rooted! Whaaaat. jdm says “Rc
would usually be unsafe but Promise is designed in such a way that it's safe, whereas Rooted would be incorrect." Whaaaat? I don't even understand! We'll find out the reason later...
TODO:
- Promise in Fetch
- make
FetchContextstruct -
Impl FetchResponseListener for FetchContext(may require helper functions) - resolve/reject promise in fetch
- make