text: // content/browser/conversions/conversion_internals.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 = 'content/browser/conversions/conversion_internals.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('mojom');
    var origin$ =
        mojo.internal.exposeNamespace('url.mojom');
    if (mojo.config.autoLoadMojomDeps) {
      mojo.internal.loadMojomIfNecessary(
          'url/mojom/origin.mojom', '../../../url/mojom/origin.mojom.js');
    }
  
  
  
    function WebUIConversionReport(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    WebUIConversionReport.prototype.initDefaults_ = function() {
      this.impressionData = null;
      this.conversionData = null;
      this.conversionOrigin = null;
      this.reportingOrigin = null;
      this.reportTime = 0;
      this.attributionCredit = 0;
    };
    WebUIConversionReport.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    WebUIConversionReport.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 56}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIConversionReport.impressionData
      err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIConversionReport.conversionData
      err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 8, false)
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIConversionReport.conversionOrigin
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, origin$.Origin, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIConversionReport.reportingOrigin
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, origin$.Origin, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
  
      return validator.validationError.NONE;
    };
  
    WebUIConversionReport.encodedSize = codec.kStructHeaderSize + 48;
  
    WebUIConversionReport.decode = function(decoder) {
      var packed;
      var val = new WebUIConversionReport();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.impressionData =
          decoder.decodeStruct(codec.String);
      val.conversionData =
          decoder.decodeStruct(codec.String);
      val.conversionOrigin =
          decoder.decodeStructPointer(origin$.Origin);
      val.reportingOrigin =
          decoder.decodeStructPointer(origin$.Origin);
      val.reportTime =
          decoder.decodeStruct(codec.Double);
      val.attributionCredit =
          decoder.decodeStruct(codec.Int32);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      return val;
    };
  
    WebUIConversionReport.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(WebUIConversionReport.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStruct(codec.String, val.impressionData);
      encoder.encodeStruct(codec.String, val.conversionData);
      encoder.encodeStructPointer(origin$.Origin, val.conversionOrigin);
      encoder.encodeStructPointer(origin$.Origin, val.reportingOrigin);
      encoder.encodeStruct(codec.Double, val.reportTime);
      encoder.encodeStruct(codec.Int32, val.attributionCredit);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
    };
    function WebUIImpression(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    WebUIImpression.prototype.initDefaults_ = function() {
      this.impressionData = null;
      this.impressionOrigin = null;
      this.conversionDestination = null;
      this.reportingOrigin = null;
      this.impressionTime = 0;
      this.expiryTime = 0;
    };
    WebUIImpression.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    WebUIImpression.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 56}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIImpression.impressionData
      err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIImpression.impressionOrigin
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, origin$.Origin, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIImpression.conversionDestination
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, origin$.Origin, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate WebUIImpression.reportingOrigin
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, origin$.Origin, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
  
      return validator.validationError.NONE;
    };
  
    WebUIImpression.encodedSize = codec.kStructHeaderSize + 48;
  
    WebUIImpression.decode = function(decoder) {
      var packed;
      var val = new WebUIImpression();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.impressionData =
          decoder.decodeStruct(codec.String);
      val.impressionOrigin =
          decoder.decodeStructPointer(origin$.Origin);
      val.conversionDestination =
          decoder.decodeStructPointer(origin$.Origin);
      val.reportingOrigin =
          decoder.decodeStructPointer(origin$.Origin);
      val.impressionTime =
          decoder.decodeStruct(codec.Double);
      val.expiryTime =
          decoder.decodeStruct(codec.Double);
      return val;
    };
  
    WebUIImpression.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(WebUIImpression.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStruct(codec.String, val.impressionData);
      encoder.encodeStructPointer(origin$.Origin, val.impressionOrigin);
      encoder.encodeStructPointer(origin$.Origin, val.conversionDestination);
      encoder.encodeStructPointer(origin$.Origin, val.reportingOrigin);
      encoder.encodeStruct(codec.Double, val.impressionTime);
      encoder.encodeStruct(codec.Double, val.expiryTime);
    };
    function ConversionInternalsHandler_IsMeasurementEnabled_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_IsMeasurementEnabled_Params.prototype.initDefaults_ = function() {
    };
    ConversionInternalsHandler_IsMeasurementEnabled_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_IsMeasurementEnabled_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;
    };
  
    ConversionInternalsHandler_IsMeasurementEnabled_Params.encodedSize = codec.kStructHeaderSize + 0;
  
    ConversionInternalsHandler_IsMeasurementEnabled_Params.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_IsMeasurementEnabled_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    ConversionInternalsHandler_IsMeasurementEnabled_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_IsMeasurementEnabled_Params.encodedSize);
      encoder.writeUint32(0);
    };
    function ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.prototype.initDefaults_ = function() {
      this.enabled = false;
    };
    ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 16}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      return validator.validationError.NONE;
    };
  
    ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
  
    ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      packed = decoder.readUint8();
      val.enabled = (packed >> 0) & 1 ? true : false;
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      return val;
    };
  
    ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.encodedSize);
      encoder.writeUint32(0);
      packed = 0;
      packed |= (val.enabled & 1) << 0
      encoder.writeUint8(packed);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
    };
    function ConversionInternalsHandler_GetActiveImpressions_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_GetActiveImpressions_Params.prototype.initDefaults_ = function() {
    };
    ConversionInternalsHandler_GetActiveImpressions_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_GetActiveImpressions_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;
    };
  
    ConversionInternalsHandler_GetActiveImpressions_Params.encodedSize = codec.kStructHeaderSize + 0;
  
    ConversionInternalsHandler_GetActiveImpressions_Params.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_GetActiveImpressions_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    ConversionInternalsHandler_GetActiveImpressions_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_GetActiveImpressions_Params.encodedSize);
      encoder.writeUint32(0);
    };
    function ConversionInternalsHandler_GetActiveImpressions_ResponseParams(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_GetActiveImpressions_ResponseParams.prototype.initDefaults_ = function() {
      this.impressions = null;
    };
    ConversionInternalsHandler_GetActiveImpressions_ResponseParams.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_GetActiveImpressions_ResponseParams.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 16}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate ConversionInternalsHandler_GetActiveImpressions_ResponseParams.impressions
      err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(WebUIImpression), false, [0], 0);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    ConversionInternalsHandler_GetActiveImpressions_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
  
    ConversionInternalsHandler_GetActiveImpressions_ResponseParams.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_GetActiveImpressions_ResponseParams();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.impressions =
          decoder.decodeArrayPointer(new codec.PointerTo(WebUIImpression));
      return val;
    };
  
    ConversionInternalsHandler_GetActiveImpressions_ResponseParams.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_GetActiveImpressions_ResponseParams.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeArrayPointer(new codec.PointerTo(WebUIImpression), val.impressions);
    };
    function ConversionInternalsHandler_GetPendingReports_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_GetPendingReports_Params.prototype.initDefaults_ = function() {
    };
    ConversionInternalsHandler_GetPendingReports_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_GetPendingReports_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;
    };
  
    ConversionInternalsHandler_GetPendingReports_Params.encodedSize = codec.kStructHeaderSize + 0;
  
    ConversionInternalsHandler_GetPendingReports_Params.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_GetPendingReports_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    ConversionInternalsHandler_GetPendingReports_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_GetPendingReports_Params.encodedSize);
      encoder.writeUint32(0);
    };
    function ConversionInternalsHandler_GetPendingReports_ResponseParams(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_GetPendingReports_ResponseParams.prototype.initDefaults_ = function() {
      this.reports = null;
    };
    ConversionInternalsHandler_GetPendingReports_ResponseParams.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_GetPendingReports_ResponseParams.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 16}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate ConversionInternalsHandler_GetPendingReports_ResponseParams.reports
      err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(WebUIConversionReport), false, [0], 0);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    ConversionInternalsHandler_GetPendingReports_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
  
    ConversionInternalsHandler_GetPendingReports_ResponseParams.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_GetPendingReports_ResponseParams();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.reports =
          decoder.decodeArrayPointer(new codec.PointerTo(WebUIConversionReport));
      return val;
    };
  
    ConversionInternalsHandler_GetPendingReports_ResponseParams.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_GetPendingReports_ResponseParams.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeArrayPointer(new codec.PointerTo(WebUIConversionReport), val.reports);
    };
    function ConversionInternalsHandler_SendPendingReports_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_SendPendingReports_Params.prototype.initDefaults_ = function() {
    };
    ConversionInternalsHandler_SendPendingReports_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_SendPendingReports_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;
    };
  
    ConversionInternalsHandler_SendPendingReports_Params.encodedSize = codec.kStructHeaderSize + 0;
  
    ConversionInternalsHandler_SendPendingReports_Params.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_SendPendingReports_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    ConversionInternalsHandler_SendPendingReports_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_SendPendingReports_Params.encodedSize);
      encoder.writeUint32(0);
    };
    function ConversionInternalsHandler_SendPendingReports_ResponseParams(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_SendPendingReports_ResponseParams.prototype.initDefaults_ = function() {
    };
    ConversionInternalsHandler_SendPendingReports_ResponseParams.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_SendPendingReports_ResponseParams.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;
    };
  
    ConversionInternalsHandler_SendPendingReports_ResponseParams.encodedSize = codec.kStructHeaderSize + 0;
  
    ConversionInternalsHandler_SendPendingReports_ResponseParams.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_SendPendingReports_ResponseParams();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    ConversionInternalsHandler_SendPendingReports_ResponseParams.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_SendPendingReports_ResponseParams.encodedSize);
      encoder.writeUint32(0);
    };
    function ConversionInternalsHandler_ClearStorage_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_ClearStorage_Params.prototype.initDefaults_ = function() {
    };
    ConversionInternalsHandler_ClearStorage_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_ClearStorage_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;
    };
  
    ConversionInternalsHandler_ClearStorage_Params.encodedSize = codec.kStructHeaderSize + 0;
  
    ConversionInternalsHandler_ClearStorage_Params.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_ClearStorage_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    ConversionInternalsHandler_ClearStorage_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_ClearStorage_Params.encodedSize);
      encoder.writeUint32(0);
    };
    function ConversionInternalsHandler_ClearStorage_ResponseParams(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    ConversionInternalsHandler_ClearStorage_ResponseParams.prototype.initDefaults_ = function() {
    };
    ConversionInternalsHandler_ClearStorage_ResponseParams.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    ConversionInternalsHandler_ClearStorage_ResponseParams.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;
    };
  
    ConversionInternalsHandler_ClearStorage_ResponseParams.encodedSize = codec.kStructHeaderSize + 0;
  
    ConversionInternalsHandler_ClearStorage_ResponseParams.decode = function(decoder) {
      var packed;
      var val = new ConversionInternalsHandler_ClearStorage_ResponseParams();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    ConversionInternalsHandler_ClearStorage_ResponseParams.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(ConversionInternalsHandler_ClearStorage_ResponseParams.encodedSize);
      encoder.writeUint32(0);
    };
    var kConversionInternalsHandler_IsMeasurementEnabled_Name = 1498041839;
    var kConversionInternalsHandler_GetActiveImpressions_Name = 64536551;
    var kConversionInternalsHandler_GetPendingReports_Name = 1772825758;
    var kConversionInternalsHandler_SendPendingReports_Name = 1705525216;
    var kConversionInternalsHandler_ClearStorage_Name = 1228212206;
  
    function ConversionInternalsHandlerPtr(handleOrPtrInfo) {
      this.ptr = new bindings.InterfacePtrController(ConversionInternalsHandler,
                                                     handleOrPtrInfo);
    }
  
    function ConversionInternalsHandlerAssociatedPtr(associatedInterfacePtrInfo) {
      this.ptr = new associatedBindings.AssociatedInterfacePtrController(
          ConversionInternalsHandler, associatedInterfacePtrInfo);
    }
  
    ConversionInternalsHandlerAssociatedPtr.prototype =
        Object.create(ConversionInternalsHandlerPtr.prototype);
    ConversionInternalsHandlerAssociatedPtr.prototype.constructor =
        ConversionInternalsHandlerAssociatedPtr;
  
    function ConversionInternalsHandlerProxy(receiver) {
      this.receiver_ = receiver;
    }
    ConversionInternalsHandlerPtr.prototype.isMeasurementEnabled = function() {
      return ConversionInternalsHandlerProxy.prototype.isMeasurementEnabled
          .apply(this.ptr.getProxy(), arguments);
    };
  
    ConversionInternalsHandlerProxy.prototype.isMeasurementEnabled = function() {
      var params_ = new ConversionInternalsHandler_IsMeasurementEnabled_Params();
      return new Promise(function(resolve, reject) {
        var builder = new codec.MessageV1Builder(
            kConversionInternalsHandler_IsMeasurementEnabled_Name,
            codec.align(ConversionInternalsHandler_IsMeasurementEnabled_Params.encodedSize),
            codec.kMessageExpectsResponse, 0);
        builder.encodeStruct(ConversionInternalsHandler_IsMeasurementEnabled_Params, params_);
        var message = builder.finish();
        this.receiver_.acceptAndExpectResponse(message).then(function(message) {
          var reader = new codec.MessageReader(message);
          var responseParams =
              reader.decodeStruct(ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams);
          resolve(responseParams);
        }).catch(function(result) {
          reject(Error("Connection error: " + result));
        });
      }.bind(this));
    };
    ConversionInternalsHandlerPtr.prototype.getActiveImpressions = function() {
      return ConversionInternalsHandlerProxy.prototype.getActiveImpressions
          .apply(this.ptr.getProxy(), arguments);
    };
  
    ConversionInternalsHandlerProxy.prototype.getActiveImpressions = function() {
      var params_ = new ConversionInternalsHandler_GetActiveImpressions_Params();
      return new Promise(function(resolve, reject) {
        var builder = new codec.MessageV1Builder(
            kConversionInternalsHandler_GetActiveImpressions_Name,
            codec.align(ConversionInternalsHandler_GetActiveImpressions_Params.encodedSize),
            codec.kMessageExpectsResponse, 0);
        builder.encodeStruct(ConversionInternalsHandler_GetActiveImpressions_Params, params_);
        var message = builder.finish();
        this.receiver_.acceptAndExpectResponse(message).then(function(message) {
          var reader = new codec.MessageReader(message);
          var responseParams =
              reader.decodeStruct(ConversionInternalsHandler_GetActiveImpressions_ResponseParams);
          resolve(responseParams);
        }).catch(function(result) {
          reject(Error("Connection error: " + result));
        });
      }.bind(this));
    };
    ConversionInternalsHandlerPtr.prototype.getPendingReports = function() {
      return ConversionInternalsHandlerProxy.prototype.getPendingReports
          .apply(this.ptr.getProxy(), arguments);
    };
  
    ConversionInternalsHandlerProxy.prototype.getPendingReports = function() {
      var params_ = new ConversionInternalsHandler_GetPendingReports_Params();
      return new Promise(function(resolve, reject) {
        var builder = new codec.MessageV1Builder(
            kConversionInternalsHandler_GetPendingReports_Name,
            codec.align(ConversionInternalsHandler_GetPendingReports_Params.encodedSize),
            codec.kMessageExpectsResponse, 0);
        builder.encodeStruct(ConversionInternalsHandler_GetPendingReports_Params, params_);
        var message = builder.finish();
        this.receiver_.acceptAndExpectResponse(message).then(function(message) {
          var reader = new codec.MessageReader(message);
          var responseParams =
              reader.decodeStruct(ConversionInternalsHandler_GetPendingReports_ResponseParams);
          resolve(responseParams);
        }).catch(function(result) {
          reject(Error("Connection error: " + result));
        });
      }.bind(this));
    };
    ConversionInternalsHandlerPtr.prototype.sendPendingReports = function() {
      return ConversionInternalsHandlerProxy.prototype.sendPendingReports
          .apply(this.ptr.getProxy(), arguments);
    };
  
    ConversionInternalsHandlerProxy.prototype.sendPendingReports = function() {
      var params_ = new ConversionInternalsHandler_SendPendingReports_Params();
      return new Promise(function(resolve, reject) {
        var builder = new codec.MessageV1Builder(
            kConversionInternalsHandler_SendPendingReports_Name,
            codec.align(ConversionInternalsHandler_SendPendingReports_Params.encodedSize),
            codec.kMessageExpectsResponse, 0);
        builder.encodeStruct(ConversionInternalsHandler_SendPendingReports_Params, params_);
        var message = builder.finish();
        this.receiver_.acceptAndExpectResponse(message).then(function(message) {
          var reader = new codec.MessageReader(message);
          var responseParams =
              reader.decodeStruct(ConversionInternalsHandler_SendPendingReports_ResponseParams);
          resolve(responseParams);
        }).catch(function(result) {
          reject(Error("Connection error: " + result));
        });
      }.bind(this));
    };
    ConversionInternalsHandlerPtr.prototype.clearStorage = function() {
      return ConversionInternalsHandlerProxy.prototype.clearStorage
          .apply(this.ptr.getProxy(), arguments);
    };
  
    ConversionInternalsHandlerProxy.prototype.clearStorage = function() {
      var params_ = new ConversionInternalsHandler_ClearStorage_Params();
      return new Promise(function(resolve, reject) {
        var builder = new codec.MessageV1Builder(
            kConversionInternalsHandler_ClearStorage_Name,
            codec.align(ConversionInternalsHandler_ClearStorage_Params.encodedSize),
            codec.kMessageExpectsResponse, 0);
        builder.encodeStruct(ConversionInternalsHandler_ClearStorage_Params, params_);
        var message = builder.finish();
        this.receiver_.acceptAndExpectResponse(message).then(function(message) {
          var reader = new codec.MessageReader(message);
          var responseParams =
              reader.decodeStruct(ConversionInternalsHandler_ClearStorage_ResponseParams);
          resolve(responseParams);
        }).catch(function(result) {
          reject(Error("Connection error: " + result));
        });
      }.bind(this));
    };
  
    function ConversionInternalsHandlerStub(delegate) {
      this.delegate_ = delegate;
    }
    ConversionInternalsHandlerStub.prototype.isMeasurementEnabled = function() {
      return this.delegate_ && this.delegate_.isMeasurementEnabled && this.delegate_.isMeasurementEnabled();
    }
    ConversionInternalsHandlerStub.prototype.getActiveImpressions = function() {
      return this.delegate_ && this.delegate_.getActiveImpressions && this.delegate_.getActiveImpressions();
    }
    ConversionInternalsHandlerStub.prototype.getPendingReports = function() {
      return this.delegate_ && this.delegate_.getPendingReports && this.delegate_.getPendingReports();
    }
    ConversionInternalsHandlerStub.prototype.sendPendingReports = function() {
      return this.delegate_ && this.delegate_.sendPendingReports && this.delegate_.sendPendingReports();
    }
    ConversionInternalsHandlerStub.prototype.clearStorage = function() {
      return this.delegate_ && this.delegate_.clearStorage && this.delegate_.clearStorage();
    }
  
    ConversionInternalsHandlerStub.prototype.accept = function(message) {
      var reader = new codec.MessageReader(message);
      switch (reader.messageName) {
      default:
        return false;
      }
    };
  
    ConversionInternalsHandlerStub.prototype.acceptWithResponder =
        function(message, responder) {
      var reader = new codec.MessageReader(message);
      switch (reader.messageName) {
      case kConversionInternalsHandler_IsMeasurementEnabled_Name:
        var params = reader.decodeStruct(ConversionInternalsHandler_IsMeasurementEnabled_Params);
        this.isMeasurementEnabled().then(function(response) {
          var responseParams =
              new ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams();
          responseParams.enabled = response.enabled;
          var builder = new codec.MessageV1Builder(
              kConversionInternalsHandler_IsMeasurementEnabled_Name,
              codec.align(ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams.encodedSize),
              codec.kMessageIsResponse, reader.requestID);
          builder.encodeStruct(ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams,
                               responseParams);
          var message = builder.finish();
          responder.accept(message);
        });
        return true;
      case kConversionInternalsHandler_GetActiveImpressions_Name:
        var params = reader.decodeStruct(ConversionInternalsHandler_GetActiveImpressions_Params);
        this.getActiveImpressions().then(function(response) {
          var responseParams =
              new ConversionInternalsHandler_GetActiveImpressions_ResponseParams();
          responseParams.impressions = response.impressions;
          var builder = new codec.MessageV1Builder(
              kConversionInternalsHandler_GetActiveImpressions_Name,
              codec.align(ConversionInternalsHandler_GetActiveImpressions_ResponseParams.encodedSize),
              codec.kMessageIsResponse, reader.requestID);
          builder.encodeStruct(ConversionInternalsHandler_GetActiveImpressions_ResponseParams,
                               responseParams);
          var message = builder.finish();
          responder.accept(message);
        });
        return true;
      case kConversionInternalsHandler_GetPendingReports_Name:
        var params = reader.decodeStruct(ConversionInternalsHandler_GetPendingReports_Params);
        this.getPendingReports().then(function(response) {
          var responseParams =
              new ConversionInternalsHandler_GetPendingReports_ResponseParams();
          responseParams.reports = response.reports;
          var builder = new codec.MessageV1Builder(
              kConversionInternalsHandler_GetPendingReports_Name,
              codec.align(ConversionInternalsHandler_GetPendingReports_ResponseParams.encodedSize),
              codec.kMessageIsResponse, reader.requestID);
          builder.encodeStruct(ConversionInternalsHandler_GetPendingReports_ResponseParams,
                               responseParams);
          var message = builder.finish();
          responder.accept(message);
        });
        return true;
      case kConversionInternalsHandler_SendPendingReports_Name:
        var params = reader.decodeStruct(ConversionInternalsHandler_SendPendingReports_Params);
        this.sendPendingReports().then(function(response) {
          var responseParams =
              new ConversionInternalsHandler_SendPendingReports_ResponseParams();
          var builder = new codec.MessageV1Builder(
              kConversionInternalsHandler_SendPendingReports_Name,
              codec.align(ConversionInternalsHandler_SendPendingReports_ResponseParams.encodedSize),
              codec.kMessageIsResponse, reader.requestID);
          builder.encodeStruct(ConversionInternalsHandler_SendPendingReports_ResponseParams,
                               responseParams);
          var message = builder.finish();
          responder.accept(message);
        });
        return true;
      case kConversionInternalsHandler_ClearStorage_Name:
        var params = reader.decodeStruct(ConversionInternalsHandler_ClearStorage_Params);
        this.clearStorage().then(function(response) {
          var responseParams =
              new ConversionInternalsHandler_ClearStorage_ResponseParams();
          var builder = new codec.MessageV1Builder(
              kConversionInternalsHandler_ClearStorage_Name,
              codec.align(ConversionInternalsHandler_ClearStorage_ResponseParams.encodedSize),
              codec.kMessageIsResponse, reader.requestID);
          builder.encodeStruct(ConversionInternalsHandler_ClearStorage_ResponseParams,
                               responseParams);
          var message = builder.finish();
          responder.accept(message);
        });
        return true;
      default:
        return false;
      }
    };
  
    function validateConversionInternalsHandlerRequest(messageValidator) {
      var message = messageValidator.message;
      var paramsClass = null;
      switch (message.getName()) {
        case kConversionInternalsHandler_IsMeasurementEnabled_Name:
          if (message.expectsResponse())
            paramsClass = ConversionInternalsHandler_IsMeasurementEnabled_Params;
        break;
        case kConversionInternalsHandler_GetActiveImpressions_Name:
          if (message.expectsResponse())
            paramsClass = ConversionInternalsHandler_GetActiveImpressions_Params;
        break;
        case kConversionInternalsHandler_GetPendingReports_Name:
          if (message.expectsResponse())
            paramsClass = ConversionInternalsHandler_GetPendingReports_Params;
        break;
        case kConversionInternalsHandler_SendPendingReports_Name:
          if (message.expectsResponse())
            paramsClass = ConversionInternalsHandler_SendPendingReports_Params;
        break;
        case kConversionInternalsHandler_ClearStorage_Name:
          if (message.expectsResponse())
            paramsClass = ConversionInternalsHandler_ClearStorage_Params;
        break;
      }
      if (paramsClass === null)
        return validator.validationError.NONE;
      return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
    }
  
    function validateConversionInternalsHandlerResponse(messageValidator) {
     var message = messageValidator.message;
     var paramsClass = null;
     switch (message.getName()) {
        case kConversionInternalsHandler_IsMeasurementEnabled_Name:
          if (message.isResponse())
            paramsClass = ConversionInternalsHandler_IsMeasurementEnabled_ResponseParams;
          break;
        case kConversionInternalsHandler_GetActiveImpressions_Name:
          if (message.isResponse())
            paramsClass = ConversionInternalsHandler_GetActiveImpressions_ResponseParams;
          break;
        case kConversionInternalsHandler_GetPendingReports_Name:
          if (message.isResponse())
            paramsClass = ConversionInternalsHandler_GetPendingReports_ResponseParams;
          break;
        case kConversionInternalsHandler_SendPendingReports_Name:
          if (message.isResponse())
            paramsClass = ConversionInternalsHandler_SendPendingReports_ResponseParams;
          break;
        case kConversionInternalsHandler_ClearStorage_Name:
          if (message.isResponse())
            paramsClass = ConversionInternalsHandler_ClearStorage_ResponseParams;
          break;
      }
      if (paramsClass === null)
        return validator.validationError.NONE;
      return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
    }
  
    var ConversionInternalsHandler = {
      name: 'mojom.ConversionInternalsHandler',
      kVersion: 0,
      ptrClass: ConversionInternalsHandlerPtr,
      proxyClass: ConversionInternalsHandlerProxy,
      stubClass: ConversionInternalsHandlerStub,
      validateRequest: validateConversionInternalsHandlerRequest,
      validateResponse: validateConversionInternalsHandlerResponse,
    };
    ConversionInternalsHandlerStub.prototype.validator = validateConversionInternalsHandlerRequest;
    ConversionInternalsHandlerProxy.prototype.validator = validateConversionInternalsHandlerResponse;
    exports.WebUIConversionReport = WebUIConversionReport;
    exports.WebUIImpression = WebUIImpression;
    exports.ConversionInternalsHandler = ConversionInternalsHandler;
    exports.ConversionInternalsHandlerPtr = ConversionInternalsHandlerPtr;
    exports.ConversionInternalsHandlerAssociatedPtr = ConversionInternalsHandlerAssociatedPtr;
  })();