toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl
author Mike Conley <mconley@mozilla.com>
Fri, 10 Apr 2015 13:45:22 -0400
changeset 257771 40a21375b99be21a55df2a7c415ccf240715922f
parent 159212 15dd7257c1f6d4335f662564326301100461f1bc
permissions -rw-r--r--
Bug 1152864 - Disable unsafe CPOW warnings when running mochitests by default, and add option to re-enable. r=ahal. --enable-cpow-warnings can now be passed when running a mochitest to re-enable the warnings, should one wish to do that.

/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=40: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"


[scriptable, uuid(15686f9d-483e-4361-98cd-37f1e8f1e61d)]
interface nsIFinalizationWitnessService: nsISupports
{
  /**
   * Create a new Finalization Witness.
   *
   * A finalization witness is an object whose sole role is to
   * broadcast when it is garbage-collected. Once the witness is
   * created, call method its method |forget()| to prevent the
   * broadcast.
   *
   * @param aTopic The topic that the witness will broadcast using
   *               Services.obs.
   * @param aString The string that the witness will broadcast.
   * @return An object with a single method |forget()|.
   */
  [implicit_jscontext]
  jsval make(in string aTopic, in wstring aString);
};

%{ C++

#define FINALIZATIONWITNESSSERVICE_CID {0x15686f9d,0x483e,0x4361,{0x98,0xcd,0x37,0xf1,0xe8,0xf1,0xe6,0x1d}}
#define FINALIZATIONWITNESSSERVICE_CONTRACTID "@mozilla.org/toolkit/finalizationwitness;1"

%}