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
3 // found in the LICENSE file.
5 define("mojo/public/js/bindings/connection", [
6 "mojo/public/js/bindings/router",
9 function Connection(handle, localFactory, remoteFactory) {
10 this.router_ = new router.Router(handle);
11 this.remote = new remoteFactory(this.router_);
12 this.local = new localFactory(this.remote);
13 this.router_.setIncomingReceiver(this.local);
16 Connection.prototype.close = function() {
23 Connection.prototype.encounteredError = function() {
24 return this.router_.encounteredError();
28 exports.Connection = Connection;