aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlvideoelement.rs
diff options
context:
space:
mode:
authorLucas Fantacuci <lucasfantacuci@gmail.com>2018-12-21 17:38:22 -0200
committerLucas Sanches Fantacuci <lucasfantacuci@gmail.com>2019-04-10 14:01:30 -0300
commit6b2be9b31de1503e90a62cc7d597dc4bd467d998 (patch)
tree869e624bc018c9a7f97d40dccea6883f66d400da /components/script/dom/htmlvideoelement.rs
parentdd2deeabca7eeb40e6a8fe0c1ee4550d64e0c235 (diff)
downloadservo-6b2be9b31de1503e90a62cc7d597dc4bd467d998.tar.gz
servo-6b2be9b31de1503e90a62cc7d597dc4bd467d998.zip
Implementing the builder pattern for RequestInit
Diffstat (limited to 'components/script/dom/htmlvideoelement.rs')
-rw-r--r--components/script/dom/htmlvideoelement.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs
index e8c831221d0..e95a2ca8ccd 100644
--- a/components/script/dom/htmlvideoelement.rs
+++ b/components/script/dom/htmlvideoelement.rs
@@ -29,7 +29,7 @@ use ipc_channel::router::ROUTER;
use net_traits::image_cache::UsePlaceholder;
use net_traits::image_cache::{CanRequestImages, ImageCache, ImageOrMetadataAvailable};
use net_traits::image_cache::{ImageResponse, ImageState, PendingImageId};
-use net_traits::request::{CredentialsMode, Destination, RequestInit};
+use net_traits::request::{CredentialsMode, Destination, RequestBuilder};
use net_traits::{
CoreResourceMsg, FetchChannels, FetchMetadata, FetchResponseListener, FetchResponseMsg,
};
@@ -162,15 +162,12 @@ impl HTMLVideoElement {
) {
// Continuation of step 4.
let document = document_from_node(self);
- let request = RequestInit {
- url: poster_url.clone(),
- destination: Destination::Image,
- credentials_mode: CredentialsMode::Include,
- use_url_credentials: true,
- origin: document.origin().immutable().clone(),
- pipeline_id: Some(document.global().pipeline_id()),
- ..RequestInit::default()
- };
+ let request = RequestBuilder::new(poster_url.clone())
+ .destination(Destination::Image)
+ .credentials_mode(CredentialsMode::Include)
+ .use_url_credentials(true)
+ .origin(document.origin().immutable().clone())
+ .pipeline_id(Some(document.global().pipeline_id()));
// Step 5.
// This delay must be independent from the ones created by HTMLMediaElement during