text: // mojo/public/cpp/bindings/tests/interface_unittest.test-mojom.js is auto generated by mojom_bindings_generator.py, do not edit
  
  // Copyright 2014 The Chromium Authors. All rights reserved.
  // 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 = 'mojo/public/cpp/bindings/tests/interface_unittest.test-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('mojo.test.interfaceUnittest.mojom');
  
  
  
    function VeryCoolInterface_DoesNotMatter_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    VeryCoolInterface_DoesNotMatter_Params.prototype.initDefaults_ = function() {
    };
    VeryCoolInterface_DoesNotMatter_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    VeryCoolInterface_DoesNotMatter_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;
    };
  
    VeryCoolInterface_DoesNotMatter_Params.encodedSize = codec.kStructHeaderSize + 0;
  
    VeryCoolInterface_DoesNotMatter_Params.decode = function(decoder) {
      var packed;
      var val = new VeryCoolInterface_DoesNotMatter_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    VeryCoolInterface_DoesNotMatter_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(VeryCoolInterface_DoesNotMatter_Params.encodedSize);
      encoder.writeUint32(0);
    };
    var kVeryCoolInterface_DoesNotMatter_Name = 1279067163;
  
    function VeryCoolInterfacePtr(handleOrPtrInfo) {
      this.ptr = new bindings.InterfacePtrController(VeryCoolInterface,
                                                     handleOrPtrInfo);
    }
  
    function VeryCoolInterfaceAssociatedPtr(associatedInterfacePtrInfo) {
      this.ptr = new associatedBindings.AssociatedInterfacePtrController(
          VeryCoolInterface, associatedInterfacePtrInfo);
    }
  
    VeryCoolInterfaceAssociatedPtr.prototype =
        Object.create(VeryCoolInterfacePtr.prototype);
    VeryCoolInterfaceAssociatedPtr.prototype.constructor =
        VeryCoolInterfaceAssociatedPtr;
  
    function VeryCoolInterfaceProxy(receiver) {
      this.receiver_ = receiver;
    }
    VeryCoolInterfacePtr.prototype.doesNotMatter = function() {
      return VeryCoolInterfaceProxy.prototype.doesNotMatter
          .apply(this.ptr.getProxy(), arguments);
    };
  
    VeryCoolInterfaceProxy.prototype.doesNotMatter = function() {
      var params_ = new VeryCoolInterface_DoesNotMatter_Params();
      var builder = new codec.MessageV0Builder(
          kVeryCoolInterface_DoesNotMatter_Name,
          codec.align(VeryCoolInterface_DoesNotMatter_Params.encodedSize));
      builder.encodeStruct(VeryCoolInterface_DoesNotMatter_Params, params_);
      var message = builder.finish();
      this.receiver_.accept(message);
    };
  
    function VeryCoolInterfaceStub(delegate) {
      this.delegate_ = delegate;
    }
    VeryCoolInterfaceStub.prototype.doesNotMatter = function() {
      return this.delegate_ && this.delegate_.doesNotMatter && this.delegate_.doesNotMatter();
    }
  
    VeryCoolInterfaceStub.prototype.accept = function(message) {
      var reader = new codec.MessageReader(message);
      switch (reader.messageName) {
      case kVeryCoolInterface_DoesNotMatter_Name:
        var params = reader.decodeStruct(VeryCoolInterface_DoesNotMatter_Params);
        this.doesNotMatter();
        return true;
      default:
        return false;
      }
    };
  
    VeryCoolInterfaceStub.prototype.acceptWithResponder =
        function(message, responder) {
      var reader = new codec.MessageReader(message);
      switch (reader.messageName) {
      default:
        return false;
      }
    };
  
    function validateVeryCoolInterfaceRequest(messageValidator) {
      var message = messageValidator.message;
      var paramsClass = null;
      switch (message.getName()) {
        case kVeryCoolInterface_DoesNotMatter_Name:
          if (!message.expectsResponse() && !message.isResponse())
            paramsClass = VeryCoolInterface_DoesNotMatter_Params;
        break;
      }
      if (paramsClass === null)
        return validator.validationError.NONE;
      return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
    }
  
    function validateVeryCoolInterfaceResponse(messageValidator) {
      return validator.validationError.NONE;
    }
  
    var VeryCoolInterface = {
      name: 'mojo.test.interface_unittest.mojom.VeryCoolInterface',
      kVersion: 0,
      ptrClass: VeryCoolInterfacePtr,
      proxyClass: VeryCoolInterfaceProxy,
      stubClass: VeryCoolInterfaceStub,
      validateRequest: validateVeryCoolInterfaceRequest,
      validateResponse: null,
    };
    VeryCoolInterfaceStub.prototype.validator = validateVeryCoolInterfaceRequest;
    VeryCoolInterfaceProxy.prototype.validator = null;
    exports.VeryCoolInterface = VeryCoolInterface;
    exports.VeryCoolInterfacePtr = VeryCoolInterfacePtr;
    exports.VeryCoolInterfaceAssociatedPtr = VeryCoolInterfaceAssociatedPtr;
  })();