| // services/audio/public/mojom/testing_api.mojom.js is auto generated by mojom_bindings_generator.py, do not edit |
| |
| // Copyright 2014 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| 'use strict'; |
| |
| (function() { |
| var mojomId = 'services/audio/public/mojom/testing_api.mojom'; |
| if (mojo.internal.isMojomLoaded(mojomId)) { |
| console.warn('The following mojom is loaded multiple times: ' + mojomId); |
| return; |
| } |
| mojo.internal.markMojomLoaded(mojomId); |
| var bindings = mojo; |
| var associatedBindings = mojo; |
| var codec = mojo.internal; |
| var validator = mojo.internal; |
| |
| var exports = mojo.internal.exposeNamespace('audio.mojom'); |
| |
| |
| |
| function TestingApi_Crash_Params(values) { |
| this.initDefaults_(); |
| this.initFields_(values); |
| } |
| |
| |
| TestingApi_Crash_Params.prototype.initDefaults_ = function() { |
| }; |
| TestingApi_Crash_Params.prototype.initFields_ = function(fields) { |
| for(var field in fields) { |
| if (this.hasOwnProperty(field)) |
| this[field] = fields[field]; |
| } |
| }; |
| |
| TestingApi_Crash_Params.validate = function(messageValidator, offset) { |
| var err; |
| err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| var kVersionSizes = [ |
| {version: 0, numBytes: 8} |
| ]; |
| err = messageValidator.validateStructVersion(offset, kVersionSizes); |
| if (err !== validator.validationError.NONE) |
| return err; |
| |
| return validator.validationError.NONE; |
| }; |
| |
| TestingApi_Crash_Params.encodedSize = codec.kStructHeaderSize + 0; |
| |
| TestingApi_Crash_Params.decode = function(decoder) { |
| var packed; |
| var val = new TestingApi_Crash_Params(); |
| var numberOfBytes = decoder.readUint32(); |
| var version = decoder.readUint32(); |
| return val; |
| }; |
| |
| TestingApi_Crash_Params.encode = function(encoder, val) { |
| var packed; |
| encoder.writeUint32(TestingApi_Crash_Params.encodedSize); |
| encoder.writeUint32(0); |
| }; |
| var kTestingApi_Crash_Name = 0; |
| |
| function TestingApiPtr(handleOrPtrInfo) { |
| this.ptr = new bindings.InterfacePtrController(TestingApi, |
| handleOrPtrInfo); |
| } |
| |
| function TestingApiAssociatedPtr(associatedInterfacePtrInfo) { |
| this.ptr = new associatedBindings.AssociatedInterfacePtrController( |
| TestingApi, associatedInterfacePtrInfo); |
| } |
| |
| TestingApiAssociatedPtr.prototype = |
| Object.create(TestingApiPtr.prototype); |
| TestingApiAssociatedPtr.prototype.constructor = |
| TestingApiAssociatedPtr; |
| |
| function TestingApiProxy(receiver) { |
| this.receiver_ = receiver; |
| } |
| TestingApiPtr.prototype.crash = function() { |
| return TestingApiProxy.prototype.crash |
| .apply(this.ptr.getProxy(), arguments); |
| }; |
| |
| TestingApiProxy.prototype.crash = function() { |
| var params_ = new TestingApi_Crash_Params(); |
| var builder = new codec.MessageV0Builder( |
| kTestingApi_Crash_Name, |
| codec.align(TestingApi_Crash_Params.encodedSize)); |
| builder.encodeStruct(TestingApi_Crash_Params, params_); |
| var message = builder.finish(); |
| this.receiver_.accept(message); |
| }; |
| |
| function TestingApiStub(delegate) { |
| this.delegate_ = delegate; |
| } |
| TestingApiStub.prototype.crash = function() { |
| return this.delegate_ && this.delegate_.crash && this.delegate_.crash(); |
| } |
| |
| TestingApiStub.prototype.accept = function(message) { |
| var reader = new codec.MessageReader(message); |
| switch (reader.messageName) { |
| case kTestingApi_Crash_Name: |
| var params = reader.decodeStruct(TestingApi_Crash_Params); |
| this.crash(); |
| return true; |
| default: |
| return false; |
| } |
| }; |
| |
| TestingApiStub.prototype.acceptWithResponder = |
| function(message, responder) { |
| var reader = new codec.MessageReader(message); |
| switch (reader.messageName) { |
| default: |
| return false; |
| } |
| }; |
| |
| function validateTestingApiRequest(messageValidator) { |
| var message = messageValidator.message; |
| var paramsClass = null; |
| switch (message.getName()) { |
| case kTestingApi_Crash_Name: |
| if (!message.expectsResponse() && !message.isResponse()) |
| paramsClass = TestingApi_Crash_Params; |
| break; |
| } |
| if (paramsClass === null) |
| return validator.validationError.NONE; |
| return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes()); |
| } |
| |
| function validateTestingApiResponse(messageValidator) { |
| return validator.validationError.NONE; |
| } |
| |
| var TestingApi = { |
| name: 'audio.mojom.TestingApi', |
| kVersion: 0, |
| ptrClass: TestingApiPtr, |
| proxyClass: TestingApiProxy, |
| stubClass: TestingApiStub, |
| validateRequest: validateTestingApiRequest, |
| validateResponse: null, |
| }; |
| TestingApiStub.prototype.validator = validateTestingApiRequest; |
| TestingApiProxy.prototype.validator = null; |
| exports.TestingApi = TestingApi; |
| exports.TestingApiPtr = TestingApiPtr; |
| exports.TestingApiAssociatedPtr = TestingApiAssociatedPtr; |
| })(); |