mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
script: Remove unnecessary Arc<Mutex> (#38631)
The `Arc<Mutex<>>` wrapper around the IpcSender does not appear to be needed anymore. Testing: No functional changes. Covered by existing tests Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
parent
47aa9ea8cf
commit
2ea251117a
1 changed files with 11 additions and 19 deletions
|
@ -11,7 +11,7 @@ use std::default::Default;
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
use std::io::{Write, stderr, stdout};
|
use std::io::{Write, stderr, stdout};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::Arc;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
|
@ -3172,7 +3172,7 @@ impl Window {
|
||||||
) -> DomRoot<Self> {
|
) -> DomRoot<Self> {
|
||||||
let error_reporter = CSSErrorReporter {
|
let error_reporter = CSSErrorReporter {
|
||||||
pipelineid: pipeline_id,
|
pipelineid: pipeline_id,
|
||||||
script_chan: Arc::new(Mutex::new(control_chan)),
|
script_chan: control_chan,
|
||||||
};
|
};
|
||||||
|
|
||||||
let initial_viewport = f32_rect_to_au_rect(UntypedRect::new(
|
let initial_viewport = f32_rect_to_au_rect(UntypedRect::new(
|
||||||
|
@ -3395,14 +3395,10 @@ impl Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, MallocSizeOf)]
|
#[derive(MallocSizeOf)]
|
||||||
pub(crate) struct CSSErrorReporter {
|
pub(crate) struct CSSErrorReporter {
|
||||||
pub(crate) pipelineid: PipelineId,
|
pub(crate) pipelineid: PipelineId,
|
||||||
// Arc+Mutex combo is necessary to make this struct Sync,
|
pub(crate) script_chan: IpcSender<ScriptThreadMessage>,
|
||||||
// which is necessary to fulfill the bounds required by the
|
|
||||||
// uses of the ParseErrorReporter trait.
|
|
||||||
#[ignore_malloc_size_of = "Arc is defined in libstd"]
|
|
||||||
pub(crate) script_chan: Arc<Mutex<IpcSender<ScriptThreadMessage>>>,
|
|
||||||
}
|
}
|
||||||
unsafe_no_jsmanaged_fields!(CSSErrorReporter);
|
unsafe_no_jsmanaged_fields!(CSSErrorReporter);
|
||||||
|
|
||||||
|
@ -3424,17 +3420,13 @@ impl ParseErrorReporter for CSSErrorReporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: report a real filename
|
//TODO: report a real filename
|
||||||
let _ = self
|
let _ = self.script_chan.send(ScriptThreadMessage::ReportCSSError(
|
||||||
.script_chan
|
self.pipelineid,
|
||||||
.lock()
|
url.0.to_string(),
|
||||||
.unwrap()
|
location.line,
|
||||||
.send(ScriptThreadMessage::ReportCSSError(
|
location.column,
|
||||||
self.pipelineid,
|
error.to_string(),
|
||||||
url.0.to_string(),
|
));
|
||||||
location.line,
|
|
||||||
location.column,
|
|
||||||
error.to_string(),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue