diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 86f9e9620a0..1c0e6417df8 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -1206,26 +1206,24 @@ impl Constellation fn handle_create_canvas_paint_thread_msg( &mut self, size: &Size2D, - response_sender: IpcSender<(IpcSender, usize)>) { - let id = self.canvas_paint_threads.len(); + response_sender: IpcSender>) { let webrender_api = self.webrender_api_sender.clone(); let (out_of_process_sender, in_process_sender) = CanvasPaintThread::start(*size, webrender_api); self.canvas_paint_threads.push(in_process_sender); - response_sender.send((out_of_process_sender, id)).unwrap() + response_sender.send(out_of_process_sender).unwrap() } fn handle_create_webgl_paint_thread_msg( &mut self, size: &Size2D, attributes: GLContextAttributes, - response_sender: IpcSender, usize), String>>) { + response_sender: IpcSender, String>>) { let webrender_api = self.webrender_api_sender.clone(); let response = match WebGLPaintThread::start(*size, attributes, webrender_api) { Ok((out_of_process_sender, in_process_sender)) => { - let id = self.webgl_paint_threads.len(); self.webgl_paint_threads.push(in_process_sender); - Ok((out_of_process_sender, id)) + Ok(out_of_process_sender) }, Err(msg) => Err(msg), }; diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 566a0ea08b1..aa5c7d9f72b 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -124,7 +124,7 @@ impl CanvasRenderingContext2D { let (sender, receiver) = ipc::channel().unwrap(); let constellation_chan = global.constellation_chan(); constellation_chan.0.send(ConstellationMsg::CreateCanvasPaintThread(size, sender)).unwrap(); - let (ipc_renderer, _) = receiver.recv().unwrap(); + let ipc_renderer = receiver.recv().unwrap(); CanvasRenderingContext2D { reflector_: Reflector::new(), ipc_renderer: ipc_renderer, diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index b52894b84c0..5251585ea94 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -94,7 +94,7 @@ impl WebGLRenderingContext { .unwrap(); let result = receiver.recv().unwrap(); - result.map(|(ipc_renderer, _)| { + result.map(|ipc_renderer| { WebGLRenderingContext { reflector_: Reflector::new(), ipc_renderer: ipc_renderer, diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 73da909cb5f..5b6afa3db1e 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -39,12 +39,12 @@ pub enum ScriptMsg { ChangeRunningAnimationsState(PipelineId, AnimationState), /// Requests that a new 2D canvas thread be created. (This is done in the constellation because /// 2D canvases may use the GPU and we don't want to give untrusted content access to the GPU.) - CreateCanvasPaintThread(Size2D, IpcSender<(IpcSender, usize)>), + CreateCanvasPaintThread(Size2D, IpcSender>), /// Requests that a new WebGL thread be created. (This is done in the constellation because /// WebGL uses the GPU and we don't want to give untrusted content access to the GPU.) CreateWebGLPaintThread(Size2D, GLContextAttributes, - IpcSender, usize), String>>), + IpcSender, String>>), /// Dispatched after the DOM load event has fired on a document /// Causes a `load` event to be dispatched to any enclosing frame context element /// for the given pipeline.