| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 define("mojo/public/bindings/js/router", [ | 5 define("mojo/public/js/bindings/router", [ |
| 6 "mojo/public/bindings/js/codec", | 6 "mojo/public/js/bindings/codec", |
| 7 "mojo/public/bindings/js/connector", | 7 "mojo/public/js/bindings/connector", |
| 8 ], function(codec, connector) { | 8 ], function(codec, connector) { |
| 9 | 9 |
| 10 function Router(handle) { | 10 function Router(handle) { |
| 11 this.connector_ = new connector.Connector(handle); | 11 this.connector_ = new connector.Connector(handle); |
| 12 this.incomingReceiver_ = null; | 12 this.incomingReceiver_ = null; |
| 13 this.nextRequestID_ = 0; | 13 this.nextRequestID_ = 0; |
| 14 this.responders_ = {}; | 14 this.responders_ = {}; |
| 15 | 15 |
| 16 this.connector_.setIncomingReceiver({ | 16 this.connector_.setIncomingReceiver({ |
| 17 accept: this.handleIncomingMessage_.bind(this), | 17 accept: this.handleIncomingMessage_.bind(this), |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } else { | 66 } else { |
| 67 if (this.incomingReceiver_) | 67 if (this.incomingReceiver_) |
| 68 this.incomingReceiver_.accept(message); | 68 this.incomingReceiver_.accept(message); |
| 69 } | 69 } |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 var exports = {}; | 72 var exports = {}; |
| 73 exports.Router = Router; | 73 exports.Router = Router; |
| 74 return exports; | 74 return exports; |
| 75 }); | 75 }); |
| OLD | NEW |