forked from mirrors/gecko-dev
		
	 f3988ea1b8
			
		
	
	
		f3988ea1b8
		
	
	
	
	
		
			
			Closes #9698. Source-Repo: https://github.com/servo/servo Source-Revision: b97ffffb48080a0b4769f8609a27a68145042945
		
			
				
	
	
		
			19 lines
		
	
	
	
		
			686 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
	
		
			686 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| /* This Source Code Form is subject to the terms of the Mozilla Public
 | |
|  * License, v. 2.0. If a copy of the MPL was not distributed with this
 | |
|  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 | |
| 
 | |
| use script_thread::{CommonScriptMsg, MainThreadScriptMsg, ScriptChan};
 | |
| use std::sync::mpsc::Sender;
 | |
| 
 | |
| #[derive(JSTraceable)]
 | |
| pub struct NetworkingTaskSource(pub Sender<MainThreadScriptMsg>);
 | |
| 
 | |
| impl ScriptChan for NetworkingTaskSource {
 | |
|     fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
 | |
|         self.0.send(MainThreadScriptMsg::Common(msg)).map_err(|_| ())
 | |
|     }
 | |
| 
 | |
|     fn clone(&self) -> Box<ScriptChan + Send> {
 | |
|         box NetworkingTaskSource((&self.0).clone())
 | |
|     }
 | |
| }
 |