diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-04-11 12:58:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-11 12:58:34 -0400 |
commit | 9ab0af01fe2618d81555f0c2bea3585c0f468628 (patch) | |
tree | 869e624bc018c9a7f97d40dccea6883f66d400da /components/script/document_loader.rs | |
parent | dd2deeabca7eeb40e6a8fe0c1ee4550d64e0c235 (diff) | |
parent | 6b2be9b31de1503e90a62cc7d597dc4bd467d998 (diff) | |
download | servo-9ab0af01fe2618d81555f0c2bea3585c0f468628.tar.gz servo-9ab0af01fe2618d81555f0c2bea3585c0f468628.zip |
Auto merge of #22521 - lucasfantacuci:use_build_pattern_with_requestinit, r=jdm,KiChjang
Refactoring RequestInit to use a Builder Pattern
<!-- Please describe your changes on the following line: -->
If RequestInit::new accepts all of the mandatory arguments and then the builder pattern is used for customizable options, the resulting code might be easier to match against specification text like
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22427
- [x] These changes do not require tests because it is a code refactoring.
<!-- 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/22521)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/document_loader.rs')
-rw-r--r-- | components/script/document_loader.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs index dac891053d7..d127d78ebd2 100644 --- a/components/script/document_loader.rs +++ b/components/script/document_loader.rs @@ -10,7 +10,7 @@ use crate::dom::bindings::root::Dom; use crate::dom::document::Document; use crate::fetch::FetchCanceller; use ipc_channel::ipc::IpcSender; -use net_traits::request::RequestInit; +use net_traits::request::RequestBuilder; use net_traits::{CoreResourceMsg, FetchChannels, FetchResponseMsg}; use net_traits::{IpcSend, ResourceThreads}; use servo_url::ServoUrl; @@ -131,7 +131,7 @@ impl DocumentLoader { pub fn fetch_async( &mut self, load: LoadType, - request: RequestInit, + request: RequestBuilder, fetch_target: IpcSender<FetchResponseMsg>, ) { self.add_blocking_load(load); @@ -141,7 +141,7 @@ impl DocumentLoader { /// Initiate a new fetch that does not block the document load event. pub fn fetch_async_background( &mut self, - request: RequestInit, + request: RequestBuilder, fetch_target: IpcSender<FetchResponseMsg>, ) { let mut canceller = FetchCanceller::new(); |