Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the constructor for EventSource #13666

Closed
wants to merge 1 commit into from

Conversation

@KiChjang
Copy link
Member

KiChjang commented Oct 10, 2016

Partial #8925.


This change is Reviewable

@highfive
Copy link

highfive commented Oct 10, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/eventsource.rs, components/script/dom/request.rs, components/script/fetch.rs
@highfive
Copy link

highfive commented Oct 10, 2016

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!
@KiChjang
Copy link
Member Author

KiChjang commented Oct 10, 2016

bors-servo added a commit that referenced this pull request Oct 10, 2016
Implement the constructor for EventSource

Partial #8925.
@bors-servo
Copy link
Contributor

bors-servo commented Oct 10, 2016

Trying commit 65c6dd4 with merge 345a9d5...

@bors-servo
Copy link
Contributor

bors-servo commented Oct 10, 2016

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 10, 2016

It's not clear to me why we'd want to create a js promise here at all.

@KiChjang
Copy link
Member Author

KiChjang commented Oct 10, 2016

How else would you fetch the request?

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 10, 2016

With all the usual infra, like you did for the script element.

@KiChjang
Copy link
Member Author

KiChjang commented Oct 10, 2016

An EventSource needs to have an associated Request object. I recall @jdm saying that we should store a dom::Request instead of a net_traits::Request, and by doing so, the straightforward way to fetch a dom::Request would be via dom::Fetch. I could instead make a function that transforms this dom::Request into a RequestInit, and then properly fetch it using the document_loader stuff, but if so, I think we're better off storing a RequestInit instead.

@KiChjang KiChjang force-pushed the KiChjang:event-source-constructor branch 2 times, most recently from 9064f32 to 13f5ce6 Oct 13, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Oct 13, 2016

Not sure if there's any value in merging just the EventSource constructor here, since it doesn't make any failing tests pass.

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 13, 2016

Agreed.

@Ms2ger Ms2ger closed this Oct 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.