Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/js/xpconnect/idl/xpccomponents.idl
//
/// `interface nsIXPCComponents_Interfaces : nsISupports`
///
/// ```text
/// /**
/// * interface of Components.interfaces
/// * (interesting stuff only reflected into JavaScript)
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_Interfaces {
vtable: &'static nsIXPCComponents_InterfacesVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_Interfaces.
unsafe impl XpCom for nsIXPCComponents_Interfaces {
const IID: nsIID = nsID(0xb8c31bba, 0x79db, 0x4a1d,
[0x93, 0x0d, 0x4c, 0xdd, 0x68, 0x71, 0x3f, 0x9e]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_Interfaces {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_Interfaces.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_InterfacesCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_Interfaces`.
fn coerce_from(v: &nsIXPCComponents_Interfaces) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_InterfacesCoerce for nsIXPCComponents_Interfaces {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Interfaces) -> &Self {
v
}
}
impl nsIXPCComponents_Interfaces {
/// Cast this `nsIXPCComponents_Interfaces` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_InterfacesCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_Interfaces {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_InterfacesCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Interfaces) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_Interfaces
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_InterfacesVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_Interfaces {
}
/// `interface nsIXPCComponents_Classes : nsISupports`
///
/// ```text
/// /**
/// * interface of Components.classes
/// * (interesting stuff only reflected into JavaScript)
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_Classes {
vtable: &'static nsIXPCComponents_ClassesVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_Classes.
unsafe impl XpCom for nsIXPCComponents_Classes {
const IID: nsIID = nsID(0x978ff520, 0xd26c, 0x11d2,
[0x98, 0x42, 0x00, 0x60, 0x08, 0x96, 0x24, 0x22]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_Classes {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_Classes.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_ClassesCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_Classes`.
fn coerce_from(v: &nsIXPCComponents_Classes) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_ClassesCoerce for nsIXPCComponents_Classes {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Classes) -> &Self {
v
}
}
impl nsIXPCComponents_Classes {
/// Cast this `nsIXPCComponents_Classes` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_ClassesCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_Classes {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_ClassesCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Classes) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_Classes
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_ClassesVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_Classes {
}
/// `interface nsIXPCComponents_Results : nsISupports`
///
/// ```text
/// /**
/// * interface of Components.results
/// * (interesting stuff only reflected into JavaScript)
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_Results {
vtable: &'static nsIXPCComponents_ResultsVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_Results.
unsafe impl XpCom for nsIXPCComponents_Results {
const IID: nsIID = nsID(0x2fc229a0, 0x5860, 0x11d3,
[0x98, 0x99, 0x00, 0x60, 0x08, 0x96, 0x24, 0x22]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_Results {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_Results.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_ResultsCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_Results`.
fn coerce_from(v: &nsIXPCComponents_Results) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_ResultsCoerce for nsIXPCComponents_Results {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Results) -> &Self {
v
}
}
impl nsIXPCComponents_Results {
/// Cast this `nsIXPCComponents_Results` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_ResultsCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_Results {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_ResultsCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Results) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_Results
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_ResultsVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_Results {
}
/// `interface nsIXPCComponents_ID : nsISupports`
///
/// ```text
/// /**
/// * interface of Components.ID
/// * (interesting stuff only reflected into JavaScript)
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_ID {
vtable: &'static nsIXPCComponents_IDVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_ID.
unsafe impl XpCom for nsIXPCComponents_ID {
const IID: nsIID = nsID(0x7994a6e0, 0xe028, 0x11d3,
[0x8f, 0x5d, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_ID {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_ID.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_IDCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_ID`.
fn coerce_from(v: &nsIXPCComponents_ID) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_IDCoerce for nsIXPCComponents_ID {
#[inline]
fn coerce_from(v: &nsIXPCComponents_ID) -> &Self {
v
}
}
impl nsIXPCComponents_ID {
/// Cast this `nsIXPCComponents_ID` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_IDCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_ID {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_IDCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_ID) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_ID
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_IDVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_ID {
}
/// `interface nsIXPCComponents_Exception : nsISupports`
///
/// ```text
/// /**
/// * interface of Components.Exception
/// * (interesting stuff only reflected into JavaScript)
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_Exception {
vtable: &'static nsIXPCComponents_ExceptionVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_Exception.
unsafe impl XpCom for nsIXPCComponents_Exception {
const IID: nsIID = nsID(0x5bf039c0, 0xe028, 0x11d3,
[0x8f, 0x5d, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_Exception {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_Exception.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_ExceptionCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_Exception`.
fn coerce_from(v: &nsIXPCComponents_Exception) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_ExceptionCoerce for nsIXPCComponents_Exception {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Exception) -> &Self {
v
}
}
impl nsIXPCComponents_Exception {
/// Cast this `nsIXPCComponents_Exception` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_ExceptionCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_Exception {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_ExceptionCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Exception) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_Exception
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_ExceptionVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_Exception {
}
/// `interface nsIXPCComponents_Constructor : nsISupports`
///
/// ```text
/// /**
/// * interface of Components.Constructor
/// * (interesting stuff only reflected into JavaScript)
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_Constructor {
vtable: &'static nsIXPCComponents_ConstructorVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_Constructor.
unsafe impl XpCom for nsIXPCComponents_Constructor {
const IID: nsIID = nsID(0x88655640, 0xe028, 0x11d3,
[0x8f, 0x5d, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_Constructor {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_Constructor.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_ConstructorCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_Constructor`.
fn coerce_from(v: &nsIXPCComponents_Constructor) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_ConstructorCoerce for nsIXPCComponents_Constructor {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Constructor) -> &Self {
v
}
}
impl nsIXPCComponents_Constructor {
/// Cast this `nsIXPCComponents_Constructor` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_ConstructorCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_Constructor {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_ConstructorCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Constructor) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_Constructor
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_ConstructorVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_Constructor {
}
/// `interface nsIXPCComponents_utils_Sandbox : nsISupports`
///
/// ```text
/// /**
/// * interface of object returned by Components.utils.Sandbox.
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_utils_Sandbox {
vtable: &'static nsIXPCComponents_utils_SandboxVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_utils_Sandbox.
unsafe impl XpCom for nsIXPCComponents_utils_Sandbox {
const IID: nsIID = nsID(0x4f8ae0dc, 0xd266, 0x4a32,
[0x87, 0x5b, 0x6a, 0x9d, 0xe7, 0x1a, 0x8c, 0xe9]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_utils_Sandbox {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_utils_Sandbox.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_utils_SandboxCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_utils_Sandbox`.
fn coerce_from(v: &nsIXPCComponents_utils_Sandbox) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_utils_SandboxCoerce for nsIXPCComponents_utils_Sandbox {
#[inline]
fn coerce_from(v: &nsIXPCComponents_utils_Sandbox) -> &Self {
v
}
}
impl nsIXPCComponents_utils_Sandbox {
/// Cast this `nsIXPCComponents_utils_Sandbox` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_utils_SandboxCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_utils_Sandbox {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_utils_SandboxCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_utils_Sandbox) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_utils_Sandbox
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_utils_SandboxVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_utils_Sandbox {
}
/// `interface nsIScheduledGCCallback : nsISupports`
///
/// ```text
/// /**
/// * interface for callback to be passed to Cu.schedulePreciseGC
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIScheduledGCCallback {
vtable: &'static nsIScheduledGCCallbackVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIScheduledGCCallback.
unsafe impl XpCom for nsIScheduledGCCallback {
const IID: nsIID = nsID(0x71000535, 0xb0fd, 0x44d1,
[0x8c, 0xe0, 0x90, 0x97, 0x60, 0xe3, 0x95, 0x3c]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIScheduledGCCallback {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIScheduledGCCallback.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIScheduledGCCallbackCoerce {
/// Cheaply cast a value of this type from a `nsIScheduledGCCallback`.
fn coerce_from(v: &nsIScheduledGCCallback) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIScheduledGCCallbackCoerce for nsIScheduledGCCallback {
#[inline]
fn coerce_from(v: &nsIScheduledGCCallback) -> &Self {
v
}
}
impl nsIScheduledGCCallback {
/// Cast this `nsIScheduledGCCallback` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIScheduledGCCallbackCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIScheduledGCCallback {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIScheduledGCCallbackCoerce for T {
#[inline]
fn coerce_from(v: &nsIScheduledGCCallback) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIScheduledGCCallback
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIScheduledGCCallbackVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* void callback (); */
pub Callback: unsafe extern "system" fn (this: *const nsIScheduledGCCallback) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIScheduledGCCallback {
/// `void callback ();`
#[inline]
pub unsafe fn Callback(&self, ) -> ::nserror::nsresult {
((*self.vtable).Callback)(self, )
}
}
/// `interface nsIXPCComponents_Utils : nsISupports`
///
/// ```text
/// /**
/// * interface of Components.utils
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents_Utils {
vtable: &'static nsIXPCComponents_UtilsVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents_Utils.
unsafe impl XpCom for nsIXPCComponents_Utils {
const IID: nsIID = nsID(0x86003fe3, 0xee9a, 0x4620,
[0x91, 0xdc, 0xee, 0xf8, 0xb1, 0xe5, 0x88, 0x15]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents_Utils {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents_Utils.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponents_UtilsCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents_Utils`.
fn coerce_from(v: &nsIXPCComponents_Utils) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponents_UtilsCoerce for nsIXPCComponents_Utils {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Utils) -> &Self {
v
}
}
impl nsIXPCComponents_Utils {
/// Cast this `nsIXPCComponents_Utils` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponents_UtilsCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents_Utils {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponents_UtilsCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents_Utils) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents_Utils
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponents_UtilsVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* void printStderr (in AUTF8String message); */
pub PrintStderr: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, message: *const ::nsstring::nsACString) -> ::nserror::nsresult,
/* [implicit_jscontext] void reportError (in jsval error, [optional] in jsval stack); */
/// Unable to generate binding because `special type jsval unsupported`
pub ReportError: *const ::libc::c_void,
/* readonly attribute nsIXPCComponents_utils_Sandbox Sandbox; */
pub GetSandbox: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aSandbox: *mut *const nsIXPCComponents_utils_Sandbox) -> ::nserror::nsresult,
/* [implicit_jscontext,optional_argc] jsval evalInSandbox (in AString source, in jsval sandbox, [optional] in jsval version, [optional] in AUTF8String filename, [optional] in long lineNo, [optional] in boolean enforceFilenameRestrictions); */
/// Unable to generate binding because `special type jsval unsupported`
pub EvalInSandbox: *const ::libc::c_void,
/* [implicit_jscontext] jsval getUAWidgetScope (in nsIPrincipal principal); */
/// Unable to generate binding because `jscontext is unsupported`
pub GetUAWidgetScope: *const ::libc::c_void,
/* [implicit_jscontext] jsval getSandboxMetadata (in jsval sandbox); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetSandboxMetadata: *const ::libc::c_void,
/* [implicit_jscontext] void setSandboxMetadata (in jsval sandbox, in jsval metadata); */
/// Unable to generate binding because `special type jsval unsupported`
pub SetSandboxMetadata: *const ::libc::c_void,
/* [implicit_jscontext,optional_argc] jsval import (in AUTF8String aResourceURI, [optional] in jsval targetObj); */
/// Unable to generate binding because `special type jsval unsupported`
pub Import: *const ::libc::c_void,
/* boolean isModuleLoaded (in AUTF8String aResourceURI); */
pub IsModuleLoaded: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aResourceURI: *const ::nsstring::nsACString, _retval: *mut bool) -> ::nserror::nsresult,
/* boolean isJSModuleLoaded (in AUTF8String aResourceURI); */
pub IsJSModuleLoaded: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aResourceURI: *const ::nsstring::nsACString, _retval: *mut bool) -> ::nserror::nsresult,
/* boolean isESModuleLoaded (in AUTF8String aResourceURI); */
pub IsESModuleLoaded: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aResourceURI: *const ::nsstring::nsACString, _retval: *mut bool) -> ::nserror::nsresult,
/* void unload (in AUTF8String registryLocation); */
pub Unload: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, registryLocation: *const ::nsstring::nsACString) -> ::nserror::nsresult,
/* [implicit_jscontext] void importGlobalProperties (in jsval aPropertyList); */
/// Unable to generate binding because `special type jsval unsupported`
pub ImportGlobalProperties: *const ::libc::c_void,
/* [implicit_jscontext] xpcIJSWeakReference getWeakReference (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetWeakReference: *const ::libc::c_void,
/* [implicit_jscontext] void forceGC (); */
/// Unable to generate binding because `jscontext is unsupported`
pub ForceGC: *const ::libc::c_void,
/* void forceCC ([optional] in nsICycleCollectorListener aListener); */
pub ForceCC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aListener: *const nsICycleCollectorListener) -> ::nserror::nsresult,
/* nsICycleCollectorListener createCCLogger (); */
pub CreateCCLogger: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsICycleCollectorListener) -> ::nserror::nsresult,
/* void finishCC (); */
pub FinishCC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> ::nserror::nsresult,
/* void ccSlice (in long long budget); */
pub CcSlice: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, budget: i64) -> ::nserror::nsresult,
/* long getMaxCCSliceTimeSinceClear (); */
pub GetMaxCCSliceTimeSinceClear: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut i32) -> ::nserror::nsresult,
/* void clearMaxCCTime (); */
pub ClearMaxCCTime: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> ::nserror::nsresult,
/* [implicit_jscontext] void forceShrinkingGC (); */
/// Unable to generate binding because `jscontext is unsupported`
pub ForceShrinkingGC: *const ::libc::c_void,
/* void schedulePreciseGC (in nsIScheduledGCCallback callback); */
pub SchedulePreciseGC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, callback: *const nsIScheduledGCCallback) -> ::nserror::nsresult,
/* void schedulePreciseShrinkingGC (in nsIScheduledGCCallback callback); */
pub SchedulePreciseShrinkingGC: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, callback: *const nsIScheduledGCCallback) -> ::nserror::nsresult,
/* void unlinkGhostWindows (); */
pub UnlinkGhostWindows: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> ::nserror::nsresult,
/* void intentionallyLeak (); */
pub IntentionallyLeak: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> ::nserror::nsresult,
/* [implicit_jscontext] jsval getJSTestingFunctions (); */
/// Unable to generate binding because `jscontext is unsupported`
pub GetJSTestingFunctions: *const ::libc::c_void,
/* [implicit_jscontext] jsval getFunctionSourceLocation (in jsval func); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetFunctionSourceLocation: *const ::libc::c_void,
/* [implicit_jscontext] jsval callFunctionWithAsyncStack (in jsval func, in nsIStackFrame stack, in AString asyncCause); */
/// Unable to generate binding because `special type jsval unsupported`
pub CallFunctionWithAsyncStack: *const ::libc::c_void,
/* [implicit_jscontext] jsval getGlobalForObject (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetGlobalForObject: *const ::libc::c_void,
/* [implicit_jscontext] boolean isProxy (in jsval vobject); */
/// Unable to generate binding because `special type jsval unsupported`
pub IsProxy: *const ::libc::c_void,
/* [implicit_jscontext] jsval exportFunction (in jsval vfunction, in jsval vscope, [optional] in jsval voptions); */
/// Unable to generate binding because `special type jsval unsupported`
pub ExportFunction: *const ::libc::c_void,
/* [implicit_jscontext] jsval createObjectIn (in jsval vobj, [optional] in jsval voptions); */
/// Unable to generate binding because `special type jsval unsupported`
pub CreateObjectIn: *const ::libc::c_void,
/* [implicit_jscontext] void makeObjectPropsNormal (in jsval vobj); */
/// Unable to generate binding because `special type jsval unsupported`
pub MakeObjectPropsNormal: *const ::libc::c_void,
/* boolean isDeadWrapper (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub IsDeadWrapper: *const ::libc::c_void,
/* boolean isRemoteProxy (in jsval val); */
/// Unable to generate binding because `special type jsval unsupported`
pub IsRemoteProxy: *const ::libc::c_void,
/* [implicit_jscontext] void recomputeWrappers ([optional] in jsval vobj); */
/// Unable to generate binding because `special type jsval unsupported`
pub RecomputeWrappers: *const ::libc::c_void,
/* [implicit_jscontext] void setWantXrays (in jsval vscope); */
/// Unable to generate binding because `special type jsval unsupported`
pub SetWantXrays: *const ::libc::c_void,
/* [implicit_jscontext] void dispatch (in jsval runnable, [optional] in jsval scope); */
/// Unable to generate binding because `special type jsval unsupported`
pub Dispatch: *const ::libc::c_void,
/* readonly attribute boolean isInAutomation; */
pub GetIsInAutomation: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aIsInAutomation: *mut bool) -> ::nserror::nsresult,
/* void exitIfInAutomation (); */
pub ExitIfInAutomation: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> ::nserror::nsresult,
/* void crashIfNotInAutomation (); */
pub CrashIfNotInAutomation: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils) -> ::nserror::nsresult,
/* [implicit_jscontext] void setGCZeal (in long zeal); */
/// Unable to generate binding because `jscontext is unsupported`
pub SetGCZeal: *const ::libc::c_void,
/* [implicit_jscontext] void nukeSandbox (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub NukeSandbox: *const ::libc::c_void,
/* [implicit_jscontext] void blockScriptForGlobal (in jsval global); */
/// Unable to generate binding because `special type jsval unsupported`
pub BlockScriptForGlobal: *const ::libc::c_void,
/* [implicit_jscontext] void unblockScriptForGlobal (in jsval global); */
/// Unable to generate binding because `special type jsval unsupported`
pub UnblockScriptForGlobal: *const ::libc::c_void,
/* boolean isOpaqueWrapper (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub IsOpaqueWrapper: *const ::libc::c_void,
/* boolean isXrayWrapper (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub IsXrayWrapper: *const ::libc::c_void,
/* [implicit_jscontext] jsval waiveXrays (in jsval aVal); */
/// Unable to generate binding because `special type jsval unsupported`
pub WaiveXrays: *const ::libc::c_void,
/* [implicit_jscontext] jsval unwaiveXrays (in jsval aVal); */
/// Unable to generate binding because `special type jsval unsupported`
pub UnwaiveXrays: *const ::libc::c_void,
/* [implicit_jscontext] string getClassName (in jsval aObj, in boolean aUnwrap); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetClassName: *const ::libc::c_void,
/* [implicit_jscontext] jsval getIncumbentGlobal ([optional] in jsval callback); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetIncumbentGlobal: *const ::libc::c_void,
/* [implicit_jscontext] ACString getDebugName (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetDebugName: *const ::libc::c_void,
/* PRTime getWatchdogTimestamp (in AString aCategory); */
pub GetWatchdogTimestamp: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aCategory: *const ::nsstring::nsAString, _retval: *mut PRTime) -> ::nserror::nsresult,
/* [implicit_jscontext] jsval getJSEngineTelemetryValue (); */
/// Unable to generate binding because `jscontext is unsupported`
pub GetJSEngineTelemetryValue: *const ::libc::c_void,
/* [implicit_jscontext] jsval cloneInto (in jsval value, in jsval scope, [optional] in jsval options); */
/// Unable to generate binding because `special type jsval unsupported`
pub CloneInto: *const ::libc::c_void,
/* nsIPrincipal getWebIDLCallerPrincipal (); */
pub GetWebIDLCallerPrincipal: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsIPrincipal) -> ::nserror::nsresult,
/* [implicit_jscontext] nsIPrincipal getObjectPrincipal (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetObjectPrincipal: *const ::libc::c_void,
/* [implicit_jscontext] ACString getRealmLocation (in jsval obj); */
/// Unable to generate binding because `special type jsval unsupported`
pub GetRealmLocation: *const ::libc::c_void,
/* double now (); */
pub Now: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut libc::c_double) -> ::nserror::nsresult,
/* AUTF8String readUTF8File (in nsIFile file); */
pub ReadUTF8File: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, file: *const nsIFile, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* AUTF8String readUTF8URI (in nsIURI url); */
pub ReadUTF8URI: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, url: *const nsIURI, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
/* nsIEditorSpellCheck createSpellChecker (); */
pub CreateSpellChecker: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsIEditorSpellCheck) -> ::nserror::nsresult,
/* nsISupports createCommandLine (in Array<ACString> args, in nsIFile workingDir, in unsigned long state); */
pub CreateCommandLine: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, args: *const thin_vec::ThinVec<::nsstring::nsCString>, workingDir: *const nsIFile, state: u32, _retval: *mut *const nsISupports) -> ::nserror::nsresult,
/* nsICommandParams createCommandParams (); */
pub CreateCommandParams: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsICommandParams) -> ::nserror::nsresult,
/* nsILoadContext createLoadContext (); */
pub CreateLoadContext: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsILoadContext) -> ::nserror::nsresult,
/* nsILoadContext createPrivateLoadContext (); */
pub CreatePrivateLoadContext: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsILoadContext) -> ::nserror::nsresult,
/* nsIPersistentProperties createPersistentProperties (); */
pub CreatePersistentProperties: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsIPersistentProperties) -> ::nserror::nsresult,
/* nsIDocumentEncoder createDocumentEncoder (in string contentType); */
pub CreateDocumentEncoder: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, contentType: *const libc::c_char, _retval: *mut*const nsIDocumentEncoder) -> ::nserror::nsresult,
/* nsIDocumentEncoder createHTMLCopyEncoder (); */
pub CreateHTMLCopyEncoder: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, _retval: *mut*const nsIDocumentEncoder) -> ::nserror::nsresult,
/* readonly attribute Array<ACString> loadedModules; */
pub GetLoadedModules: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aLoadedModules: *mut thin_vec::ThinVec<::nsstring::nsCString>) -> ::nserror::nsresult,
/* readonly attribute Array<ACString> loadedJSModules; */
pub GetLoadedJSModules: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aLoadedJSModules: *mut thin_vec::ThinVec<::nsstring::nsCString>) -> ::nserror::nsresult,
/* readonly attribute Array<ACString> loadedESModules; */
pub GetLoadedESModules: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aLoadedESModules: *mut thin_vec::ThinVec<::nsstring::nsCString>) -> ::nserror::nsresult,
/* ACString getModuleImportStack (in AUTF8String aLocation); */
pub GetModuleImportStack: unsafe extern "system" fn (this: *const nsIXPCComponents_Utils, aLocation: *const ::nsstring::nsACString, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents_Utils {
/// `void printStderr (in AUTF8String message);`
#[inline]
pub unsafe fn PrintStderr(&self, message: *const ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).PrintStderr)(self, message)
}
/// `[implicit_jscontext] void reportError (in jsval error, [optional] in jsval stack);`
const _ReportError: () = ();
/// ```text
/// /**
/// * Cu.Sandbox is used to create a sandbox object
/// *
/// * let sandbox = Cu.Sandbox(principal[, options]);
/// *
/// * Using new Cu.Sandbox(...) to create a sandbox has the same effect as
/// * calling Cu.Sandbox(...) without new.
/// *
/// * In JS, Cu.Sandbox uses the following parameters:
/// *
/// * @param {Principal} principal
/// * The security principal defined for a sandbox determines what code
/// * running in that sandbox will be allowed to do. The principal may be one
/// * of four types: the system principal, a content principal, an expanded
/// * principal or a null principal. Depending on the principal type,
/// * this argument can be a nsIPrincipal, a Window, a String, an Array
/// * or null. See below.
/// * A content principal can be provided by passing a nsIPrincipal, a
/// * DOM Window, or a string URI (not recommended).
/// * An expanded (or extended) principal is an array of principals,
/// * where each item can be either a nsIPrincipal, a DOM window or a
/// * string URI.
/// * A null principal can either be specified by passing `null` or
/// * created explicitly with `Cc["@mozilla.org/nullprincipal;1"].createInstance(Ci.nsIPrincipal);`
/// * @param {Object} options
/// * Optional parameters, valid properties are:
/// * - allowWaivers: {Boolean} Allows the caller to waive Xrays, in case
/// * Xrays were used. Defaults to true.
/// * - discardSource: {Boolean} For certain globals, we know enough about
/// * the code that will run in them that we can discard script source
/// * entirely. A discarded source will be re-read when stringifying
/// * functions.
/// * Defaults to false.
/// * - forceSecureContext: {Boolean} Determines whether content windows and
/// * workers are marked as "Secure Context"s. If principal is the system
/// * principal, the value is forced to true. Otherwise defaults to false.
/// * - freshCompartment: {Boolean} Whether the sandbox should be created
/// * using a new compartment. Defaults to false.
/// * - freshZone: {Boolean} if true creates a new GC region separate from
/// * both the calling context's and the sandbox prototype's region.
/// * Defaults to false.
/// * - invisibleToDebugger: {Boolean} Whether this sandbox and its scripts
/// * can be accessed by the JavaScript Debugger.
/// * Defaults to false.
/// * - isWebExtensionContentScript: {Boolean} Whether this sandbox
/// * corresponds to a WebExtension content script, and should receive
/// * various bits of special compatibility behavior.
/// * Defaults to false.
/// * - metadata: {Object} Object to use as the metadata for the sandbox. See
/// * setSandboxMetadata.
/// * - originAttributes: {Object} Dictionary of origin attributes to use if
/// * the principal was provided as a string.
/// * - sameZoneAs: {Object} Javascript Object in whose garbage collection
/// * region the sandbox should be created. This helps to improve memory
/// * usage by allowing sandboxes to be discarded when that zone goes away.
/// * It also improves performance and memory usage by allowing strings
/// * to be passed between the compartments without copying or using
/// * wrappers.
/// * Content scripts should pass the window they're running in as this
/// * parameter, in order to ensure that the script is cleaned up at the
/// * same time as the content itself.
/// * - sandboxName: {String} Identifies the sandbox in about:memory. This
/// * property is optional, but very useful for tracking memory usage. A
/// * recommended value for this property is an absolute path to the script
/// * responsible for creating the sandbox. If you don't specify a sandbox
/// * name it will default to the caller's filename.
/// * - sandboxPrototype: {Object} Prototype object for the sandbox. The
/// * sandbox will inherit the contents of this object if it's provided.
/// * Passing a content window object, setting wantXrays:true (default) and
/// * using an extended principal provides a clean, isolated execution
/// * environment in which javascript code that needs Web APIs (such as
/// * accessing the window's DOM) can be executed without interference from
/// * untrusted content code.
/// * - userContextId: {Number} The id of the user context this sandbox is
/// * inside. Defaults to 0.
/// * - wantComponents: {Boolean} Indicates whether the Components object is
/// * available or not in the sandbox. If the sandbox interacts with
/// * untrusted content this should be set to false when possible to
/// * further reduce possible attack surface.
/// * Defaults to true.
/// * - wantExportHelpers: {Boolean} if true, then createObjectIn(),
/// * evalInWindow(), and exportFunction() are available in the sandbox.
/// * Defaults to false.
/// * - wantGlobalProperties: {Array<String>} Each string is the name of an
/// * object that you want to make available as a global to code running in
/// * the sandbox. Possible values: Blob, ChromeUtils, CSS, CSSRule,
/// * Directory, DOMParser, Element, Event, File, FileReader, FormData,
/// * InspectorCSSParser, InspectorUtils, MessageChannel, Node, NodeFilter,
/// PromiseDebugging, TextDecoder, TextEncoder, URL, URLSearchParams,
/// XMLHttpRequest, XMLSerializer, atob, btoa, caches, crypto, fetch,
/// indexedDB, rtcIdentityProvider
/// * - wantXrays: {Boolean} Whether the sandbox wants Xray vision with
/// * respect to same-origin objects outside the sandbox.
/// * Note that wantXrays is essentially deprecated. The preferred method
/// * of handling this now is to give the sandbox an expanded principal
/// * which inherits from the principal of the content compartment the
/// * sandbox will interact with. That lets the sandbox see the content
/// * compartment through X-ray wrappers, and gives any object passed from
/// * the sandbox to the content compartment opaque security wrappers unless
/// * export helpers are explicitly used.
/// * "Xray vision" is exactly the same Xray behavior that script always
/// * gets, by default, when working with DOM objects across origin
/// * boundaries. This is primarily visible for chrome code accessing
/// * content. However, it also occurs during cross-origin access between
/// * two content pages, since each page sees a "vanilla" view of the
/// * other. The protection is bidirectional: the caller sees the bonafide
/// * DOM objects without being confused by sneakily-redefined properties,
/// * and the target receives appropriate privacy from having its expandos
/// * inspected by untrusted callers. In situations where only
/// * unidirectional protection is needed, callers have the option to waive
/// * the X-ray behavior using wrappedJSObject or XPCNativeWrapper.unwrap().
/// * In general, when accessing same-origin content, script gets a
/// * Transparent wrapper rather than an Xray wrapper. However, sandboxes
/// * are often used when chrome wants to run script as another origin,
/// * possibly to interact with the page. In this case, same-origin Xrays
/// * are desirable, and wantXrays should be set to true.
/// * Defaults to true.
/// */
/// ```
///
/// `readonly attribute nsIXPCComponents_utils_Sandbox Sandbox;`
#[inline]
pub unsafe fn GetSandbox(&self, aSandbox: *mut *const nsIXPCComponents_utils_Sandbox) -> ::nserror::nsresult {
((*self.vtable).GetSandbox)(self, aSandbox)
}
/// `[implicit_jscontext,optional_argc] jsval evalInSandbox (in AString source, in jsval sandbox, [optional] in jsval version, [optional] in AUTF8String filename, [optional] in long lineNo, [optional] in boolean enforceFilenameRestrictions);`
const _EvalInSandbox: () = ();
/// `[implicit_jscontext] jsval getUAWidgetScope (in nsIPrincipal principal);`
const _GetUAWidgetScope: () = ();
/// `[implicit_jscontext] jsval getSandboxMetadata (in jsval sandbox);`
const _GetSandboxMetadata: () = ();
/// `[implicit_jscontext] void setSandboxMetadata (in jsval sandbox, in jsval metadata);`
const _SetSandboxMetadata: () = ();
/// `[implicit_jscontext,optional_argc] jsval import (in AUTF8String aResourceURI, [optional] in jsval targetObj);`
const _Import: () = ();
/// ```text
/// /**
/// * Returns true if the JSM is loaded into the system global previously via
/// * the import method above, or corresponding ESM is loaded. Returns false
/// * otherwise.
/// *
/// * @param resourceURI A resource:// URI string representing the location of
/// * the js file to be checked if it is already loaded or not.
/// * @returns boolean, true if the js file has been loaded via import. false
/// * otherwise
/// */
/// ```
///
/// `boolean isModuleLoaded (in AUTF8String aResourceURI);`
#[inline]
pub unsafe fn IsModuleLoaded(&self, aResourceURI: *const ::nsstring::nsACString, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).IsModuleLoaded)(self, aResourceURI, _retval)
}
/// ```text
/// /**
/// * Returns true if the JSM is loaded into the system global previously via
/// * the import method above. Returns false otherwise.
/// *
/// * TODO: Remove this once m-c, c-c, and out-of-tree code migrations finish
/// */
/// ```
///
/// `boolean isJSModuleLoaded (in AUTF8String aResourceURI);`
#[inline]
pub unsafe fn IsJSModuleLoaded(&self, aResourceURI: *const ::nsstring::nsACString, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).IsJSModuleLoaded)(self, aResourceURI, _retval)
}
/// ```text
/// /**
/// * Returns true if the ESM is loaded into the system global previously via
/// * the ChromeUtils.importESModule method etc. Returns false otherwise.
/// */
/// ```
///
/// `boolean isESModuleLoaded (in AUTF8String aResourceURI);`
#[inline]
pub unsafe fn IsESModuleLoaded(&self, aResourceURI: *const ::nsstring::nsACString, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).IsESModuleLoaded)(self, aResourceURI, _retval)
}
/// `void unload (in AUTF8String registryLocation);`
#[inline]
pub unsafe fn Unload(&self, registryLocation: *const ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).Unload)(self, registryLocation)
}
/// `[implicit_jscontext] void importGlobalProperties (in jsval aPropertyList);`
const _ImportGlobalProperties: () = ();
/// `[implicit_jscontext] xpcIJSWeakReference getWeakReference (in jsval obj);`
const _GetWeakReference: () = ();
/// `[implicit_jscontext] void forceGC ();`
const _ForceGC: () = ();
/// `void forceCC ([optional] in nsICycleCollectorListener aListener);`
#[inline]
pub unsafe fn ForceCC(&self, aListener: *const nsICycleCollectorListener) -> ::nserror::nsresult {
((*self.vtable).ForceCC)(self, aListener)
}
/// `nsICycleCollectorListener createCCLogger ();`
#[inline]
pub unsafe fn CreateCCLogger(&self, _retval: *mut*const nsICycleCollectorListener) -> ::nserror::nsresult {
((*self.vtable).CreateCCLogger)(self, _retval)
}
/// `void finishCC ();`
#[inline]
pub unsafe fn FinishCC(&self, ) -> ::nserror::nsresult {
((*self.vtable).FinishCC)(self, )
}
/// `void ccSlice (in long long budget);`
#[inline]
pub unsafe fn CcSlice(&self, budget: i64) -> ::nserror::nsresult {
((*self.vtable).CcSlice)(self, budget)
}
/// `long getMaxCCSliceTimeSinceClear ();`
#[inline]
pub unsafe fn GetMaxCCSliceTimeSinceClear(&self, _retval: *mut i32) -> ::nserror::nsresult {
((*self.vtable).GetMaxCCSliceTimeSinceClear)(self, _retval)
}
/// `void clearMaxCCTime ();`
#[inline]
pub unsafe fn ClearMaxCCTime(&self, ) -> ::nserror::nsresult {
((*self.vtable).ClearMaxCCTime)(self, )
}
/// `[implicit_jscontext] void forceShrinkingGC ();`
const _ForceShrinkingGC: () = ();
/// `void schedulePreciseGC (in nsIScheduledGCCallback callback);`
#[inline]
pub unsafe fn SchedulePreciseGC(&self, callback: *const nsIScheduledGCCallback) -> ::nserror::nsresult {
((*self.vtable).SchedulePreciseGC)(self, callback)
}
/// `void schedulePreciseShrinkingGC (in nsIScheduledGCCallback callback);`
#[inline]
pub unsafe fn SchedulePreciseShrinkingGC(&self, callback: *const nsIScheduledGCCallback) -> ::nserror::nsresult {
((*self.vtable).SchedulePreciseShrinkingGC)(self, callback)
}
/// `void unlinkGhostWindows ();`
#[inline]
pub unsafe fn UnlinkGhostWindows(&self, ) -> ::nserror::nsresult {
((*self.vtable).UnlinkGhostWindows)(self, )
}
/// `void intentionallyLeak ();`
#[inline]
pub unsafe fn IntentionallyLeak(&self, ) -> ::nserror::nsresult {
((*self.vtable).IntentionallyLeak)(self, )
}
/// `[implicit_jscontext] jsval getJSTestingFunctions ();`
const _GetJSTestingFunctions: () = ();
/// ```text
/// /**
/// * Returns an object containing `filename` and `lineNumber` properties
/// * describing the source location of the given function.
/// */
/// ```
///
/// `[implicit_jscontext] jsval getFunctionSourceLocation (in jsval func);`
const _GetFunctionSourceLocation: () = ();
/// `[implicit_jscontext] jsval callFunctionWithAsyncStack (in jsval func, in nsIStackFrame stack, in AString asyncCause);`
const _CallFunctionWithAsyncStack: () = ();
/// `[implicit_jscontext] jsval getGlobalForObject (in jsval obj);`
const _GetGlobalForObject: () = ();
/// `[implicit_jscontext] boolean isProxy (in jsval vobject);`
const _IsProxy: () = ();
/// `[implicit_jscontext] jsval exportFunction (in jsval vfunction, in jsval vscope, [optional] in jsval voptions);`
const _ExportFunction: () = ();
/// `[implicit_jscontext] jsval createObjectIn (in jsval vobj, [optional] in jsval voptions);`
const _CreateObjectIn: () = ();
/// `[implicit_jscontext] void makeObjectPropsNormal (in jsval vobj);`
const _MakeObjectPropsNormal: () = ();
/// ```text
/// /**
/// * Determines whether this object is backed by a DeadObjectProxy.
/// *
/// * Dead-wrapper objects hold no other objects alive (they have no outgoing
/// * reference edges) and will throw if you touch them (e.g. by
/// * reading/writing a property).
/// */
/// ```
///
/// `boolean isDeadWrapper (in jsval obj);`
const _IsDeadWrapper: () = ();
/// ```text
/// /**
/// * Determines whether this value is a remote object proxy, such as
/// * RemoteWindowProxy or RemoteLocationProxy, for an out-of-process frame.
/// *
/// * Remote object proxies do not grant chrome callers the same exemptions
/// * to the same-origin-policy that in-process wrappers typically do, so
/// * this can be used to determine whether access to cross-origin proxies is
/// * safe:
/// *
/// * if (!Cu.isRemoteProxy(frame.contentWindow)) {
/// * frame.contentWindow.doCrossOriginThing();
/// * }
/// */
/// ```
///
/// `boolean isRemoteProxy (in jsval val);`
const _IsRemoteProxy: () = ();
/// `[implicit_jscontext] void recomputeWrappers ([optional] in jsval vobj);`
const _RecomputeWrappers: () = ();
/// `[implicit_jscontext] void setWantXrays (in jsval vscope);`
const _SetWantXrays: () = ();
/// `[implicit_jscontext] void dispatch (in jsval runnable, [optional] in jsval scope);`
const _Dispatch: () = ();
/// `readonly attribute boolean isInAutomation;`
#[inline]
pub unsafe fn GetIsInAutomation(&self, aIsInAutomation: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetIsInAutomation)(self, aIsInAutomation)
}
/// `void exitIfInAutomation ();`
#[inline]
pub unsafe fn ExitIfInAutomation(&self, ) -> ::nserror::nsresult {
((*self.vtable).ExitIfInAutomation)(self, )
}
/// `void crashIfNotInAutomation ();`
#[inline]
pub unsafe fn CrashIfNotInAutomation(&self, ) -> ::nserror::nsresult {
((*self.vtable).CrashIfNotInAutomation)(self, )
}
/// `[implicit_jscontext] void setGCZeal (in long zeal);`
const _SetGCZeal: () = ();
/// `[implicit_jscontext] void nukeSandbox (in jsval obj);`
const _NukeSandbox: () = ();
/// `[implicit_jscontext] void blockScriptForGlobal (in jsval global);`
const _BlockScriptForGlobal: () = ();
/// `[implicit_jscontext] void unblockScriptForGlobal (in jsval global);`
const _UnblockScriptForGlobal: () = ();
/// ```text
/// /**
/// * Check whether the given object is an opaque wrapper (PermissiveXrayOpaque).
/// */
/// ```
///
/// `boolean isOpaqueWrapper (in jsval obj);`
const _IsOpaqueWrapper: () = ();
/// ```text
/// /**
/// * Check whether the given object is an XrayWrapper.
/// */
/// ```
///
/// `boolean isXrayWrapper (in jsval obj);`
const _IsXrayWrapper: () = ();
/// ```text
/// /**
/// * Waive Xray on a given value. Identity op for primitives.
/// */
/// ```
///
/// `[implicit_jscontext] jsval waiveXrays (in jsval aVal);`
const _WaiveXrays: () = ();
/// ```text
/// /**
/// * Strip off Xray waivers on a given value. Identity op for primitives.
/// */
/// ```
///
/// `[implicit_jscontext] jsval unwaiveXrays (in jsval aVal);`
const _UnwaiveXrays: () = ();
/// ```text
/// /**
/// * Gets the name of the JSClass of the object.
/// *
/// * if |aUnwrap| is true, all wrappers are unwrapped first. Unless you're
/// * specifically trying to detect whether the object is a proxy, this is
/// * probably what you want.
/// */
/// ```
///
/// `[implicit_jscontext] string getClassName (in jsval aObj, in boolean aUnwrap);`
const _GetClassName: () = ();
/// ```text
/// /**
/// * Gets the incument global for the execution of this function. For internal
/// * and testing use only.
/// *
/// * If |callback| is passed, it is invoked with the incumbent global as its
/// * sole argument. This allows the incumbent global to be measured in callback
/// * environments with no scripted frames on the stack.
/// */
/// ```
///
/// `[implicit_jscontext] jsval getIncumbentGlobal ([optional] in jsval callback);`
const _GetIncumbentGlobal: () = ();
/// ```text
/// /**
/// * Returns a name for the given function or object which is useful for
/// * debugging. It will be very similar to the name displayed in call
/// * stacks.
///
/// * Objects which contain a single enumerable property which is a function
/// * will generate a name based on that function. Any other non-function
/// * objects will return "nonfunction".
/// */
/// ```
///
/// `[implicit_jscontext] ACString getDebugName (in jsval obj);`
const _GetDebugName: () = ();
/// ```text
/// /**
/// * Retrieve the last time, in microseconds since epoch, that a given
/// * watchdog-related event occured.
/// *
/// * Valid categories:
/// * "ContextStateChange" - Context switching between active and inactive states
/// * "WatchdogWakeup" - Watchdog waking up from sleeping
/// * "WatchdogHibernateStart" - Watchdog begins hibernating
/// * "WatchdogHibernateStop" - Watchdog stops hibernating
/// */
/// ```
///
/// `PRTime getWatchdogTimestamp (in AString aCategory);`
#[inline]
pub unsafe fn GetWatchdogTimestamp(&self, aCategory: *const ::nsstring::nsAString, _retval: *mut PRTime) -> ::nserror::nsresult {
((*self.vtable).GetWatchdogTimestamp)(self, aCategory, _retval)
}
/// `[implicit_jscontext] jsval getJSEngineTelemetryValue ();`
const _GetJSEngineTelemetryValue: () = ();
/// `[implicit_jscontext] jsval cloneInto (in jsval value, in jsval scope, [optional] in jsval options);`
const _CloneInto: () = ();
/// `nsIPrincipal getWebIDLCallerPrincipal ();`
#[inline]
pub unsafe fn GetWebIDLCallerPrincipal(&self, _retval: *mut*const nsIPrincipal) -> ::nserror::nsresult {
((*self.vtable).GetWebIDLCallerPrincipal)(self, _retval)
}
/// `[implicit_jscontext] nsIPrincipal getObjectPrincipal (in jsval obj);`
const _GetObjectPrincipal: () = ();
/// `[implicit_jscontext] ACString getRealmLocation (in jsval obj);`
const _GetRealmLocation: () = ();
/// `double now ();`
#[inline]
pub unsafe fn Now(&self, _retval: *mut libc::c_double) -> ::nserror::nsresult {
((*self.vtable).Now)(self, _retval)
}
/// `AUTF8String readUTF8File (in nsIFile file);`
#[inline]
pub unsafe fn ReadUTF8File(&self, file: *const nsIFile, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).ReadUTF8File)(self, file, _retval)
}
/// `AUTF8String readUTF8URI (in nsIURI url);`
#[inline]
pub unsafe fn ReadUTF8URI(&self, url: *const nsIURI, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).ReadUTF8URI)(self, url, _retval)
}
/// `nsIEditorSpellCheck createSpellChecker ();`
#[inline]
pub unsafe fn CreateSpellChecker(&self, _retval: *mut*const nsIEditorSpellCheck) -> ::nserror::nsresult {
((*self.vtable).CreateSpellChecker)(self, _retval)
}
/// `nsISupports createCommandLine (in Array<ACString> args, in nsIFile workingDir, in unsigned long state);`
#[inline]
pub unsafe fn CreateCommandLine(&self, args: *const thin_vec::ThinVec<::nsstring::nsCString>, workingDir: *const nsIFile, state: u32, _retval: *mut *const nsISupports) -> ::nserror::nsresult {
((*self.vtable).CreateCommandLine)(self, args, workingDir, state, _retval)
}
/// `nsICommandParams createCommandParams ();`
#[inline]
pub unsafe fn CreateCommandParams(&self, _retval: *mut*const nsICommandParams) -> ::nserror::nsresult {
((*self.vtable).CreateCommandParams)(self, _retval)
}
/// `nsILoadContext createLoadContext ();`
#[inline]
pub unsafe fn CreateLoadContext(&self, _retval: *mut*const nsILoadContext) -> ::nserror::nsresult {
((*self.vtable).CreateLoadContext)(self, _retval)
}
/// `nsILoadContext createPrivateLoadContext ();`
#[inline]
pub unsafe fn CreatePrivateLoadContext(&self, _retval: *mut*const nsILoadContext) -> ::nserror::nsresult {
((*self.vtable).CreatePrivateLoadContext)(self, _retval)
}
/// `nsIPersistentProperties createPersistentProperties ();`
#[inline]
pub unsafe fn CreatePersistentProperties(&self, _retval: *mut*const nsIPersistentProperties) -> ::nserror::nsresult {
((*self.vtable).CreatePersistentProperties)(self, _retval)
}
/// `nsIDocumentEncoder createDocumentEncoder (in string contentType);`
#[inline]
pub unsafe fn CreateDocumentEncoder(&self, contentType: *const libc::c_char, _retval: *mut*const nsIDocumentEncoder) -> ::nserror::nsresult {
((*self.vtable).CreateDocumentEncoder)(self, contentType, _retval)
}
/// `nsIDocumentEncoder createHTMLCopyEncoder ();`
#[inline]
pub unsafe fn CreateHTMLCopyEncoder(&self, _retval: *mut*const nsIDocumentEncoder) -> ::nserror::nsresult {
((*self.vtable).CreateHTMLCopyEncoder)(self, _retval)
}
/// `readonly attribute Array<ACString> loadedModules;`
#[inline]
pub unsafe fn GetLoadedModules(&self, aLoadedModules: *mut thin_vec::ThinVec<::nsstring::nsCString>) -> ::nserror::nsresult {
((*self.vtable).GetLoadedModules)(self, aLoadedModules)
}
/// `readonly attribute Array<ACString> loadedJSModules;`
#[inline]
pub unsafe fn GetLoadedJSModules(&self, aLoadedJSModules: *mut thin_vec::ThinVec<::nsstring::nsCString>) -> ::nserror::nsresult {
((*self.vtable).GetLoadedJSModules)(self, aLoadedJSModules)
}
/// `readonly attribute Array<ACString> loadedESModules;`
#[inline]
pub unsafe fn GetLoadedESModules(&self, aLoadedESModules: *mut thin_vec::ThinVec<::nsstring::nsCString>) -> ::nserror::nsresult {
((*self.vtable).GetLoadedESModules)(self, aLoadedESModules)
}
/// `ACString getModuleImportStack (in AUTF8String aLocation);`
#[inline]
pub unsafe fn GetModuleImportStack(&self, aLocation: *const ::nsstring::nsACString, _retval: *mut ::nsstring::nsACString) -> ::nserror::nsresult {
((*self.vtable).GetModuleImportStack)(self, aLocation, _retval)
}
}
/// `interface nsIXPCComponents : nsISupports`
///
/// ```text
/// /**
/// * Interface for the 'Components' object.
/// */
/// ```
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIXPCComponents {
vtable: &'static nsIXPCComponentsVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIXPCComponents.
unsafe impl XpCom for nsIXPCComponents {
const IID: nsIID = nsID(0xaa28aaf6, 0x70ce, 0x4b03,
[0x95, 0x14, 0xaf, 0xe4, 0x3c, 0x7d, 0xfd, 0xa8]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIXPCComponents {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIXPCComponents.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIXPCComponentsCoerce {
/// Cheaply cast a value of this type from a `nsIXPCComponents`.
fn coerce_from(v: &nsIXPCComponents) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIXPCComponentsCoerce for nsIXPCComponents {
#[inline]
fn coerce_from(v: &nsIXPCComponents) -> &Self {
v
}
}
impl nsIXPCComponents {
/// Cast this `nsIXPCComponents` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIXPCComponentsCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIXPCComponents {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsISupportsCoerce> nsIXPCComponentsCoerce for T {
#[inline]
fn coerce_from(v: &nsIXPCComponents) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIXPCComponents
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIXPCComponentsVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute nsIXPCComponents_Interfaces interfaces; */
pub GetInterfaces: unsafe extern "system" fn (this: *const nsIXPCComponents, aInterfaces: *mut *const nsIXPCComponents_Interfaces) -> ::nserror::nsresult,
/* readonly attribute nsIXPCComponents_Results results; */
pub GetResults: unsafe extern "system" fn (this: *const nsIXPCComponents, aResults: *mut *const nsIXPCComponents_Results) -> ::nserror::nsresult,
/* boolean isSuccessCode (in nsresult result); */
pub IsSuccessCode: unsafe extern "system" fn (this: *const nsIXPCComponents, result: nserror::nsresult, _retval: *mut bool) -> ::nserror::nsresult,
/* readonly attribute nsIXPCComponents_Classes classes; */
pub GetClasses: unsafe extern "system" fn (this: *const nsIXPCComponents, aClasses: *mut *const nsIXPCComponents_Classes) -> ::nserror::nsresult,
/* readonly attribute nsIStackFrame stack; */
pub GetStack: unsafe extern "system" fn (this: *const nsIXPCComponents, aStack: *mut*const nsIStackFrame) -> ::nserror::nsresult,
/* readonly attribute nsIComponentManager manager; */
pub GetManager: unsafe extern "system" fn (this: *const nsIXPCComponents, aManager: *mut*const nsIComponentManager) -> ::nserror::nsresult,
/* readonly attribute nsIXPCComponents_Utils utils; */
pub GetUtils: unsafe extern "system" fn (this: *const nsIXPCComponents, aUtils: *mut *const nsIXPCComponents_Utils) -> ::nserror::nsresult,
/* readonly attribute nsIXPCComponents_ID ID; */
pub GetID: unsafe extern "system" fn (this: *const nsIXPCComponents, aID: *mut *const nsIXPCComponents_ID) -> ::nserror::nsresult,
/* readonly attribute nsIXPCComponents_Exception Exception; */
pub GetException: unsafe extern "system" fn (this: *const nsIXPCComponents, aException: *mut *const nsIXPCComponents_Exception) -> ::nserror::nsresult,
/* readonly attribute nsIXPCComponents_Constructor Constructor; */
pub GetConstructor: unsafe extern "system" fn (this: *const nsIXPCComponents, aConstructor: *mut *const nsIXPCComponents_Constructor) -> ::nserror::nsresult,
/* [implicit_jscontext] attribute jsval returnCode; */
/// Unable to generate binding because `special type jsval unsupported`
pub GetReturnCode: *const ::libc::c_void,
/* [implicit_jscontext] attribute jsval returnCode; */
/// Unable to generate binding because `special type jsval unsupported`
pub SetReturnCode: *const ::libc::c_void,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIXPCComponents {
/// `readonly attribute nsIXPCComponents_Interfaces interfaces;`
#[inline]
pub unsafe fn GetInterfaces(&self, aInterfaces: *mut *const nsIXPCComponents_Interfaces) -> ::nserror::nsresult {
((*self.vtable).GetInterfaces)(self, aInterfaces)
}
/// `readonly attribute nsIXPCComponents_Results results;`
#[inline]
pub unsafe fn GetResults(&self, aResults: *mut *const nsIXPCComponents_Results) -> ::nserror::nsresult {
((*self.vtable).GetResults)(self, aResults)
}
/// `boolean isSuccessCode (in nsresult result);`
#[inline]
pub unsafe fn IsSuccessCode(&self, result: nserror::nsresult, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).IsSuccessCode)(self, result, _retval)
}
/// `readonly attribute nsIXPCComponents_Classes classes;`
#[inline]
pub unsafe fn GetClasses(&self, aClasses: *mut *const nsIXPCComponents_Classes) -> ::nserror::nsresult {
((*self.vtable).GetClasses)(self, aClasses)
}
/// `readonly attribute nsIStackFrame stack;`
#[inline]
pub unsafe fn GetStack(&self, aStack: *mut*const nsIStackFrame) -> ::nserror::nsresult {
((*self.vtable).GetStack)(self, aStack)
}
/// `readonly attribute nsIComponentManager manager;`
#[inline]
pub unsafe fn GetManager(&self, aManager: *mut*const nsIComponentManager) -> ::nserror::nsresult {
((*self.vtable).GetManager)(self, aManager)
}
/// `readonly attribute nsIXPCComponents_Utils utils;`
#[inline]
pub unsafe fn GetUtils(&self, aUtils: *mut *const nsIXPCComponents_Utils) -> ::nserror::nsresult {
((*self.vtable).GetUtils)(self, aUtils)
}
/// `readonly attribute nsIXPCComponents_ID ID;`
#[inline]
pub unsafe fn GetID(&self, aID: *mut *const nsIXPCComponents_ID) -> ::nserror::nsresult {
((*self.vtable).GetID)(self, aID)
}
/// `readonly attribute nsIXPCComponents_Exception Exception;`
#[inline]
pub unsafe fn GetException(&self, aException: *mut *const nsIXPCComponents_Exception) -> ::nserror::nsresult {
((*self.vtable).GetException)(self, aException)
}
/// `readonly attribute nsIXPCComponents_Constructor Constructor;`
#[inline]
pub unsafe fn GetConstructor(&self, aConstructor: *mut *const nsIXPCComponents_Constructor) -> ::nserror::nsresult {
((*self.vtable).GetConstructor)(self, aConstructor)
}
/// `[implicit_jscontext] attribute jsval returnCode;`
const _GetReturnCode: () = ();
/// `[implicit_jscontext] attribute jsval returnCode;`
const _SetReturnCode: () = ();
}