| // mojom-webui/storage/browser/quota/quota_internals.mojom-webui.js is auto generated by mojom_bindings_generator.py, do not edit |
| // Copyright 2020 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. |
| import { mojo } from '//resources/mojo/mojo/public/js/bindings.js'; |
| import { TimeSpec as mojoBase_mojom_TimeSpec } from 'chrome://resources/mojo/mojo/public/mojom/base/time.mojom-webui.js'; |
| import { OriginSpec as url_mojom_OriginSpec } from 'chrome://resources/mojo/url/mojom/origin.mojom-webui.js'; |
| /** |
| * @const { {$: !mojo.internal.MojomType} } |
| */ |
| export const StorageTypeSpec = { $: mojo.internal.Enum() }; |
| /** |
| * @enum {number} |
| */ |
| export const StorageType = { |
| kTemporary: 0, |
| kPersistent: 1, |
| kSyncable: 2, |
| MIN_VALUE: 0, |
| MAX_VALUE: 2, |
| }; |
| /** |
| * @implements {mojo.internal.interfaceSupport.PendingReceiver} |
| */ |
| export class QuotaInternalsHandlerPendingReceiver { |
| /** |
| * @param {!MojoHandle|!mojo.internal.interfaceSupport.Endpoint} handle |
| */ |
| constructor(handle) { |
| /** @public {!mojo.internal.interfaceSupport.Endpoint} */ |
| this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle); |
| } |
| /** @param {string=} scope */ |
| bindInBrowser(scope = 'context') { |
| mojo.internal.interfaceSupport.bind(this.handle, 'storage.mojom.QuotaInternalsHandler', scope); |
| } |
| } |
| /** @interface */ |
| export class QuotaInternalsHandlerInterface { |
| /** |
| * @return {!Promise<{ |
| totalSpace: !bigint, |
| availableSpace: !bigint, |
| tempPoolSize: !bigint, |
| * }>} |
| */ |
| getDiskAvailabilityAndTempPoolSize() { } |
| /** |
| * @return {!Promise<{ |
| evictionStatistics: !Object<!string, !string>, |
| * }>} |
| */ |
| getStatistics() { } |
| /** |
| * @param { !url_mojom_Origin } originUrl |
| */ |
| simulateStoragePressure(originUrl) { } |
| /** |
| * @return {!Promise<{ |
| entries: !Array<!BucketTableEntry>, |
| * }>} |
| */ |
| retrieveBucketsTable() { } |
| /** |
| * @param { !StorageType } storageType |
| * @return {!Promise<{ |
| usage: !bigint, |
| unlimitedUsage: !bigint, |
| * }>} |
| */ |
| getGlobalUsageForInternals(storageType) { } |
| } |
| /** |
| * @implements { QuotaInternalsHandlerInterface } |
| */ |
| export class QuotaInternalsHandlerRemote { |
| /** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */ |
| constructor(handle = undefined) { |
| /** |
| * @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!QuotaInternalsHandlerPendingReceiver>} |
| */ |
| this.proxy = |
| new mojo.internal.interfaceSupport.InterfaceRemoteBase(QuotaInternalsHandlerPendingReceiver, handle); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!QuotaInternalsHandlerPendingReceiver>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.proxy.getConnectionErrorEventRouter(); |
| } |
| /** |
| * @return {!Promise<{ |
| totalSpace: !bigint, |
| availableSpace: !bigint, |
| tempPoolSize: !bigint, |
| * }>} |
| */ |
| getDiskAvailabilityAndTempPoolSize() { |
| return this.proxy.sendMessage(394196151, QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ParamsSpec.$, QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ResponseParamsSpec.$, []); |
| } |
| /** |
| * @return {!Promise<{ |
| evictionStatistics: !Object<!string, !string>, |
| * }>} |
| */ |
| getStatistics() { |
| return this.proxy.sendMessage(1039060185, QuotaInternalsHandler_GetStatistics_ParamsSpec.$, QuotaInternalsHandler_GetStatistics_ResponseParamsSpec.$, []); |
| } |
| /** |
| * @param { !url_mojom_Origin } originUrl |
| */ |
| simulateStoragePressure(originUrl) { |
| this.proxy.sendMessage(2014532390, QuotaInternalsHandler_SimulateStoragePressure_ParamsSpec.$, null, [ |
| originUrl |
| ]); |
| } |
| /** |
| * @return {!Promise<{ |
| entries: !Array<!BucketTableEntry>, |
| * }>} |
| */ |
| retrieveBucketsTable() { |
| return this.proxy.sendMessage(1411648773, QuotaInternalsHandler_RetrieveBucketsTable_ParamsSpec.$, QuotaInternalsHandler_RetrieveBucketsTable_ResponseParamsSpec.$, []); |
| } |
| /** |
| * @param { !StorageType } storageType |
| * @return {!Promise<{ |
| usage: !bigint, |
| unlimitedUsage: !bigint, |
| * }>} |
| */ |
| getGlobalUsageForInternals(storageType) { |
| return this.proxy.sendMessage(1867885978, QuotaInternalsHandler_GetGlobalUsageForInternals_ParamsSpec.$, QuotaInternalsHandler_GetGlobalUsageForInternals_ResponseParamsSpec.$, [ |
| storageType |
| ]); |
| } |
| } |
| /** |
| * An object which receives request messages for the QuotaInternalsHandler |
| * mojom interface. Must be constructed over an object which implements that |
| * interface. |
| */ |
| export class QuotaInternalsHandlerReceiver { |
| /** |
| * @param {!QuotaInternalsHandlerInterface } impl |
| */ |
| constructor(impl) { |
| /** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!QuotaInternalsHandlerRemote>} */ |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(QuotaInternalsHandlerRemote); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!QuotaInternalsHandlerRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| this.helper_internal_.registerHandler(394196151, QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ParamsSpec.$, QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ResponseParamsSpec.$, impl.getDiskAvailabilityAndTempPoolSize.bind(impl)); |
| this.helper_internal_.registerHandler(1039060185, QuotaInternalsHandler_GetStatistics_ParamsSpec.$, QuotaInternalsHandler_GetStatistics_ResponseParamsSpec.$, impl.getStatistics.bind(impl)); |
| this.helper_internal_.registerHandler(2014532390, QuotaInternalsHandler_SimulateStoragePressure_ParamsSpec.$, null, impl.simulateStoragePressure.bind(impl)); |
| this.helper_internal_.registerHandler(1411648773, QuotaInternalsHandler_RetrieveBucketsTable_ParamsSpec.$, QuotaInternalsHandler_RetrieveBucketsTable_ResponseParamsSpec.$, impl.retrieveBucketsTable.bind(impl)); |
| this.helper_internal_.registerHandler(1867885978, QuotaInternalsHandler_GetGlobalUsageForInternals_ParamsSpec.$, QuotaInternalsHandler_GetGlobalUsageForInternals_ResponseParamsSpec.$, impl.getGlobalUsageForInternals.bind(impl)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| } |
| export class QuotaInternalsHandler { |
| /** |
| * @return {!string} |
| */ |
| static get $interfaceName() { |
| return "storage.mojom.QuotaInternalsHandler"; |
| } |
| /** |
| * Returns a remote for this interface which sends messages to the browser. |
| * The browser must have an interface request binder registered for this |
| * interface and accessible to the calling document's frame. |
| * |
| * @return {!QuotaInternalsHandlerRemote} |
| */ |
| static getRemote() { |
| let remote = new QuotaInternalsHandlerRemote; |
| remote.$.bindNewPipeAndPassReceiver().bindInBrowser(); |
| return remote; |
| } |
| } |
| /** |
| * An object which receives request messages for the QuotaInternalsHandler |
| * mojom interface and dispatches them as callbacks. One callback receiver exists |
| * on this object for each message defined in the mojom interface, and each |
| * receiver can have any number of listeners added to it. |
| */ |
| export class QuotaInternalsHandlerCallbackRouter { |
| constructor() { |
| this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(QuotaInternalsHandlerRemote); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!QuotaInternalsHandlerRemote>} |
| */ |
| this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_); |
| this.router_ = new mojo.internal.interfaceSupport.CallbackRouter; |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.getDiskAvailabilityAndTempPoolSize = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_); |
| this.helper_internal_.registerHandler(394196151, QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ParamsSpec.$, QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ResponseParamsSpec.$, this.getDiskAvailabilityAndTempPoolSize.createReceiverHandler(true /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.getStatistics = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_); |
| this.helper_internal_.registerHandler(1039060185, QuotaInternalsHandler_GetStatistics_ParamsSpec.$, QuotaInternalsHandler_GetStatistics_ResponseParamsSpec.$, this.getStatistics.createReceiverHandler(true /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.simulateStoragePressure = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_); |
| this.helper_internal_.registerHandler(2014532390, QuotaInternalsHandler_SimulateStoragePressure_ParamsSpec.$, null, this.simulateStoragePressure.createReceiverHandler(false /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.retrieveBucketsTable = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_); |
| this.helper_internal_.registerHandler(1411648773, QuotaInternalsHandler_RetrieveBucketsTable_ParamsSpec.$, QuotaInternalsHandler_RetrieveBucketsTable_ResponseParamsSpec.$, this.retrieveBucketsTable.createReceiverHandler(true /* expectsResponse */)); |
| /** |
| * @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver} |
| */ |
| this.getGlobalUsageForInternals = |
| new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_); |
| this.helper_internal_.registerHandler(1867885978, QuotaInternalsHandler_GetGlobalUsageForInternals_ParamsSpec.$, QuotaInternalsHandler_GetGlobalUsageForInternals_ResponseParamsSpec.$, this.getGlobalUsageForInternals.createReceiverHandler(true /* expectsResponse */)); |
| /** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */ |
| this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter(); |
| } |
| /** |
| * @param {number} id An ID returned by a prior call to addListener. |
| * @return {boolean} True iff the identified listener was found and removed. |
| */ |
| removeListener(id) { |
| return this.router_.removeListener(id); |
| } |
| } |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const BucketTableEntrySpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ResponseParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_GetStatistics_ParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_GetStatistics_ResponseParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_SimulateStoragePressure_ParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_RetrieveBucketsTable_ParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_RetrieveBucketsTable_ResponseParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_GetGlobalUsageForInternals_ParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| /** |
| * @const { {$:!mojo.internal.MojomType}} |
| */ |
| export const QuotaInternalsHandler_GetGlobalUsageForInternals_ResponseParamsSpec = { $: /** @type {!mojo.internal.MojomType} */ ({}) }; |
| mojo.internal.Struct(BucketTableEntrySpec.$, 'BucketTableEntry', [ |
| mojo.internal.StructField('bucketId', 0, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| mojo.internal.StructField('storageKey', 8, 0, mojo.internal.String, null, false /* nullable */, 0), |
| mojo.internal.StructField('type', 16, 0, mojo.internal.String, null, false /* nullable */, 0), |
| mojo.internal.StructField('name', 24, 0, mojo.internal.String, null, false /* nullable */, 0), |
| mojo.internal.StructField('usage', 32, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| mojo.internal.StructField('useCount', 40, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| mojo.internal.StructField('lastAccessed', 48, 0, mojoBase_mojom_TimeSpec.$, null, false /* nullable */, 0), |
| mojo.internal.StructField('lastModified', 56, 0, mojoBase_mojom_TimeSpec.$, null, false /* nullable */, 0), |
| ], [[0, 72],]); |
| /** |
| * @record |
| */ |
| export class BucketTableEntry { |
| constructor() { |
| /** @type { !bigint } */ |
| this.bucketId; |
| /** @type { !string } */ |
| this.storageKey; |
| /** @type { !string } */ |
| this.type; |
| /** @type { !string } */ |
| this.name; |
| /** @type { !bigint } */ |
| this.usage; |
| /** @type { !bigint } */ |
| this.useCount; |
| /** @type { !mojoBase_mojom_Time } */ |
| this.lastAccessed; |
| /** @type { !mojoBase_mojom_Time } */ |
| this.lastModified; |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ParamsSpec.$, 'QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_Params', [], [[0, 8],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_Params { |
| constructor() { |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ResponseParamsSpec.$, 'QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ResponseParams', [ |
| mojo.internal.StructField('totalSpace', 0, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| mojo.internal.StructField('availableSpace', 8, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| mojo.internal.StructField('tempPoolSize', 16, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| ], [[0, 32],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_GetDiskAvailabilityAndTempPoolSize_ResponseParams { |
| constructor() { |
| /** @type { !bigint } */ |
| this.totalSpace; |
| /** @type { !bigint } */ |
| this.availableSpace; |
| /** @type { !bigint } */ |
| this.tempPoolSize; |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_GetStatistics_ParamsSpec.$, 'QuotaInternalsHandler_GetStatistics_Params', [], [[0, 8],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_GetStatistics_Params { |
| constructor() { |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_GetStatistics_ResponseParamsSpec.$, 'QuotaInternalsHandler_GetStatistics_ResponseParams', [ |
| mojo.internal.StructField('evictionStatistics', 0, 0, mojo.internal.Map(mojo.internal.String, mojo.internal.String, false), null, false /* nullable */, 0), |
| ], [[0, 16],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_GetStatistics_ResponseParams { |
| constructor() { |
| /** @type { !Object<!string, !string> } */ |
| this.evictionStatistics; |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_SimulateStoragePressure_ParamsSpec.$, 'QuotaInternalsHandler_SimulateStoragePressure_Params', [ |
| mojo.internal.StructField('originUrl', 0, 0, url_mojom_OriginSpec.$, null, false /* nullable */, 0), |
| ], [[0, 16],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_SimulateStoragePressure_Params { |
| constructor() { |
| /** @type { !url_mojom_Origin } */ |
| this.originUrl; |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_RetrieveBucketsTable_ParamsSpec.$, 'QuotaInternalsHandler_RetrieveBucketsTable_Params', [], [[0, 8],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_RetrieveBucketsTable_Params { |
| constructor() { |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_RetrieveBucketsTable_ResponseParamsSpec.$, 'QuotaInternalsHandler_RetrieveBucketsTable_ResponseParams', [ |
| mojo.internal.StructField('entries', 0, 0, mojo.internal.Array(BucketTableEntrySpec.$, false), null, false /* nullable */, 0), |
| ], [[0, 16],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_RetrieveBucketsTable_ResponseParams { |
| constructor() { |
| /** @type { !Array<!BucketTableEntry> } */ |
| this.entries; |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_GetGlobalUsageForInternals_ParamsSpec.$, 'QuotaInternalsHandler_GetGlobalUsageForInternals_Params', [ |
| mojo.internal.StructField('storageType', 0, 0, StorageTypeSpec.$, 0, false /* nullable */, 0), |
| ], [[0, 16],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_GetGlobalUsageForInternals_Params { |
| constructor() { |
| /** @type { !StorageType } */ |
| this.storageType; |
| } |
| } |
| mojo.internal.Struct(QuotaInternalsHandler_GetGlobalUsageForInternals_ResponseParamsSpec.$, 'QuotaInternalsHandler_GetGlobalUsageForInternals_ResponseParams', [ |
| mojo.internal.StructField('usage', 0, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| mojo.internal.StructField('unlimitedUsage', 8, 0, mojo.internal.Int64, BigInt(0), false /* nullable */, 0), |
| ], [[0, 24],]); |
| /** |
| * @record |
| */ |
| export class QuotaInternalsHandler_GetGlobalUsageForInternals_ResponseParams { |
| constructor() { |
| /** @type { !bigint } */ |
| this.usage; |
| /** @type { !bigint } */ |
| this.unlimitedUsage; |
| } |
| } |