mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a
This commit is contained in:
parent
26045d7fcb
commit
d1b433a3b3
160 changed files with 1427 additions and 1162 deletions
|
@ -30,7 +30,7 @@ use servo_util::opts;
|
|||
use servo_util::task::spawn_named;
|
||||
use servo_util::time::TimeProfilerChan;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::hashmap::{HashMap, HashSet};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::io;
|
||||
use std::mem::replace;
|
||||
use std::rc::Rc;
|
||||
|
@ -267,7 +267,7 @@ impl NavigationContext {
|
|||
|
||||
/// Loads a new set of page frames, returning all evicted frame trees
|
||||
fn load(&mut self, frame_tree: Rc<FrameTree>) -> Vec<Rc<FrameTree>> {
|
||||
debug!("navigating to {:?}", frame_tree.pipeline.id);
|
||||
debug!("navigating to {}", frame_tree.pipeline.id);
|
||||
let evicted = replace(&mut self.next, vec!());
|
||||
if self.current.is_some() {
|
||||
self.previous.push(self.current.take().unwrap());
|
||||
|
@ -465,7 +465,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
}
|
||||
|
||||
fn handle_failure_msg(&mut self, pipeline_id: PipelineId, subpage_id: Option<SubpageId>) {
|
||||
debug!("handling failure message from pipeline {:?}, {:?}", pipeline_id, subpage_id);
|
||||
debug!("handling failure message from pipeline {}, {}", pipeline_id, subpage_id);
|
||||
|
||||
if opts::get().hard_fail {
|
||||
// It's quite difficult to make Servo exit cleanly if some tasks have failed.
|
||||
|
@ -476,7 +476,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
unsafe { libc::exit(1); }
|
||||
}
|
||||
|
||||
let old_pipeline = match self.pipelines.find(&pipeline_id) {
|
||||
let old_pipeline = match self.pipelines.get(&pipeline_id) {
|
||||
None => {
|
||||
debug!("no existing pipeline found; bailing out of failure recovery.");
|
||||
return; // already failed?
|
||||
|
@ -536,7 +536,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
|
||||
fn handle_frame_rect_msg(&mut self, pipeline_id: PipelineId, subpage_id: SubpageId,
|
||||
rect: TypedRect<PagePx, f32>) {
|
||||
debug!("Received frame rect {:?} from {:?}, {:?}", rect, pipeline_id, subpage_id);
|
||||
debug!("Received frame rect {} from {}, {}", rect, pipeline_id, subpage_id);
|
||||
let mut already_sent = HashSet::new();
|
||||
|
||||
// Returns true if a child frame tree's subpage id matches the given subpage id
|
||||
|
@ -635,16 +635,16 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
// and add the new pipeline to their sub frames.
|
||||
let frame_trees = self.find_all(source_pipeline_id);
|
||||
if frame_trees.is_empty() {
|
||||
fail!("Constellation: source pipeline id of ScriptLoadedURLInIFrameMsg is not in
|
||||
navigation context, nor is it in a pending frame. This should be
|
||||
impossible.");
|
||||
panic!("Constellation: source pipeline id of ScriptLoadedURLInIFrameMsg is not in
|
||||
navigation context, nor is it in a pending frame. This should be
|
||||
impossible.");
|
||||
}
|
||||
|
||||
let next_pipeline_id = self.get_next_pipeline_id();
|
||||
|
||||
// Compare the pipeline's url to the new url. If the origin is the same,
|
||||
// then reuse the script task in creating the new pipeline
|
||||
let source_pipeline = self.pipelines.find(&source_pipeline_id).expect("Constellation:
|
||||
let source_pipeline = self.pipelines.get(&source_pipeline_id).expect("Constellation:
|
||||
source Id of ScriptLoadedURLInIFrameMsg does have an associated pipeline in
|
||||
constellation. This should be impossible.").clone();
|
||||
|
||||
|
@ -655,10 +655,10 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
// FIXME(tkuehn): Need to follow the standardized spec for checking same-origin
|
||||
// Reuse the script task if the URL is same-origin
|
||||
let script_pipeline = if same_script {
|
||||
debug!("Constellation: loading same-origin iframe at {:?}", url);
|
||||
debug!("Constellation: loading same-origin iframe at {}", url);
|
||||
Some(source_pipeline.clone())
|
||||
} else {
|
||||
debug!("Constellation: loading cross-origin iframe at {:?}", url);
|
||||
debug!("Constellation: loading cross-origin iframe at {}", url);
|
||||
None
|
||||
};
|
||||
|
||||
|
@ -669,7 +669,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
LoadData::new(url)
|
||||
);
|
||||
|
||||
let rect = self.pending_sizes.pop(&(source_pipeline_id, subpage_id));
|
||||
let rect = self.pending_sizes.remove(&(source_pipeline_id, subpage_id));
|
||||
for frame_tree in frame_trees.iter() {
|
||||
frame_tree.children.borrow_mut().push(ChildFrameTree::new(
|
||||
Rc::new(FrameTree::new(pipeline.clone(), Some(source_pipeline.clone()))),
|
||||
|
@ -716,7 +716,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
}
|
||||
|
||||
fn handle_navigate_msg(&mut self, direction: constellation_msg::NavigationDirection) {
|
||||
debug!("received message to navigate {:?}", direction);
|
||||
debug!("received message to navigate {}", direction);
|
||||
|
||||
// TODO(tkuehn): what is the "critical point" beyond which pending frames
|
||||
// should not be cleared? Currently, the behavior is that forward/back
|
||||
|
@ -762,7 +762,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
}
|
||||
|
||||
fn handle_renderer_ready_msg(&mut self, pipeline_id: PipelineId) {
|
||||
debug!("Renderer {:?} ready to send paint msg", pipeline_id);
|
||||
debug!("Renderer {} ready to send paint msg", pipeline_id);
|
||||
// This message could originate from a pipeline in the navigation context or
|
||||
// from a pending frame. The only time that we will grant paint permission is
|
||||
// when the message originates from a pending frame or the current frame.
|
||||
|
@ -795,7 +795,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
// If there are frames to revoke permission from, do so now.
|
||||
match frame_change.before {
|
||||
Some(revoke_id) if self.current_frame().is_some() => {
|
||||
debug!("Constellation: revoking permission from {:?}", revoke_id);
|
||||
debug!("Constellation: revoking permission from {}", revoke_id);
|
||||
let current_frame = self.current_frame().as_ref().unwrap();
|
||||
|
||||
let to_revoke = current_frame.find(revoke_id).expect(
|
||||
|
@ -812,7 +812,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
let mut flag = false;
|
||||
{
|
||||
if to_add.parent.borrow().is_some() {
|
||||
debug!("Constellation: replacing {:?} with {:?} in {:?}",
|
||||
debug!("Constellation: replacing {} with {} in {}",
|
||||
revoke_id, to_add.pipeline.id,
|
||||
next_frame_tree.pipeline.id);
|
||||
flag = true;
|
||||
|
@ -830,7 +830,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
let subpage_id = to_add.pipeline.subpage_id
|
||||
.expect("Constellation:
|
||||
Child frame's subpage id is None. This should be impossible.");
|
||||
let rect = self.pending_sizes.pop(&(parent.id, subpage_id));
|
||||
let rect = self.pending_sizes.remove(&(parent.id, subpage_id));
|
||||
let parent = next_frame_tree.find(parent.id).expect(
|
||||
"Constellation: pending frame has a parent frame that is not
|
||||
active. This is a bug.");
|
||||
|
@ -870,7 +870,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
for change in self.pending_frames.iter() {
|
||||
let frame_tree = &change.after;
|
||||
if frame_tree.parent.borrow().is_none() {
|
||||
debug!("constellation sending resize message to pending outer frame ({:?})",
|
||||
debug!("constellation sending resize message to pending outer frame ({})",
|
||||
frame_tree.pipeline.id);
|
||||
let ScriptControlChan(ref chan) = frame_tree.pipeline.script_chan;
|
||||
let _ = chan.send_opt(ResizeMsg(frame_tree.pipeline.id, new_size));
|
||||
|
@ -990,4 +990,3 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue