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

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

Issue 488173006: Integrate Mojo JS validation bindings with the Router (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final changes Created 6 years, 4 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 | « no previous file | mojo/public/js/bindings/router.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/bindings/connection.js
diff --git a/mojo/public/js/bindings/connection.js b/mojo/public/js/bindings/connection.js
index ebf60adb7f8de5a94014d762db9c1ecbc0d8c356..03bb76811ec0bd9bcf8a8f891e339cf1ae4ce4b1 100644
--- a/mojo/public/js/bindings/connection.js
+++ b/mojo/public/js/bindings/connection.js
@@ -11,6 +11,15 @@ define("mojo/public/js/bindings/connection", [
this.remote = new remoteFactory(this.router_);
this.local = new localFactory(this.remote);
this.router_.setIncomingReceiver(this.local);
+
+ var validateRequest = localFactory.prototype.validator;
+ var validateResponse = remoteFactory.prototype.validator;
+ var payloadValidators = [];
+ if (validateRequest)
+ payloadValidators.push(validateRequest);
+ if (validateResponse)
+ payloadValidators.push(validateResponse);
+ this.router_.setPayloadValidators(payloadValidators);
}
Connection.prototype.close = function() {
« no previous file with comments | « no previous file | mojo/public/js/bindings/router.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698