blob: c0daed16fe7ff572883ec2f72cd156346643454e [file] [log] [blame]
// content/common/synthetic_trial_configuration.mojom.m.js is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {mojo} from '../../mojo/public/js/bindings.js';
/**
* @implements {mojo.internal.interfaceSupport.PendingReceiver}
*/
export class SyntheticTrialConfigurationPendingReceiver {
/**
* @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, 'content.mojom.SyntheticTrialConfiguration', scope);
}
}
/** @interface */
export class SyntheticTrialConfigurationInterface {
/**
* @param { !Array<!SyntheticTrialGroup> } groups
*/
addOrUpdateSyntheticTrialGroups(groups) {}
/**
* @param { !Array<!SyntheticTrialGroup> } groups
*/
removeSyntheticTrialGroups(groups) {}
}
/**
* @implements { SyntheticTrialConfigurationInterface }
*/
export class SyntheticTrialConfigurationRemote {
/** @param {MojoHandle|mojo.internal.interfaceSupport.Endpoint=} handle */
constructor(handle = undefined) {
/**
* @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!SyntheticTrialConfigurationPendingReceiver>}
*/
this.proxy =
new mojo.internal.interfaceSupport.InterfaceRemoteBase(
SyntheticTrialConfigurationPendingReceiver,
handle);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!SyntheticTrialConfigurationPendingReceiver>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
}
/**
* @param { !Array<!SyntheticTrialGroup> } groups
*/
addOrUpdateSyntheticTrialGroups(
groups) {
this.proxy.sendMessage(
0,
SyntheticTrialConfiguration_AddOrUpdateSyntheticTrialGroups_ParamsSpec.$,
null,
[
groups
],
false);
}
/**
* @param { !Array<!SyntheticTrialGroup> } groups
*/
removeSyntheticTrialGroups(
groups) {
this.proxy.sendMessage(
1,
SyntheticTrialConfiguration_RemoveSyntheticTrialGroups_ParamsSpec.$,
null,
[
groups
],
false);
}
}
/**
* An object which receives request messages for the SyntheticTrialConfiguration
* mojom interface. Must be constructed over an object which implements that
* interface.
*/
export class SyntheticTrialConfigurationReceiver {
/**
* @param {!SyntheticTrialConfigurationInterface } impl
*/
constructor(impl) {
/** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!SyntheticTrialConfigurationRemote>} */
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
SyntheticTrialConfigurationRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!SyntheticTrialConfigurationRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.helper_internal_.registerHandler(
0,
SyntheticTrialConfiguration_AddOrUpdateSyntheticTrialGroups_ParamsSpec.$,
null,
impl.addOrUpdateSyntheticTrialGroups.bind(impl),
false);
this.helper_internal_.registerHandler(
1,
SyntheticTrialConfiguration_RemoveSyntheticTrialGroups_ParamsSpec.$,
null,
impl.removeSyntheticTrialGroups.bind(impl),
false);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
}
}
export class SyntheticTrialConfiguration {
/**
* @return {!string}
*/
static get $interfaceName() {
return "content.mojom.SyntheticTrialConfiguration";
}
/**
* 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 {!SyntheticTrialConfigurationRemote}
*/
static getRemote() {
let remote = new SyntheticTrialConfigurationRemote;
remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
return remote;
}
}
/**
* An object which receives request messages for the SyntheticTrialConfiguration
* 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 SyntheticTrialConfigurationCallbackRouter {
constructor() {
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
SyntheticTrialConfigurationRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!SyntheticTrialConfigurationRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.addOrUpdateSyntheticTrialGroups =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
0,
SyntheticTrialConfiguration_AddOrUpdateSyntheticTrialGroups_ParamsSpec.$,
null,
this.addOrUpdateSyntheticTrialGroups.createReceiverHandler(false /* expectsResponse */),
false);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.removeSyntheticTrialGroups =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
1,
SyntheticTrialConfiguration_RemoveSyntheticTrialGroups_ParamsSpec.$,
null,
this.removeSyntheticTrialGroups.createReceiverHandler(false /* expectsResponse */),
false);
/** @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 SyntheticTrialGroupSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const SyntheticTrialConfiguration_AddOrUpdateSyntheticTrialGroups_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
/**
* @const { {$:!mojo.internal.MojomType}}
*/
export const SyntheticTrialConfiguration_RemoveSyntheticTrialGroups_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
mojo.internal.Struct(
SyntheticTrialGroupSpec.$,
'SyntheticTrialGroup',
[
mojo.internal.StructField(
'trialName', 0,
0,
mojo.internal.String,
null,
false /* nullable */,
0,
),
mojo.internal.StructField(
'groupName', 8,
0,
mojo.internal.String,
null,
false /* nullable */,
0,
),
],
[[0, 24],]);
/**
* @record
*/
export class SyntheticTrialGroup {
constructor() {
/** @type { !string } */
this.trialName;
/** @type { !string } */
this.groupName;
}
}
mojo.internal.Struct(
SyntheticTrialConfiguration_AddOrUpdateSyntheticTrialGroups_ParamsSpec.$,
'SyntheticTrialConfiguration_AddOrUpdateSyntheticTrialGroups_Params',
[
mojo.internal.StructField(
'groups', 0,
0,
mojo.internal.Array(SyntheticTrialGroupSpec.$, false),
null,
false /* nullable */,
0,
),
],
[[0, 16],]);
/**
* @record
*/
export class SyntheticTrialConfiguration_AddOrUpdateSyntheticTrialGroups_Params {
constructor() {
/** @type { !Array<!SyntheticTrialGroup> } */
this.groups;
}
}
mojo.internal.Struct(
SyntheticTrialConfiguration_RemoveSyntheticTrialGroups_ParamsSpec.$,
'SyntheticTrialConfiguration_RemoveSyntheticTrialGroups_Params',
[
mojo.internal.StructField(
'groups', 0,
0,
mojo.internal.Array(SyntheticTrialGroupSpec.$, false),
null,
false /* nullable */,
0,
),
],
[[0, 16],]);
/**
* @record
*/
export class SyntheticTrialConfiguration_RemoveSyntheticTrialGroups_Params {
constructor() {
/** @type { !Array<!SyntheticTrialGroup> } */
this.groups;
}
}