blob: 6ad333fbfd4163ba947c0ed362c90cb3e3e6a0cc [file] [log] [blame]
// Copyright 2018 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';
mojo.internal.exportModule('viz.mojom');
/** @export */
viz.mojom.VSyncParameterObserverPendingReceiver = class {
/** @param {!MojoHandle} handle */
constructor(handle) {
/** @public {!MojoHandle} */
this.handle = handle;
}
};
/**
* @export
* @implements { viz.mojom.VSyncParameterObserverInterface }
*/
viz.mojom.VSyncParameterObserverRemote = class {
/** @param {MojoHandle=} opt_handle */
constructor(opt_handle) {
/**
* @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!viz.mojom.VSyncParameterObserverPendingReceiver>}
*/
this.proxy =
new mojo.internal.interfaceSupport.InterfaceRemoteBase(
viz.mojom.VSyncParameterObserverPendingReceiver,
opt_handle);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!viz.mojom.VSyncParameterObserverPendingReceiver>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
}
/**
* @param { !mojoBase.mojom.TimeTicks } timebase
* @param { !mojoBase.mojom.TimeDelta } interval
*/
onUpdateVSyncParameters(
timebase,
interval) {
this.proxy.sendMessage(
2086631122,
viz.mojom.VSyncParameterObserver_OnUpdateVSyncParameters_ParamsSpec.$,
null,
[
timebase,
interval
]);
}
};
/**
* An object which receives request messages for the VSyncParameterObserver
* mojom interface. Must be constructed over an object which implements that
* interface.
*
* @export
*/
viz.mojom.VSyncParameterObserverReceiver = class {
/**
* @param {!viz.mojom.VSyncParameterObserverInterface } impl
*/
constructor(impl) {
/** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!viz.mojom.VSyncParameterObserverRemote>} */
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
viz.mojom.VSyncParameterObserverRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!viz.mojom.VSyncParameterObserverRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.helper_internal_.registerHandler(
2086631122,
viz.mojom.VSyncParameterObserver_OnUpdateVSyncParameters_ParamsSpec.$,
null,
impl.onUpdateVSyncParameters.bind(impl));
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
}
};
/**
* @export
*/
viz.mojom.VSyncParameterObserver = class {
/**
* @return {!string}
*/
static get $interfaceName() {
return "viz.mojom.VSyncParameterObserver";
}
/**
* 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 {!viz.mojom.VSyncParameterObserverRemote}
* @export
*/
static getRemote() {
let remote = new viz.mojom.VSyncParameterObserverRemote;
Mojo.bindInterface(this.$interfaceName,
remote.$.bindNewPipeAndPassReceiver().handle);
return remote;
}
};
/**
* An object which receives request messages for the VSyncParameterObserver
* 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
*/
viz.mojom.VSyncParameterObserverCallbackRouter = class {
constructor() {
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
viz.mojom.VSyncParameterObserverRemote);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!viz.mojom.VSyncParameterObserverRemote>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.onUpdateVSyncParameters =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
2086631122,
viz.mojom.VSyncParameterObserver_OnUpdateVSyncParameters_ParamsSpec.$,
null,
this.onUpdateVSyncParameters.createReceiverHandler(false /* 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.
* @export
*/
removeListener(id) {
return this.router_.removeListener(id);
}
};
/**
* @const { {$:!mojo.internal.MojomType}}
* @export
*/
viz.mojom.VSyncParameterObserver_OnUpdateVSyncParameters_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
mojo.internal.Struct(
viz.mojom.VSyncParameterObserver_OnUpdateVSyncParameters_ParamsSpec.$,
'VSyncParameterObserver_OnUpdateVSyncParameters_Params',
16,
[
mojo.internal.StructField(
'timebase', 0,
0,
mojoBase.mojom.TimeTicksSpec.$,
null,
false /* nullable */),
mojo.internal.StructField(
'interval', 8,
0,
mojoBase.mojom.TimeDeltaSpec.$,
null,
false /* nullable */),
]);