Update crossbeam-channel to 0.3

This commit is contained in:
Bastien Orivel 2018-11-07 19:48:07 +01:00
parent 76195e0779
commit 9a7eeb349a
74 changed files with 303 additions and 521 deletions

View file

@ -8,6 +8,7 @@
//! and <http://tools.ietf.org/html/rfc7232>.
use crate::fetch::methods::{Data, DoneChannel};
use crossbeam_channel::{unbounded, Sender};
use headers_core::HeaderMapExt;
use headers_ext::{CacheControl, ContentRange, Expires, LastModified, Pragma, Range, Vary};
use http::header::HeaderValue;
@ -21,7 +22,6 @@ use net_traits::request::Request;
use net_traits::response::{HttpsState, Response, ResponseBody};
use net_traits::{FetchMetadata, Metadata};
use servo_arc::Arc;
use servo_channel::{channel, Sender};
use servo_config::prefs::PREFS;
use servo_url::ServoUrl;
use std::collections::HashMap;
@ -306,7 +306,7 @@ fn create_cached_response(
response.headers = cached_headers.clone();
response.body = cached_resource.body.clone();
if let ResponseBody::Receiving(_) = *cached_resource.body.lock().unwrap() {
let (done_sender, done_receiver) = channel();
let (done_sender, done_receiver) = unbounded();
*done_chan = Some((done_sender.clone(), done_receiver));
cached_resource
.awaiting_body
@ -670,7 +670,7 @@ impl HttpCache {
// Otherwise, create a new dedicated channel to update the consumer.
// The response constructed here will replace the 304 one from the network.
let in_progress_channel = match *cached_resource.body.lock().unwrap() {
ResponseBody::Receiving(..) => Some(channel()),
ResponseBody::Receiving(..) => Some(unbounded()),
ResponseBody::Empty | ResponseBody::Done(..) => None,
};
match in_progress_channel {