Chromium Code Reviews| Index: mojo/public/js/validator.js |
| diff --git a/mojo/public/js/validator.js b/mojo/public/js/validator.js |
| index 9f2b7cf4db141f3eab218b4e79ce89e69e9c4fa2..b2e6f8678c459b9c534797c103107c8718f44792 100644 |
| --- a/mojo/public/js/validator.js |
| +++ b/mojo/public/js/validator.js |
| @@ -210,6 +210,48 @@ define("mojo/public/js/validator", [ |
| return validationError.NONE; |
| }; |
| + Validator.prototype.validateMessageIsRequestWithoutResponse = function() { |
| + if (this.message.isResponse() || this.message.expectsResponse()) { |
| + return validationError.MESSAGE_HEADER_INVALID_FLAGS; |
| + } |
| + return validationError.NONE; |
| + }; |
| + |
| + Validator.prototype.validateMessageIsRequestExpectingResponse = function() { |
| + if (this.message.isResponse() || !this.message.expectsResponse()) { |
| + return validationError.MESSAGE_HEADER_INVALID_FLAGS; |
| + } |
| + return validationError.NONE; |
| + }; |
| + |
| + Validator.prototype.validateMessageIsResponse = function() { |
| + if (this.message.expectsResponse() || !this.message.isResponse()) { |
| + return validationError.MESSAGE_HEADER_INVALID_FLAGS; |
| + } |
| + return validationError.NONE; |
| + }; |
| + |
| + Validator.prototype.validateMessageIsRequestWithoutResponse = function() { |
|
yzshen1
2017/02/13 23:44:23
Please remove redundant ones.
wangjimmy
2017/02/14 00:06:06
Done.
|
| + if (this.message.isResponse() || this.message.expectsResponse()) { |
| + return validationError.MESSAGE_HEADER_INVALID_FLAGS; |
| + } |
| + return validationError.NONE; |
| + }; |
| + |
| + Validator.prototype.validateMessageIsRequestExpectingResponse = function() { |
| + if (this.message.isResponse() || !this.message.expectsResponse()) { |
| + return validationError.MESSAGE_HEADER_INVALID_FLAGS; |
| + } |
| + return validationError.NONE; |
| + }; |
| + |
| + Validator.prototype.validateMessageIsResponse = function() { |
| + if (this.message.expectsResponse() || !this.message.isResponse()) { |
| + return validationError.MESSAGE_HEADER_INVALID_FLAGS; |
| + } |
| + return validationError.NONE; |
| + }; |
| + |
| // Returns the message.buffer relative offset this pointer "points to", |
| // NULL_MOJO_POINTER if the pointer represents a null, or JS null if the |
| // pointer's value is not valid. |