mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Implement sync XHR by creating and spinning on-demand event loops.
This commit is contained in:
parent
2ee21ddbe7
commit
01e66035ff
6 changed files with 269 additions and 156 deletions
|
@ -29,7 +29,7 @@ use dom::storage::Storage;
|
|||
use layout_interface::{ReflowGoal, ReflowQueryType, LayoutRPC, LayoutChan, Reflow, Msg};
|
||||
use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ScriptReflow};
|
||||
use page::Page;
|
||||
use script_task::{TimerSource, ScriptChan};
|
||||
use script_task::{TimerSource, ScriptChan, ScriptPort, NonWorkerScriptChan};
|
||||
use script_task::ScriptMsg;
|
||||
use script_traits::ScriptControlChan;
|
||||
use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
|
||||
|
@ -198,6 +198,11 @@ impl Window {
|
|||
self.parent_info
|
||||
}
|
||||
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan+Send>, Box<ScriptPort+Send>) {
|
||||
let (tx, rx) = channel();
|
||||
(box NonWorkerScriptChan(tx), box rx)
|
||||
}
|
||||
|
||||
pub fn control_chan<'a>(&'a self) -> &'a ScriptControlChan {
|
||||
&self.control_chan
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue