Skip to content

Commit e97f068

Browse files
committed
Move LoadData to script_traits.
1 parent bb271ef commit e97f068

File tree

16 files changed

+67
-66
lines changed

16 files changed

+67
-66
lines changed

components/compositing/compositor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ use image::{DynamicImage, ImageFormat, RgbImage};
1919
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
2020
use ipc_channel::router::ROUTER;
2121
use msg::constellation_msg::{Image, PixelFormat, Key, KeyModifiers, KeyState};
22-
use msg::constellation_msg::{LoadData, TraversalDirection, PipelineId};
23-
use msg::constellation_msg::{PipelineIndex, PipelineNamespaceId, WindowSizeType};
22+
use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
23+
use msg::constellation_msg::{TraversalDirection, WindowSizeType};
2424
use profile_traits::mem::{self, Reporter, ReporterRequest};
2525
use profile_traits::time::{self, ProfilerCategory, profile};
2626
use script_traits::{AnimationState, AnimationTickType, ConstellationControlMsg};
27-
use script_traits::{ConstellationMsg, LayoutControlMsg, MouseButton, MouseEventType};
28-
use script_traits::{StackingContextScrollState, TouchpadPressurePhase, TouchEventType};
29-
use script_traits::{TouchId, WindowSizeData};
27+
use script_traits::{ConstellationMsg, LayoutControlMsg, LoadData, MouseButton};
28+
use script_traits::{MouseEventType, StackingContextScrollState};
29+
use script_traits::{TouchpadPressurePhase, TouchEventType, TouchId, WindowSizeData};
3030
use script_traits::CompositorEvent::{self, MouseMoveEvent, MouseButtonEvent, TouchEvent, TouchpadPressureEvent};
3131
use std::collections::HashMap;
3232
use std::fs::File;

components/constellation/constellation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use ipc_channel::router::ROUTER;
2626
use layout_traits::LayoutThreadFactory;
2727
use log::{Log, LogLevel, LogLevelFilter, LogMetadata, LogRecord};
2828
use msg::constellation_msg::{FrameId, FrameType, PipelineId};
29-
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
29+
use msg::constellation_msg::{Key, KeyModifiers, KeyState};
3030
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId, TraversalDirection};
3131
use msg::constellation_msg::WindowSizeType;
3232
use net_traits::{self, IpcSend, ResourceThreads};
@@ -40,7 +40,7 @@ use profile_traits::time;
4040
use rand::{Rng, SeedableRng, StdRng, random};
4141
use script_traits::{AnimationState, AnimationTickType, CompositorEvent};
4242
use script_traits::{ConstellationControlMsg, ConstellationMsg as FromCompositorMsg};
43-
use script_traits::{DocumentState, LayoutControlMsg};
43+
use script_traits::{DocumentState, LayoutControlMsg, LoadData};
4444
use script_traits::{IFrameLoadInfo, IFrameSandboxState, TimerEventRequest};
4545
use script_traits::{LayoutMsg as FromLayoutMsg, ScriptMsg as FromScriptMsg, ScriptThreadFactory};
4646
use script_traits::{LogEntry, ServiceWorkerMsg, webdriver_msg};

components/constellation/pipeline.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ use gfx_traits::DevicePixel;
1515
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
1616
use ipc_channel::router::ROUTER;
1717
use layout_traits::LayoutThreadFactory;
18-
use msg::constellation_msg::{FrameId, FrameType, LoadData, PipelineId, PipelineNamespaceId};
18+
use msg::constellation_msg::{FrameId, FrameType, PipelineId, PipelineNamespaceId};
1919
use net_traits::{IpcSend, ResourceThreads};
2020
use net_traits::bluetooth_thread::BluetoothMethodMsg;
2121
use net_traits::image_cache_thread::ImageCacheThread;
2222
use profile_traits::mem as profile_mem;
2323
use profile_traits::time;
24-
use script_traits::{ConstellationControlMsg, InitialScriptState, MozBrowserEvent};
25-
use script_traits::{LayoutControlMsg, LayoutMsg, NewLayoutInfo, SWManagerMsg, SWManagerSenders, ScriptMsg};
24+
use script_traits::{ConstellationControlMsg, InitialScriptState};
25+
use script_traits::{LayoutControlMsg, LayoutMsg, LoadData, MozBrowserEvent};
26+
use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders, ScriptMsg};
2627
use script_traits::{ScriptThreadFactory, TimerEventRequest, WindowSizeData};
2728
use std::collections::HashMap;
2829
use std::env;

components/msg/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ bitflags = "0.7"
1414
cssparser = {version = "0.7", features = ["heap_size", "serde-serialization"]}
1515
heapsize = "0.3.0"
1616
heapsize_plugin = "0.1.2"
17-
hyper = "0.9.9"
18-
hyper_serde = "0.1.4"
1917
ipc-channel = "0.5"
2018
plugins = {path = "../plugins"}
2119
serde = "0.8"
2220
serde_derive = "0.8"
23-
url = {version = "1.2", features = ["heap_size", "serde"]}
2421

2522
[dependencies.webrender_traits]
2623
git = "https://github.com/servo/webrender"

components/msg/constellation_msg.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
//! The high-level interface from script to constellation. Using this abstract interface helps
66
//! reduce coupling between these two components.
77
8-
use hyper::header::Headers;
9-
use hyper::method::Method;
108
use ipc_channel::ipc::IpcSharedMemory;
119
use std::cell::Cell;
1210
use std::fmt;
13-
use url::Url;
1411
use webrender_traits;
1512

1613
#[derive(Deserialize, Eq, PartialEq, Serialize, Copy, Clone, HeapSizeOf)]
@@ -185,36 +182,6 @@ pub struct Image {
185182
pub id: Option<webrender_traits::ImageKey>,
186183
}
187184

188-
/// Similar to net::resource_thread::LoadData
189-
/// can be passed to LoadUrl to load a page with GET/POST
190-
/// parameters or headers
191-
#[derive(Clone, Deserialize, Serialize)]
192-
pub struct LoadData {
193-
pub url: Url,
194-
#[serde(deserialize_with = "::hyper_serde::deserialize",
195-
serialize_with = "::hyper_serde::serialize")]
196-
pub method: Method,
197-
#[serde(deserialize_with = "::hyper_serde::deserialize",
198-
serialize_with = "::hyper_serde::serialize")]
199-
pub headers: Headers,
200-
pub data: Option<Vec<u8>>,
201-
pub referrer_policy: Option<ReferrerPolicy>,
202-
pub referrer_url: Option<Url>,
203-
}
204-
205-
impl LoadData {
206-
pub fn new(url: Url, referrer_policy: Option<ReferrerPolicy>, referrer_url: Option<Url>) -> LoadData {
207-
LoadData {
208-
url: url,
209-
method: Method::Get,
210-
headers: Headers::new(),
211-
data: None,
212-
referrer_policy: referrer_policy,
213-
referrer_url: referrer_url,
214-
}
215-
}
216-
}
217-
218185
#[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize)]
219186
pub enum TraversalDirection {
220187
Forward(usize),

components/msg/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@
1111
#[macro_use]
1212
extern crate bitflags;
1313
extern crate heapsize;
14-
extern crate hyper;
15-
extern crate hyper_serde;
1614
extern crate ipc_channel;
1715
extern crate serde;
1816
#[macro_use]
1917
extern crate serde_derive;
20-
extern crate url;
2118
extern crate webrender_traits;
2219

2320
pub mod constellation_msg;

components/script/dom/htmlformelement.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ use encoding::all::UTF_8;
4242
use encoding::label::encoding_from_whatwg_label;
4343
use hyper::header::{Charset, ContentDisposition, ContentType, DispositionParam, DispositionType};
4444
use hyper::method::Method;
45-
use msg::constellation_msg::{LoadData, PipelineId};
45+
use msg::constellation_msg::PipelineId;
4646
use rand::random;
4747
use script_thread::{MainThreadScriptMsg, Runnable};
48+
use script_traits::LoadData;
4849
use std::borrow::ToOwned;
4950
use std::cell::Cell;
5051
use std::sync::mpsc::Sender;

components/script/dom/htmliframeelement.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ use dom::window::{ReflowReason, Window};
3838
use ipc_channel::ipc;
3939
use js::jsapi::{JSAutoCompartment, JSContext, MutableHandleValue};
4040
use js::jsval::{NullValue, UndefinedValue};
41-
use msg::constellation_msg::{FrameType, FrameId, LoadData, PipelineId, TraversalDirection};
41+
use msg::constellation_msg::{FrameType, FrameId, PipelineId, TraversalDirection};
4242
use net_traits::response::HttpsState;
4343
use script_layout_interface::message::ReflowQueryType;
44-
use script_traits::{IFrameLoadInfo, MozBrowserEvent, ScriptMsg as ConstellationMsg};
44+
use script_traits::{IFrameLoadInfo, LoadData, MozBrowserEvent, ScriptMsg as ConstellationMsg};
4545
use script_traits::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
4646
use std::cell::Cell;
4747
use string_cache::Atom;

components/script/dom/window.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use js::jsapi::{HandleObject, HandleValue, JSAutoCompartment, JSContext};
4949
use js::jsapi::{JS_GC, JS_GetRuntime, SetWindowProxy};
5050
use js::jsval::UndefinedValue;
5151
use js::rust::Runtime;
52-
use msg::constellation_msg::{FrameType, LoadData, PipelineId, ReferrerPolicy, WindowSizeType};
52+
use msg::constellation_msg::{FrameType, PipelineId, ReferrerPolicy, WindowSizeType};
5353
use net_traits::ResourceThreads;
5454
use net_traits::bluetooth_thread::BluetoothMethodMsg;
5555
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread};
@@ -68,7 +68,7 @@ use script_layout_interface::rpc::{MarginStyleResponse, ResolvedStyleResponse};
6868
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort, ScriptThreadEventCategory};
6969
use script_thread::{MainThreadScriptChan, MainThreadScriptMsg, Runnable, RunnableWrapper};
7070
use script_thread::SendableMainThreadScriptChan;
71-
use script_traits::{ConstellationControlMsg, MozBrowserEvent, UntrustedNodeAddress};
71+
use script_traits::{ConstellationControlMsg, LoadData, MozBrowserEvent, UntrustedNodeAddress};
7272
use script_traits::{DocumentState, TimerEvent, TimerEventId};
7373
use script_traits::{ScriptMsg as ConstellationMsg, TimerEventRequest, WindowSizeData};
7474
use script_traits::webdriver_msg::{WebDriverJSError, WebDriverJSResult};

components/script/script_thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ use js::jsval::UndefinedValue;
7171
use js::rust::Runtime;
7272
use layout_wrapper::ServoLayoutNode;
7373
use mem::heap_size_of_self_and_children;
74-
use msg::constellation_msg::{FrameType, LoadData, PipelineId, PipelineNamespace};
74+
use msg::constellation_msg::{FrameType, PipelineId, PipelineNamespace};
7575
use msg::constellation_msg::{ReferrerPolicy, WindowSizeType};
7676
use net_traits::{AsyncResponseTarget, CoreResourceMsg, LoadConsumer, LoadContext, Metadata, ResourceThreads};
7777
use net_traits::{IpcSend, LoadData as NetLoadData};
@@ -84,7 +84,7 @@ use script_layout_interface::message::{self, NewLayoutThreadInfo, ReflowQueryTyp
8484
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory, EnqueuedPromiseCallback};
8585
use script_runtime::{ScriptPort, StackRootTLS, get_reports, new_rt_and_cx, PromiseJobQueue};
8686
use script_traits::{CompositorEvent, ConstellationControlMsg, EventResult};
87-
use script_traits::{InitialScriptState, MouseButton, MouseEventType, MozBrowserEvent};
87+
use script_traits::{InitialScriptState, LoadData, MouseButton, MouseEventType, MozBrowserEvent};
8888
use script_traits::{NewLayoutInfo, ScriptMsg as ConstellationMsg};
8989
use script_traits::{ScriptThreadFactory, TimerEvent, TimerEventRequest, TimerSource};
9090
use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress, WindowSizeData};

0 commit comments

Comments
 (0)