mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Simplify the LoadData creation in parse_html.
This commit is contained in:
parent
5d0934d8ec
commit
de318ae8f1
1 changed files with 8 additions and 5 deletions
|
@ -217,11 +217,14 @@ pub fn parse_html(page: &Page,
|
|||
InputUrl(ref url) => {
|
||||
// Wait for the LoadResponse so that the parser knows the final URL.
|
||||
let (input_chan, input_port) = channel();
|
||||
let mut load_data = LoadData::new(url.clone(), input_chan);
|
||||
load_data.headers = msg_load_data.headers;
|
||||
load_data.method = msg_load_data.method;
|
||||
load_data.data = msg_load_data.data;
|
||||
resource_task.send(Load(load_data));
|
||||
resource_task.send(Load(LoadData {
|
||||
url: url.clone(),
|
||||
method: msg_load_data.method,
|
||||
headers: msg_load_data.headers,
|
||||
data: msg_load_data.data,
|
||||
cors: None,
|
||||
consumer: input_chan,
|
||||
}));
|
||||
|
||||
let load_response = input_port.recv();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue