diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-11-12 08:08:38 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-12 08:08:38 -0600 |
commit | 579ab2d99cd8c07a31c3b68a4659c484d5189ada (patch) | |
tree | 23f80187ffd746437a86a5ece43775dc64785b4b /components/script/fetch.rs | |
parent | 2d0c7166f118efed9f25fbe7b4f01f9521829418 (diff) | |
parent | a39d1fa7d1b6119f4d86c11cc42728ce22bf1060 (diff) | |
download | servo-579ab2d99cd8c07a31c3b68a4659c484d5189ada.tar.gz servo-579ab2d99cd8c07a31c3b68a4659c484d5189ada.zip |
Auto merge of #13774 - KiChjang:event-source-constructor, r=jdm
Finish up the implementation of EventSource
Full implementation of EventSource, complete with closing and reopening streams.
Fixes #8925.
<!-- 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/13774)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/fetch.rs')
-rw-r--r-- | components/script/fetch.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/fetch.rs b/components/script/fetch.rs index ed1a66fc683..740099344bf 100644 --- a/components/script/fetch.rs +++ b/components/script/fetch.rs @@ -2,10 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use dom::bindings::codegen::Bindings::RequestBinding::RequestInfo; use dom::bindings::codegen::Bindings::RequestBinding::RequestInit; use dom::bindings::codegen::Bindings::ResponseBinding::ResponseBinding::ResponseMethods; use dom::bindings::codegen::Bindings::ResponseBinding::ResponseType as DOMResponseType; -use dom::bindings::codegen::UnionTypes::RequestOrUSVString; use dom::bindings::error::Error; use dom::bindings::js::Root; use dom::bindings::refcounted::{Trusted, TrustedPromise}; @@ -62,12 +62,13 @@ fn request_init_from_request(request: NetTraitsRequest) -> NetTraitsRequestInit referrer_policy: request.referrer_policy.get(), pipeline_id: request.pipeline_id.get(), redirect_mode: request.redirect_mode.get(), + ..NetTraitsRequestInit::default() } } // https://fetch.spec.whatwg.org/#fetch-method #[allow(unrooted_must_root)] -pub fn Fetch(global: &GlobalScope, input: RequestOrUSVString, init: &RequestInit) -> Rc<Promise> { +pub fn Fetch(global: &GlobalScope, input: RequestInfo, init: &RequestInit) -> Rc<Promise> { let core_resource_thread = global.core_resource_thread(); // Step 1 @@ -96,8 +97,8 @@ pub fn Fetch(global: &GlobalScope, input: RequestOrUSVString, init: &RequestInit })); let listener = NetworkListener { context: fetch_context, - script_chan: global.networking_task_source(), - wrapper: None, + task_source: global.networking_task_source(), + wrapper: Some(global.get_runnable_wrapper()) }; ROUTER.add_route(action_receiver.to_opaque(), box move |message| { |