Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: mojo/public/js/bindings.js

Issue 2844133003: Add associated binding set. Add associated_binding.html layout test. (Closed)
Patch Set: Make bindingType private and passed it into BindingSetEntry Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/js/associated_bindings.js ('k') | third_party/WebKit/LayoutTests/mojo/associated_binding.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/bindings.js
diff --git a/mojo/public/js/bindings.js b/mojo/public/js/bindings.js
index ed00554eb9a1036782443ef48b7b0f5e238436c4..0c12c4e46118fd94555c1d48bf4413defe107e44 100644
--- a/mojo/public/js/bindings.js
+++ b/mojo/public/js/bindings.js
@@ -259,14 +259,15 @@ define("mojo/public/js/bindings", [
// ---------------------------------------------------------------------------
- function BindingSetEntry(bindingSet, interfaceType, impl, requestOrHandle,
- bindingId) {
+ function BindingSetEntry(bindingSet, interfaceType, bindingType, impl,
+ requestOrHandle, bindingId) {
this.bindingSet_ = bindingSet;
this.bindingId_ = bindingId;
- this.binding_ = new Binding(interfaceType, impl, requestOrHandle);
+ this.binding_ = new 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() {
@@ -288,8 +290,8 @@ define("mojo/public/js/bindings", [
BindingSet.prototype.addBinding = function(impl, requestOrHandle) {
this.bindings_.set(
this.nextBindingId_,
- new BindingSetEntry(this, this.interfaceType_, impl, requestOrHandle,
- this.nextBindingId_));
+ new BindingSetEntry(this, this.interfaceType_, this.bindingType_, impl,
+ requestOrHandle, this.nextBindingId_));
++this.nextBindingId_;
};
@@ -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 = {};
« no previous file with comments | « mojo/public/js/associated_bindings.js ('k') | third_party/WebKit/LayoutTests/mojo/associated_binding.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698