text: // chrome/browser/ui/webui/discards/site_data.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 = 'chrome/browser/ui/webui/discards/site_data.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('discards.mojom');
  
  
  
    function SiteDataFeature(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataFeature.prototype.initDefaults_ = function() {
      this.observationDuration = 0;
      this.useTimestamp = 0;
    };
    SiteDataFeature.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataFeature.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 24}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
  
      return validator.validationError.NONE;
    };
  
    SiteDataFeature.encodedSize = codec.kStructHeaderSize + 16;
  
    SiteDataFeature.decode = function(decoder) {
      var packed;
      var val = new SiteDataFeature();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.observationDuration =
          decoder.decodeStruct(codec.Int64);
      val.useTimestamp =
          decoder.decodeStruct(codec.Int64);
      return val;
    };
  
    SiteDataFeature.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataFeature.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStruct(codec.Int64, val.observationDuration);
      encoder.encodeStruct(codec.Int64, val.useTimestamp);
    };
    function SiteDataPerformanceMeasurement(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataPerformanceMeasurement.prototype.initDefaults_ = function() {
      this.avgCpuUsageUs = 0;
      this.avgFootprintKb = 0;
      this.avgLoadDurationUs = 0;
    };
    SiteDataPerformanceMeasurement.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataPerformanceMeasurement.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 24}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
  
  
      return validator.validationError.NONE;
    };
  
    SiteDataPerformanceMeasurement.encodedSize = codec.kStructHeaderSize + 16;
  
    SiteDataPerformanceMeasurement.decode = function(decoder) {
      var packed;
      var val = new SiteDataPerformanceMeasurement();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.avgCpuUsageUs =
          decoder.decodeStruct(codec.Float);
      val.avgFootprintKb =
          decoder.decodeStruct(codec.Float);
      val.avgLoadDurationUs =
          decoder.decodeStruct(codec.Float);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      return val;
    };
  
    SiteDataPerformanceMeasurement.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataPerformanceMeasurement.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStruct(codec.Float, val.avgCpuUsageUs);
      encoder.encodeStruct(codec.Float, val.avgFootprintKb);
      encoder.encodeStruct(codec.Float, val.avgLoadDurationUs);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
    };
    function SiteDataDatabaseSize(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataDatabaseSize.prototype.initDefaults_ = function() {
      this.numRows = 0;
      this.onDiskSizeKb = 0;
    };
    SiteDataDatabaseSize.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataDatabaseSize.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 24}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
  
      return validator.validationError.NONE;
    };
  
    SiteDataDatabaseSize.encodedSize = codec.kStructHeaderSize + 16;
  
    SiteDataDatabaseSize.decode = function(decoder) {
      var packed;
      var val = new SiteDataDatabaseSize();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.numRows =
          decoder.decodeStruct(codec.Int64);
      val.onDiskSizeKb =
          decoder.decodeStruct(codec.Int64);
      return val;
    };
  
    SiteDataDatabaseSize.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataDatabaseSize.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStruct(codec.Int64, val.numRows);
      encoder.encodeStruct(codec.Int64, val.onDiskSizeKb);
    };
    function SiteDataValue(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataValue.prototype.initDefaults_ = function() {
      this.lastLoaded = 0;
      this.updatesFaviconInBackground = null;
      this.updatesTitleInBackground = null;
      this.usesAudioInBackground = null;
      this.loadTimeEstimates = null;
    };
    SiteDataValue.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataValue.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 48}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
  
      // validate SiteDataValue.updatesFaviconInBackground
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, SiteDataFeature, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate SiteDataValue.updatesTitleInBackground
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, SiteDataFeature, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate SiteDataValue.usesAudioInBackground
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, SiteDataFeature, false);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate SiteDataValue.loadTimeEstimates
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 32, SiteDataPerformanceMeasurement, true);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    SiteDataValue.encodedSize = codec.kStructHeaderSize + 40;
  
    SiteDataValue.decode = function(decoder) {
      var packed;
      var val = new SiteDataValue();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.lastLoaded =
          decoder.decodeStruct(codec.Uint32);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      decoder.skip(1);
      val.updatesFaviconInBackground =
          decoder.decodeStructPointer(SiteDataFeature);
      val.updatesTitleInBackground =
          decoder.decodeStructPointer(SiteDataFeature);
      val.usesAudioInBackground =
          decoder.decodeStructPointer(SiteDataFeature);
      val.loadTimeEstimates =
          decoder.decodeStructPointer(SiteDataPerformanceMeasurement);
      return val;
    };
  
    SiteDataValue.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataValue.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStruct(codec.Uint32, val.lastLoaded);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.skip(1);
      encoder.encodeStructPointer(SiteDataFeature, val.updatesFaviconInBackground);
      encoder.encodeStructPointer(SiteDataFeature, val.updatesTitleInBackground);
      encoder.encodeStructPointer(SiteDataFeature, val.usesAudioInBackground);
      encoder.encodeStructPointer(SiteDataPerformanceMeasurement, val.loadTimeEstimates);
    };
    function SiteDataEntry(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataEntry.prototype.initDefaults_ = function() {
      this.origin = null;
      this.isDirty = false;
      this.value = null;
    };
    SiteDataEntry.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataEntry.validate = function(messageValidator, offset) {
      var err;
      err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
      if (err !== validator.validationError.NONE)
          return err;
  
      var kVersionSizes = [
        {version: 0, numBytes: 32}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate SiteDataEntry.origin
      err = messageValidator.validateStringPointer(offset + codec.kStructHeaderSize + 0, false)
      if (err !== validator.validationError.NONE)
          return err;
  
  
  
      // validate SiteDataEntry.value
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, SiteDataValue, true);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    SiteDataEntry.encodedSize = codec.kStructHeaderSize + 24;
  
    SiteDataEntry.decode = function(decoder) {
      var packed;
      var val = new SiteDataEntry();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.origin =
          decoder.decodeStruct(codec.String);
      packed = decoder.readUint8();
      val.isDirty = (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);
      val.value =
          decoder.decodeStructPointer(SiteDataValue);
      return val;
    };
  
    SiteDataEntry.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataEntry.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStruct(codec.String, val.origin);
      packed = 0;
      packed |= (val.isDirty & 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);
      encoder.encodeStructPointer(SiteDataValue, val.value);
    };
    function SiteDataArray(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataArray.prototype.initDefaults_ = function() {
      this.dbRows = null;
    };
    SiteDataArray.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataArray.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 SiteDataArray.dbRows
      err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, new codec.PointerTo(SiteDataEntry), false, [0], 0);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    SiteDataArray.encodedSize = codec.kStructHeaderSize + 8;
  
    SiteDataArray.decode = function(decoder) {
      var packed;
      var val = new SiteDataArray();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.dbRows =
          decoder.decodeArrayPointer(new codec.PointerTo(SiteDataEntry));
      return val;
    };
  
    SiteDataArray.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataArray.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeArrayPointer(new codec.PointerTo(SiteDataEntry), val.dbRows);
    };
    function SiteDataProvider_GetSiteDataArray_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataProvider_GetSiteDataArray_Params.prototype.initDefaults_ = function() {
      this.explicitlyRequestedOrigins = null;
    };
    SiteDataProvider_GetSiteDataArray_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataProvider_GetSiteDataArray_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: 16}
      ];
      err = messageValidator.validateStructVersion(offset, kVersionSizes);
      if (err !== validator.validationError.NONE)
          return err;
  
  
      // validate SiteDataProvider_GetSiteDataArray_Params.explicitlyRequestedOrigins
      err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 0, 8, codec.String, false, [0, 0], 0);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    SiteDataProvider_GetSiteDataArray_Params.encodedSize = codec.kStructHeaderSize + 8;
  
    SiteDataProvider_GetSiteDataArray_Params.decode = function(decoder) {
      var packed;
      var val = new SiteDataProvider_GetSiteDataArray_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.explicitlyRequestedOrigins =
          decoder.decodeArrayPointer(codec.String);
      return val;
    };
  
    SiteDataProvider_GetSiteDataArray_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataProvider_GetSiteDataArray_Params.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeArrayPointer(codec.String, val.explicitlyRequestedOrigins);
    };
    function SiteDataProvider_GetSiteDataArray_ResponseParams(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataProvider_GetSiteDataArray_ResponseParams.prototype.initDefaults_ = function() {
      this.result = null;
    };
    SiteDataProvider_GetSiteDataArray_ResponseParams.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataProvider_GetSiteDataArray_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 SiteDataProvider_GetSiteDataArray_ResponseParams.result
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, SiteDataArray, true);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    SiteDataProvider_GetSiteDataArray_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
  
    SiteDataProvider_GetSiteDataArray_ResponseParams.decode = function(decoder) {
      var packed;
      var val = new SiteDataProvider_GetSiteDataArray_ResponseParams();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.result =
          decoder.decodeStructPointer(SiteDataArray);
      return val;
    };
  
    SiteDataProvider_GetSiteDataArray_ResponseParams.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataProvider_GetSiteDataArray_ResponseParams.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStructPointer(SiteDataArray, val.result);
    };
    function SiteDataProvider_GetSiteDataDatabaseSize_Params(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataProvider_GetSiteDataDatabaseSize_Params.prototype.initDefaults_ = function() {
    };
    SiteDataProvider_GetSiteDataDatabaseSize_Params.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataProvider_GetSiteDataDatabaseSize_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;
    };
  
    SiteDataProvider_GetSiteDataDatabaseSize_Params.encodedSize = codec.kStructHeaderSize + 0;
  
    SiteDataProvider_GetSiteDataDatabaseSize_Params.decode = function(decoder) {
      var packed;
      var val = new SiteDataProvider_GetSiteDataDatabaseSize_Params();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      return val;
    };
  
    SiteDataProvider_GetSiteDataDatabaseSize_Params.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataProvider_GetSiteDataDatabaseSize_Params.encodedSize);
      encoder.writeUint32(0);
    };
    function SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams(values) {
      this.initDefaults_();
      this.initFields_(values);
    }
  
  
    SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.prototype.initDefaults_ = function() {
      this.dbSize = null;
    };
    SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.prototype.initFields_ = function(fields) {
      for(var field in fields) {
          if (this.hasOwnProperty(field))
            this[field] = fields[field];
      }
    };
  
    SiteDataProvider_GetSiteDataDatabaseSize_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 SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.dbSize
      err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, SiteDataDatabaseSize, true);
      if (err !== validator.validationError.NONE)
          return err;
  
      return validator.validationError.NONE;
    };
  
    SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
  
    SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.decode = function(decoder) {
      var packed;
      var val = new SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams();
      var numberOfBytes = decoder.readUint32();
      var version = decoder.readUint32();
      val.dbSize =
          decoder.decodeStructPointer(SiteDataDatabaseSize);
      return val;
    };
  
    SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.encode = function(encoder, val) {
      var packed;
      encoder.writeUint32(SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.encodedSize);
      encoder.writeUint32(0);
      encoder.encodeStructPointer(SiteDataDatabaseSize, val.dbSize);
    };
    var kSiteDataProvider_GetSiteDataArray_Name = 637179749;
    var kSiteDataProvider_GetSiteDataDatabaseSize_Name = 1726153625;
  
    function SiteDataProviderPtr(handleOrPtrInfo) {
      this.ptr = new bindings.InterfacePtrController(SiteDataProvider,
                                                     handleOrPtrInfo);
    }
  
    function SiteDataProviderAssociatedPtr(associatedInterfacePtrInfo) {
      this.ptr = new associatedBindings.AssociatedInterfacePtrController(
          SiteDataProvider, associatedInterfacePtrInfo);
    }
  
    SiteDataProviderAssociatedPtr.prototype =
        Object.create(SiteDataProviderPtr.prototype);
    SiteDataProviderAssociatedPtr.prototype.constructor =
        SiteDataProviderAssociatedPtr;
  
    function SiteDataProviderProxy(receiver) {
      this.receiver_ = receiver;
    }
    SiteDataProviderPtr.prototype.getSiteDataArray = function() {
      return SiteDataProviderProxy.prototype.getSiteDataArray
          .apply(this.ptr.getProxy(), arguments);
    };
  
    SiteDataProviderProxy.prototype.getSiteDataArray = function(explicitlyRequestedOrigins) {
      var params_ = new SiteDataProvider_GetSiteDataArray_Params();
      params_.explicitlyRequestedOrigins = explicitlyRequestedOrigins;
      return new Promise(function(resolve, reject) {
        var builder = new codec.MessageV1Builder(
            kSiteDataProvider_GetSiteDataArray_Name,
            codec.align(SiteDataProvider_GetSiteDataArray_Params.encodedSize),
            codec.kMessageExpectsResponse, 0);
        builder.encodeStruct(SiteDataProvider_GetSiteDataArray_Params, params_);
        var message = builder.finish();
        this.receiver_.acceptAndExpectResponse(message).then(function(message) {
          var reader = new codec.MessageReader(message);
          var responseParams =
              reader.decodeStruct(SiteDataProvider_GetSiteDataArray_ResponseParams);
          resolve(responseParams);
        }).catch(function(result) {
          reject(Error("Connection error: " + result));
        });
      }.bind(this));
    };
    SiteDataProviderPtr.prototype.getSiteDataDatabaseSize = function() {
      return SiteDataProviderProxy.prototype.getSiteDataDatabaseSize
          .apply(this.ptr.getProxy(), arguments);
    };
  
    SiteDataProviderProxy.prototype.getSiteDataDatabaseSize = function() {
      var params_ = new SiteDataProvider_GetSiteDataDatabaseSize_Params();
      return new Promise(function(resolve, reject) {
        var builder = new codec.MessageV1Builder(
            kSiteDataProvider_GetSiteDataDatabaseSize_Name,
            codec.align(SiteDataProvider_GetSiteDataDatabaseSize_Params.encodedSize),
            codec.kMessageExpectsResponse, 0);
        builder.encodeStruct(SiteDataProvider_GetSiteDataDatabaseSize_Params, params_);
        var message = builder.finish();
        this.receiver_.acceptAndExpectResponse(message).then(function(message) {
          var reader = new codec.MessageReader(message);
          var responseParams =
              reader.decodeStruct(SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams);
          resolve(responseParams);
        }).catch(function(result) {
          reject(Error("Connection error: " + result));
        });
      }.bind(this));
    };
  
    function SiteDataProviderStub(delegate) {
      this.delegate_ = delegate;
    }
    SiteDataProviderStub.prototype.getSiteDataArray = function(explicitlyRequestedOrigins) {
      return this.delegate_ && this.delegate_.getSiteDataArray && this.delegate_.getSiteDataArray(explicitlyRequestedOrigins);
    }
    SiteDataProviderStub.prototype.getSiteDataDatabaseSize = function() {
      return this.delegate_ && this.delegate_.getSiteDataDatabaseSize && this.delegate_.getSiteDataDatabaseSize();
    }
  
    SiteDataProviderStub.prototype.accept = function(message) {
      var reader = new codec.MessageReader(message);
      switch (reader.messageName) {
      default:
        return false;
      }
    };
  
    SiteDataProviderStub.prototype.acceptWithResponder =
        function(message, responder) {
      var reader = new codec.MessageReader(message);
      switch (reader.messageName) {
      case kSiteDataProvider_GetSiteDataArray_Name:
        var params = reader.decodeStruct(SiteDataProvider_GetSiteDataArray_Params);
        this.getSiteDataArray(params.explicitlyRequestedOrigins).then(function(response) {
          var responseParams =
              new SiteDataProvider_GetSiteDataArray_ResponseParams();
          responseParams.result = response.result;
          var builder = new codec.MessageV1Builder(
              kSiteDataProvider_GetSiteDataArray_Name,
              codec.align(SiteDataProvider_GetSiteDataArray_ResponseParams.encodedSize),
              codec.kMessageIsResponse, reader.requestID);
          builder.encodeStruct(SiteDataProvider_GetSiteDataArray_ResponseParams,
                               responseParams);
          var message = builder.finish();
          responder.accept(message);
        });
        return true;
      case kSiteDataProvider_GetSiteDataDatabaseSize_Name:
        var params = reader.decodeStruct(SiteDataProvider_GetSiteDataDatabaseSize_Params);
        this.getSiteDataDatabaseSize().then(function(response) {
          var responseParams =
              new SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams();
          responseParams.dbSize = response.dbSize;
          var builder = new codec.MessageV1Builder(
              kSiteDataProvider_GetSiteDataDatabaseSize_Name,
              codec.align(SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams.encodedSize),
              codec.kMessageIsResponse, reader.requestID);
          builder.encodeStruct(SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams,
                               responseParams);
          var message = builder.finish();
          responder.accept(message);
        });
        return true;
      default:
        return false;
      }
    };
  
    function validateSiteDataProviderRequest(messageValidator) {
      var message = messageValidator.message;
      var paramsClass = null;
      switch (message.getName()) {
        case kSiteDataProvider_GetSiteDataArray_Name:
          if (message.expectsResponse())
            paramsClass = SiteDataProvider_GetSiteDataArray_Params;
        break;
        case kSiteDataProvider_GetSiteDataDatabaseSize_Name:
          if (message.expectsResponse())
            paramsClass = SiteDataProvider_GetSiteDataDatabaseSize_Params;
        break;
      }
      if (paramsClass === null)
        return validator.validationError.NONE;
      return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
    }
  
    function validateSiteDataProviderResponse(messageValidator) {
     var message = messageValidator.message;
     var paramsClass = null;
     switch (message.getName()) {
        case kSiteDataProvider_GetSiteDataArray_Name:
          if (message.isResponse())
            paramsClass = SiteDataProvider_GetSiteDataArray_ResponseParams;
          break;
        case kSiteDataProvider_GetSiteDataDatabaseSize_Name:
          if (message.isResponse())
            paramsClass = SiteDataProvider_GetSiteDataDatabaseSize_ResponseParams;
          break;
      }
      if (paramsClass === null)
        return validator.validationError.NONE;
      return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
    }
  
    var SiteDataProvider = {
      name: 'discards.mojom.SiteDataProvider',
      kVersion: 0,
      ptrClass: SiteDataProviderPtr,
      proxyClass: SiteDataProviderProxy,
      stubClass: SiteDataProviderStub,
      validateRequest: validateSiteDataProviderRequest,
      validateResponse: validateSiteDataProviderResponse,
    };
    SiteDataProviderStub.prototype.validator = validateSiteDataProviderRequest;
    SiteDataProviderProxy.prototype.validator = validateSiteDataProviderResponse;
    exports.SiteDataFeature = SiteDataFeature;
    exports.SiteDataPerformanceMeasurement = SiteDataPerformanceMeasurement;
    exports.SiteDataDatabaseSize = SiteDataDatabaseSize;
    exports.SiteDataValue = SiteDataValue;
    exports.SiteDataEntry = SiteDataEntry;
    exports.SiteDataArray = SiteDataArray;
    exports.SiteDataProvider = SiteDataProvider;
    exports.SiteDataProviderPtr = SiteDataProviderPtr;
    exports.SiteDataProviderAssociatedPtr = SiteDataProviderAssociatedPtr;
  })();