mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +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::io::{Write, stderr, stdout};
|
||||
use std::rc::Rc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use app_units::Au;
|
||||
|
@ -3172,7 +3172,7 @@ impl Window {
|
|||
) -> DomRoot<Self> {
|
||||
let error_reporter = CSSErrorReporter {
|
||||
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(
|
||||
|
@ -3395,14 +3395,10 @@ impl Window {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, MallocSizeOf)]
|
||||
#[derive(MallocSizeOf)]
|
||||
pub(crate) struct CSSErrorReporter {
|
||||
pub(crate) pipelineid: PipelineId,
|
||||
// Arc+Mutex combo is necessary to make this struct Sync,
|
||||
// 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>>>,
|
||||
pub(crate) script_chan: IpcSender<ScriptThreadMessage>,
|
||||
}
|
||||
unsafe_no_jsmanaged_fields!(CSSErrorReporter);
|
||||
|
||||
|
@ -3424,17 +3420,13 @@ impl ParseErrorReporter for CSSErrorReporter {
|
|||
}
|
||||
|
||||
//TODO: report a real filename
|
||||
let _ = self
|
||||
.script_chan
|
||||
.lock()
|
||||
.unwrap()
|
||||
.send(ScriptThreadMessage::ReportCSSError(
|
||||
self.pipelineid,
|
||||
url.0.to_string(),
|
||||
location.line,
|
||||
location.column,
|
||||
error.to_string(),
|
||||
));
|
||||
let _ = self.script_chan.send(ScriptThreadMessage::ReportCSSError(
|
||||
self.pipelineid,
|
||||
url.0.to_string(),
|
||||
location.line,
|
||||
location.column,
|
||||
error.to_string(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue