Index: mojo/public/js/bindings.js |
diff --git a/mojo/public/js/bindings.js b/mojo/public/js/bindings.js |
index ed00554eb9a1036782443ef48b7b0f5e238436c4..94a687d2de292f0731f36676224c0ad6f80455ed 100644 |
--- a/mojo/public/js/bindings.js |
+++ b/mojo/public/js/bindings.js |
@@ -263,10 +263,11 @@ define("mojo/public/js/bindings", [ |
bindingId) { |
this.bindingSet_ = bindingSet; |
this.bindingId_ = bindingId; |
- this.binding_ = new Binding(interfaceType, impl, requestOrHandle); |
+ this.binding_ = new bindingSet.bindingType(interfaceType, impl, |
+ requestOrHandle); |
- this.binding_.setConnectionErrorHandler(function() { |
- this.bindingSet_.onConnectionError(bindingId); |
+ this.binding_.setConnectionErrorHandler(function(reason) { |
+ this.bindingSet_.onConnectionError(bindingId, reason); |
}.bind(this)); |
} |
@@ -279,6 +280,7 @@ define("mojo/public/js/bindings", [ |
this.nextBindingId_ = 0; |
this.bindings_ = new Map(); |
this.errorHandler_ = null; |
+ this.bindingType = Binding; |
} |
BindingSet.prototype.isEmpty = function() { |
@@ -303,11 +305,11 @@ define("mojo/public/js/bindings", [ |
this.errorHandler_ = callback; |
}; |
- BindingSet.prototype.onConnectionError = function(bindingId) { |
+ BindingSet.prototype.onConnectionError = function(bindingId, reason) { |
this.bindings_.delete(bindingId); |
if (this.errorHandler_) |
- this.errorHandler_(); |
+ this.errorHandler_(reason); |
}; |
var exports = {}; |