| 
									
										
										
										
											2013-08-29 20:56:25 +08:00
										 |  |  | protocol = process.atomBinding 'protocol' | 
					
						
							| 
									
										
										
										
											2013-08-29 20:38:04 +08:00
										 |  |  | EventEmitter = require('events').EventEmitter | 
					
						
							| 
									
										
										
										
											2013-08-25 15:07:07 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-29 20:56:25 +08:00
										 |  |  | protocol[key] = value for key, value of EventEmitter.prototype | 
					
						
							| 
									
										
										
										
											2013-08-29 20:38:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | protocol.RequestStringJob =
 | 
					
						
							| 
									
										
										
										
											2013-08-25 15:07:07 +08:00
										 |  |  | class RequestStringJob | 
					
						
							|  |  |  |   constructor: ({mimeType, charset, data}) -> | 
					
						
							|  |  |  |     if typeof data isnt 'string' and not data instanceof Buffer | 
					
						
							|  |  |  |       throw new TypeError('Data should be string or Buffer') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @mimeType = mimeType ? 'text/plain' | 
					
						
							|  |  |  |     @charset = charset ? 'UTF-8' | 
					
						
							|  |  |  |     @data = String data | 
					
						
							| 
									
										
										
										
											2013-08-25 16:06:29 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-29 20:38:04 +08:00
										 |  |  | protocol.RequestFileJob =
 | 
					
						
							| 
									
										
										
										
											2013-08-25 16:06:29 +08:00
										 |  |  | class RequestFileJob | 
					
						
							|  |  |  |   constructor: (@path) -> | 
					
						
							| 
									
										
										
										
											2013-08-29 20:38:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | module.exports = protocol |