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/js/bindings/connection", [ | 5 define("mojo/public/js/bindings/connection", [ |
6 "mojo/public/js/bindings/router", | 6 "mojo/public/js/bindings/router", |
7 ], function(router) { | 7 ], function(router) { |
8 | 8 |
9 function Connection(handle, localFactory, remoteFactory) { | 9 function Connection(handle, localFactory, remoteFactory) { |
10 this.router_ = new router.Router(handle); | 10 this.router_ = new router.Router(handle); |
11 this.remote = new remoteFactory(this.router_); | 11 this.remote = new remoteFactory(this.router_); |
12 this.local = new localFactory(this.remote); | 12 this.local = new localFactory(this.remote); |
13 this.router_.setIncomingReceiver(this.local); | 13 this.router_.setIncomingReceiver(this.local); |
14 } | 14 } |
15 | 15 |
16 Connection.prototype.close = function() { | 16 Connection.prototype.close = function() { |
17 this.router_.close(); | 17 this.router_.close(); |
18 this.router_ = null; | 18 this.router_ = null; |
19 this.local = null; | 19 this.local = null; |
20 this.remote = null; | 20 this.remote = null; |
21 }; | 21 }; |
22 | 22 |
23 Connection.prototype.setFuzzer = function(fuzzer) { | |
24 this.router_.setFuzzer(fuzzer); | |
25 } | |
abarth-chromium
2014/04/25 00:27:54
We shouldn't need this test code in the production
Matt Perry
2014/04/25 00:30:46
As Adam pointed out to me when I tried this, you c
Tom Sepez
2014/04/25 18:30:34
Yep. Was just trying to preserve some sort of lay
| |
26 | |
23 Connection.prototype.encounteredError = function() { | 27 Connection.prototype.encounteredError = function() { |
24 return this.router_.encounteredError(); | 28 return this.router_.encounteredError(); |
25 }; | 29 }; |
26 | 30 |
27 var exports = {}; | 31 var exports = {}; |
28 exports.Connection = Connection; | 32 exports.Connection = Connection; |
29 return exports; | 33 return exports; |
30 }); | 34 }); |
OLD | NEW |