blob: 20de7acb6ce1a6284c57a596bdfbda766d5e8e11 [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';
goog.require('mojo.internal');
goog.require('mojo.internal.interfaceSupport');
goog.provide('blink.mojom.WebContentSecurityPolicyType');
goog.provide('blink.mojom.WebContentSecurityPolicyTypeSpec');
/**
* @const { {$: !mojo.internal.MojomType} }
* @export
*/
blink.mojom.WebContentSecurityPolicyTypeSpec = { $: mojo.internal.Enum() };
/**
* @enum {number}
* @export
*/
blink.mojom.WebContentSecurityPolicyType = {
WebContentSecurityPolicyTypeReport: 0,
WebContentSecurityPolicyTypeEnforce: 0,
MIN_VALUE: 0,
MAX_VALUE: 1,
};
/** @suppress {checkTypes} */
blink.mojom.WebContentSecurityPolicyType.WebContentSecurityPolicyTypeReport = 0;
/** @suppress {checkTypes} */
blink.mojom.WebContentSecurityPolicyType.WebContentSecurityPolicyTypeEnforce = blink.mojom.WebContentSecurityPolicyType.WebContentSecurityPolicyTypeReport + 1;
goog.provide('blink.mojom.NavigationInitiator');
goog.provide('blink.mojom.NavigationInitiatorCallbackRouter');
goog.provide('blink.mojom.NavigationInitiatorInterface');
goog.provide('blink.mojom.NavigationInitiatorProxy');
goog.provide('blink.mojom.NavigationInitiatorRequest');
/** @export */
blink.mojom.NavigationInitiatorRequest = class {
/** @param {!MojoHandle} handle */
constructor(handle) {
/** @public {!MojoHandle} */
this.handle = handle;
}
};
/** @interface */
blink.mojom.NavigationInitiatorInterface = class {
/**
* @param { !blink.mojom.CSPViolationParams } violationParams
*/
sendViolationReport(violationParams) {}
};
/**
* @export
* @implements { blink.mojom.NavigationInitiatorInterface }
*/
blink.mojom.NavigationInitiatorProxy = class {
/** @param {MojoHandle=} opt_handle */
constructor(opt_handle) {
/**
* @private {!mojo.internal.interfaceSupport.InterfaceRemoteBase<!blink.mojom.NavigationInitiatorRequest>}
*/
this.proxy =
new mojo.internal.interfaceSupport.InterfaceRemoteBase(
blink.mojom.NavigationInitiatorRequest,
opt_handle);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper<!blink.mojom.NavigationInitiatorRequest>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceRemoteBaseWrapper(this.proxy);
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.proxy.getConnectionErrorEventRouter();
}
/**
* @param { !blink.mojom.CSPViolationParams } violationParams
*/
sendViolationReport(
violationParams) {
this.proxy.sendMessage(
0,
blink.mojom.NavigationInitiator_SendViolationReport_ParamsSpec.$,
null,
[
violationParams
]);
}
};
/**
* An object which receives request messages for the NavigationInitiator
* mojom interface. Must be constructed over an object which implements that
* interface.
*
* @export
*/
blink.mojom.NavigationInitiator = class {
/**
* @param {!blink.mojom.NavigationInitiatorInterface } impl
*/
constructor(impl) {
/** @private {!mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal<!blink.mojom.NavigationInitiatorProxy>} */
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
blink.mojom.NavigationInitiatorProxy);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!blink.mojom.NavigationInitiatorProxy>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.helper_internal_.registerHandler(
0,
blink.mojom.NavigationInitiator_SendViolationReport_ParamsSpec.$,
null,
impl.sendViolationReport.bind(impl));
/** @public {!mojo.internal.interfaceSupport.ConnectionErrorEventRouter} */
this.onConnectionError = this.helper_internal_.getConnectionErrorEventRouter();
}
/**
* Returns a proxy 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 {!blink.mojom.NavigationInitiatorProxy}
* @export
*/
static getProxy() {
let proxy = new blink.mojom.NavigationInitiatorProxy;
Mojo.bindInterface('blink.mojom.NavigationInitiator',
proxy.$.bindNewPipeAndPassReceiver().handle);
return proxy;
}
/**
* @return {!string}
*/
static get $interfaceName() {
return "blink.mojom.NavigationInitiator";
}
};
/**
* An object which receives request messages for the NavigationInitiator
* 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
*/
blink.mojom.NavigationInitiatorCallbackRouter = class {
constructor() {
this.helper_internal_ = new mojo.internal.interfaceSupport.InterfaceReceiverHelperInternal(
blink.mojom.NavigationInitiatorProxy);
/**
* @public {!mojo.internal.interfaceSupport.InterfaceReceiverHelper<!blink.mojom.NavigationInitiatorProxy>}
*/
this.$ = new mojo.internal.interfaceSupport.InterfaceReceiverHelper(this.helper_internal_);
this.router_ = new mojo.internal.interfaceSupport.CallbackRouter;
/**
* @public {!mojo.internal.interfaceSupport.InterfaceCallbackReceiver}
*/
this.sendViolationReport =
new mojo.internal.interfaceSupport.InterfaceCallbackReceiver(
this.router_);
this.helper_internal_.registerHandler(
0,
blink.mojom.NavigationInitiator_SendViolationReport_ParamsSpec.$,
null,
this.sendViolationReport.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);
}
};
goog.provide('blink.mojom.SourceLocationSpec');
/**
* @const { {$:!mojo.internal.MojomType}}
* @export
*/
blink.mojom.SourceLocationSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
goog.provide('blink.mojom.CSPViolationParamsSpec');
/**
* @const { {$:!mojo.internal.MojomType}}
* @export
*/
blink.mojom.CSPViolationParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
goog.provide('blink.mojom.NavigationInitiator_SendViolationReport_ParamsSpec');
/**
* @const { {$:!mojo.internal.MojomType}}
* @export
*/
blink.mojom.NavigationInitiator_SendViolationReport_ParamsSpec =
{ $: /** @type {!mojo.internal.MojomType} */ ({}) };
mojo.internal.Struct(
blink.mojom.SourceLocationSpec.$,
'SourceLocation',
16,
[
mojo.internal.StructField(
'url', 0,
0,
mojo.internal.String,
null,
false /* nullable */),
mojo.internal.StructField(
'lineNumber', 8,
0,
mojo.internal.Uint32,
0,
false /* nullable */),
mojo.internal.StructField(
'columnNumber', 12,
0,
mojo.internal.Uint32,
0,
false /* nullable */),
]);
goog.provide('blink.mojom.SourceLocation');
/**
* @typedef { {
* url: !string,
* lineNumber: !number,
* columnNumber: !number,
* } }
*/
blink.mojom.SourceLocation;
mojo.internal.Struct(
blink.mojom.CSPViolationParamsSpec.$,
'CSPViolationParams',
64,
[
mojo.internal.StructField(
'directive', 0,
0,
mojo.internal.String,
null,
false /* nullable */),
mojo.internal.StructField(
'effectiveDirective', 8,
0,
mojo.internal.String,
null,
false /* nullable */),
mojo.internal.StructField(
'consoleMessage', 16,
0,
mojo.internal.String,
null,
false /* nullable */),
mojo.internal.StructField(
'blockedUrl', 24,
0,
mojo.internal.String,
null,
false /* nullable */),
mojo.internal.StructField(
'reportEndpoints', 32,
0,
mojo.internal.Array(mojo.internal.String, false),
null,
false /* nullable */),
mojo.internal.StructField(
'useReportingApi', 40,
0,
mojo.internal.Bool,
false,
false /* nullable */),
mojo.internal.StructField(
'header', 48,
0,
mojo.internal.String,
null,
false /* nullable */),
mojo.internal.StructField(
'disposition', 44,
0,
blink.mojom.WebContentSecurityPolicyTypeSpec.$,
0,
false /* nullable */),
mojo.internal.StructField(
'afterRedirect', 40,
1,
mojo.internal.Bool,
false,
false /* nullable */),
mojo.internal.StructField(
'sourceLocation', 56,
0,
blink.mojom.SourceLocationSpec.$,
null,
false /* nullable */),
]);
goog.provide('blink.mojom.CSPViolationParams');
/**
* @typedef { {
* directive: !string,
* effectiveDirective: !string,
* consoleMessage: !string,
* blockedUrl: !string,
* reportEndpoints: !Array<!string>,
* useReportingApi: !boolean,
* afterRedirect: !boolean,
* disposition: !blink.mojom.WebContentSecurityPolicyType,
* header: !string,
* sourceLocation: !blink.mojom.SourceLocation,
* } }
*/
blink.mojom.CSPViolationParams;
mojo.internal.Struct(
blink.mojom.NavigationInitiator_SendViolationReport_ParamsSpec.$,
'NavigationInitiator_SendViolationReport_Params',
8,
[
mojo.internal.StructField(
'violationParams', 0,
0,
blink.mojom.CSPViolationParamsSpec.$,
null,
false /* nullable */),
]);
goog.provide('blink.mojom.NavigationInitiator_SendViolationReport_Params');
/**
* @typedef { {
* violationParams: !blink.mojom.CSPViolationParams,
* } }
*/
blink.mojom.NavigationInitiator_SendViolationReport_Params;