// ui/webui/resources/js/metrics_reporter/metrics_reporter.mojom-webui.ts 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 '//resources/mojo/mojo/public/js/bindings.js';
import { TimeDeltaSpec as mojoBase_mojom_TimeDeltaSpec } from '//resources/mojo/mojo/public/mojom/base/time.mojom-webui.js';
export class PageMetricsHostPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'metrics_reporter.mojom.PageMetricsHost', scope);
    }
}
export class PageMetricsHostRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageMetricsHostPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    onPageRemoteCreated(page) {
        this.proxy.sendMessage(2049032018, PageMetricsHost_OnPageRemoteCreated_ParamsSpec.$, null, [
            page
        ], false);
    }
    onGetMark(name) {
        return this.proxy.sendMessage(1177960893, PageMetricsHost_OnGetMark_ParamsSpec.$, PageMetricsHost_OnGetMark_ResponseParamsSpec.$, [
            name
        ], false);
    }
    onClearMark(name) {
        this.proxy.sendMessage(516442607, PageMetricsHost_OnClearMark_ParamsSpec.$, null, [
            name
        ], false);
    }
    onUmaReportTime(name, time) {
        this.proxy.sendMessage(217971989, PageMetricsHost_OnUmaReportTime_ParamsSpec.$, null, [
            name,
            time
        ], false);
    }
}
;
/**
 * An object which receives request messages for the PageMetricsHost
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageMetricsHostReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageMetricsHostRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(2049032018, PageMetricsHost_OnPageRemoteCreated_ParamsSpec.$, null, impl.onPageRemoteCreated.bind(impl), false);
        this.helper_internal_.registerHandler(1177960893, PageMetricsHost_OnGetMark_ParamsSpec.$, PageMetricsHost_OnGetMark_ResponseParamsSpec.$, impl.onGetMark.bind(impl), false);
        this.helper_internal_.registerHandler(516442607, PageMetricsHost_OnClearMark_ParamsSpec.$, null, impl.onClearMark.bind(impl), false);
        this.helper_internal_.registerHandler(217971989, PageMetricsHost_OnUmaReportTime_ParamsSpec.$, null, impl.onUmaReportTime.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageMetricsHost {
    static get $interfaceName() {
        return "metrics_reporter.mojom.PageMetricsHost";
    }
    /**
     * 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.
     */
    static getRemote() {
        let remote = new PageMetricsHostRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageMetricsHost
 * 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 PageMetricsHostCallbackRouter {
    helper_internal_;
    $;
    router_;
    onPageRemoteCreated;
    onGetMark;
    onClearMark;
    onUmaReportTime;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageMetricsHostRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.onPageRemoteCreated =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(2049032018, PageMetricsHost_OnPageRemoteCreated_ParamsSpec.$, null, this.onPageRemoteCreated.createReceiverHandler(false /* expectsResponse */), false);
        this.onGetMark =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(1177960893, PageMetricsHost_OnGetMark_ParamsSpec.$, PageMetricsHost_OnGetMark_ResponseParamsSpec.$, this.onGetMark.createReceiverHandler(true /* expectsResponse */), false);
        this.onClearMark =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(516442607, PageMetricsHost_OnClearMark_ParamsSpec.$, null, this.onClearMark.createReceiverHandler(false /* expectsResponse */), false);
        this.onUmaReportTime =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(217971989, PageMetricsHost_OnUmaReportTime_ParamsSpec.$, null, this.onUmaReportTime.createReceiverHandler(false /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export class PageMetricsPendingReceiver {
    handle;
    constructor(handle) {
        this.handle = mojo.internal.interfaceSupport.getEndpointForReceiver(handle);
    }
    bindInBrowser(scope = 'context') {
        mojo.internal.interfaceSupport.bind(this.handle, 'metrics_reporter.mojom.PageMetrics', scope);
    }
}
export class PageMetricsRemote {
    proxy;
    $;
    onConnectionError;
    constructor(handle) {
        this.proxy =
            new mojo.internal.interfaceSupport.InterfaceRemoteBase(PageMetricsPendingReceiver, handle);
        this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
        this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
    }
    onGetMark(name) {
        return this.proxy.sendMessage(971756218, PageMetrics_OnGetMark_ParamsSpec.$, PageMetrics_OnGetMark_ResponseParamsSpec.$, [
            name
        ], false);
    }
    onClearMark(name) {
        this.proxy.sendMessage(823074318, PageMetrics_OnClearMark_ParamsSpec.$, null, [
            name
        ], false);
    }
}
;
/**
 * An object which receives request messages for the PageMetrics
 * mojom interface. Must be constructed over an object which implements that
 * interface.
 */
export class PageMetricsReceiver {
    helper_internal_;
    $;
    onConnectionError;
    constructor(impl) {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageMetricsRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.helper_internal_.registerHandler(971756218, PageMetrics_OnGetMark_ParamsSpec.$, PageMetrics_OnGetMark_ResponseParamsSpec.$, impl.onGetMark.bind(impl), false);
        this.helper_internal_.registerHandler(823074318, PageMetrics_OnClearMark_ParamsSpec.$, null, impl.onClearMark.bind(impl), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
}
export class PageMetrics {
    static get $interfaceName() {
        return "metrics_reporter.mojom.PageMetrics";
    }
    /**
     * 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.
     */
    static getRemote() {
        let remote = new PageMetricsRemote;
        remote.$.bindNewPipeAndPassReceiver().bindInBrowser();
        return remote;
    }
}
/**
 * An object which receives request messages for the PageMetrics
 * 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 PageMetricsCallbackRouter {
    helper_internal_;
    $;
    router_;
    onGetMark;
    onClearMark;
    onConnectionError;
    constructor() {
        this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(PageMetricsRemote);
        this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
        this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
        this.onGetMark =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(971756218, PageMetrics_OnGetMark_ParamsSpec.$, PageMetrics_OnGetMark_ResponseParamsSpec.$, this.onGetMark.createReceiverHandler(true /* expectsResponse */), false);
        this.onClearMark =
            new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(this.router_);
        this.helper_internal_.registerHandler(823074318, PageMetrics_OnClearMark_ParamsSpec.$, null, this.onClearMark.createReceiverHandler(false /* expectsResponse */), false);
        this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
    }
    /**
     * @param id An ID returned by a prior call to addListener.
     * @return True iff the identified listener was found and removed.
     */
    removeListener(id) {
        return this.router_.removeListener(id);
    }
}
export const PageMetricsHost_OnPageRemoteCreated_ParamsSpec = { $: {} };
export const PageMetricsHost_OnGetMark_ParamsSpec = { $: {} };
export const PageMetricsHost_OnGetMark_ResponseParamsSpec = { $: {} };
export const PageMetricsHost_OnClearMark_ParamsSpec = { $: {} };
export const PageMetricsHost_OnUmaReportTime_ParamsSpec = { $: {} };
export const PageMetrics_OnGetMark_ParamsSpec = { $: {} };
export const PageMetrics_OnGetMark_ResponseParamsSpec = { $: {} };
export const PageMetrics_OnClearMark_ParamsSpec = { $: {} };
mojo.internal.Struct(PageMetricsHost_OnPageRemoteCreated_ParamsSpec.$, 'PageMetricsHost_OnPageRemoteCreated_Params', [
    mojo.internal.StructField('page', 0, 0, mojo.internal.InterfaceProxy(PageMetricsRemote), null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageMetricsHost_OnGetMark_ParamsSpec.$, 'PageMetricsHost_OnGetMark_Params', [
    mojo.internal.StructField('name', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageMetricsHost_OnGetMark_ResponseParamsSpec.$, 'PageMetricsHost_OnGetMark_ResponseParams', [
    mojo.internal.StructField('markedTime', 0, 0, mojoBase_mojom_TimeDeltaSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageMetricsHost_OnClearMark_ParamsSpec.$, 'PageMetricsHost_OnClearMark_Params', [
    mojo.internal.StructField('name', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageMetricsHost_OnUmaReportTime_ParamsSpec.$, 'PageMetricsHost_OnUmaReportTime_Params', [
    mojo.internal.StructField('name', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
    mojo.internal.StructField('time', 8, 0, mojoBase_mojom_TimeDeltaSpec.$, null, false /* nullable */, 0, undefined, undefined),
], [[0, 24],]);
mojo.internal.Struct(PageMetrics_OnGetMark_ParamsSpec.$, 'PageMetrics_OnGetMark_Params', [
    mojo.internal.StructField('name', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageMetrics_OnGetMark_ResponseParamsSpec.$, 'PageMetrics_OnGetMark_ResponseParams', [
    mojo.internal.StructField('markedTime', 0, 0, mojoBase_mojom_TimeDeltaSpec.$, null, true /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
mojo.internal.Struct(PageMetrics_OnClearMark_ParamsSpec.$, 'PageMetrics_OnClearMark_Params', [
    mojo.internal.StructField('name', 0, 0, mojo.internal.String, null, false /* nullable */, 0, undefined, undefined),
], [[0, 16],]);
