mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Remove the pointless StorageThread alias.
This commit is contained in:
parent
bcea0ada27
commit
0071b45449
4 changed files with 10 additions and 15 deletions
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||||
use net_traits::storage_thread::{StorageThread, StorageThreadMsg, StorageType};
|
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
|
||||||
use resource_thread;
|
use resource_thread;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
@ -18,9 +18,9 @@ pub trait StorageThreadFactory {
|
||||||
fn new() -> Self;
|
fn new() -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StorageThreadFactory for StorageThread {
|
impl StorageThreadFactory for IpcSender<StorageThreadMsg> {
|
||||||
/// Create a StorageThread
|
/// Create a storage thread
|
||||||
fn new() -> StorageThread {
|
fn new() -> IpcSender<StorageThreadMsg> {
|
||||||
let (chan, port) = ipc::channel().unwrap();
|
let (chan, port) = ipc::channel().unwrap();
|
||||||
spawn_named("StorageManager".to_owned(), move || {
|
spawn_named("StorageManager".to_owned(), move || {
|
||||||
StorageManager::new(port).start();
|
StorageManager::new(port).start();
|
||||||
|
|
|
@ -38,7 +38,7 @@ use msg::constellation_msg::{PipelineId, ReferrerPolicy};
|
||||||
use std::io::Error as IOError;
|
use std::io::Error as IOError;
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use storage_thread::{StorageThread, StorageThreadMsg};
|
use storage_thread::StorageThreadMsg;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use websocket::header;
|
use websocket::header;
|
||||||
|
|
||||||
|
@ -199,11 +199,11 @@ pub trait IpcSend<T> where T: serde::Serialize + serde::Deserialize {
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
pub struct ResourceThreads {
|
pub struct ResourceThreads {
|
||||||
core_thread: CoreResourceThread,
|
core_thread: CoreResourceThread,
|
||||||
storage_thread: StorageThread,
|
storage_thread: IpcSender<StorageThreadMsg>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ResourceThreads {
|
impl ResourceThreads {
|
||||||
pub fn new(c: CoreResourceThread, s: StorageThread) -> ResourceThreads {
|
pub fn new(c: CoreResourceThread, s: IpcSender<StorageThreadMsg>) -> ResourceThreads {
|
||||||
ResourceThreads {
|
ResourceThreads {
|
||||||
core_thread: c,
|
core_thread: c,
|
||||||
storage_thread: s,
|
storage_thread: s,
|
||||||
|
|
|
@ -38,8 +38,3 @@ pub enum StorageThreadMsg {
|
||||||
/// shut down this thread
|
/// shut down this thread
|
||||||
Exit
|
Exit
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handle to a storage thread
|
|
||||||
pub type StorageThread = IpcSender<StorageThreadMsg>;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,9 @@ use dom::browsingcontext::IterableContext;
|
||||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||||
use dom::storageevent::StorageEvent;
|
use dom::storageevent::StorageEvent;
|
||||||
use dom::urlhelper::UrlHelper;
|
use dom::urlhelper::UrlHelper;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
use net_traits::IpcSend;
|
use net_traits::IpcSend;
|
||||||
use net_traits::storage_thread::{StorageThread, StorageThreadMsg, StorageType};
|
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
|
||||||
use script_thread::{MainThreadRunnable, ScriptThread};
|
use script_thread::{MainThreadRunnable, ScriptThread};
|
||||||
use task_source::dom_manipulation::DOMManipulationTask;
|
use task_source::dom_manipulation::DOMManipulationTask;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
@ -46,7 +46,7 @@ impl Storage {
|
||||||
global_ref.get_url()
|
global_ref.get_url()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_storage_thread(&self) -> StorageThread {
|
fn get_storage_thread(&self) -> IpcSender<StorageThreadMsg> {
|
||||||
let global_root = self.global();
|
let global_root = self.global();
|
||||||
let global_ref = global_root.r();
|
let global_ref = global_root.r();
|
||||||
global_ref.as_window().resource_threads().sender()
|
global_ref.as_window().resource_threads().sender()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue