mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Allow passing a method, request body, and headers to the pipeline in LoadUrlMsg
This commit is contained in:
parent
15b508ac10
commit
ad16c52a6b
10 changed files with 75 additions and 35 deletions
|
@ -17,6 +17,10 @@ git = "https://github.com/servo/rust-azure"
|
|||
[dependencies.geom]
|
||||
git = "https://github.com/servo/rust-geom"
|
||||
|
||||
[dependencies.http]
|
||||
git = "https://github.com/servo/rust-http"
|
||||
branch = "servo"
|
||||
|
||||
[dependencies.layers]
|
||||
git = "https://github.com/servo/rust-layers"
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
use geom::rect::Rect;
|
||||
use geom::size::TypedSize2D;
|
||||
use geom::scale_factor::ScaleFactor;
|
||||
use http::headers::request::HeaderCollection as RequestHeaderCollection;
|
||||
use http::method::{Method, Get};
|
||||
use layers::geometry::DevicePixel;
|
||||
use servo_util::geometry::{PagePx, ViewportPx};
|
||||
use std::comm::{channel, Sender, Receiver};
|
||||
|
@ -55,13 +57,35 @@ pub enum Msg {
|
|||
InitLoadUrlMsg(Url),
|
||||
LoadCompleteMsg(PipelineId, Url),
|
||||
FrameRectMsg(PipelineId, SubpageId, Rect<f32>),
|
||||
LoadUrlMsg(PipelineId, Url),
|
||||
LoadUrlMsg(PipelineId, LoadData),
|
||||
LoadIframeUrlMsg(Url, PipelineId, SubpageId, IFrameSandboxState),
|
||||
NavigateMsg(NavigationDirection),
|
||||
RendererReadyMsg(PipelineId),
|
||||
ResizedWindowMsg(WindowSizeData),
|
||||
}
|
||||
|
||||
/// Similar to net::resource_task::LoadData
|
||||
/// can be passed to LoadUrlMsg to load a page with GET/POST
|
||||
/// parameters or headers
|
||||
#[deriving(Clone)]
|
||||
pub struct LoadData {
|
||||
pub url: Url,
|
||||
pub method: Method,
|
||||
pub headers: RequestHeaderCollection,
|
||||
pub data: Option<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl LoadData {
|
||||
pub fn new(url: Url) -> LoadData {
|
||||
LoadData {
|
||||
url: url,
|
||||
method: Get,
|
||||
headers: RequestHeaderCollection::new(),
|
||||
data: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the two different ways to which a page can be navigated
|
||||
#[deriving(Clone, PartialEq, Hash)]
|
||||
pub enum NavigationType {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
extern crate azure;
|
||||
extern crate geom;
|
||||
extern crate http;
|
||||
extern crate layers;
|
||||
extern crate serialize;
|
||||
extern crate "util" as servo_util;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue