toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/finalizationwitness/nsIFinalizationWitnessService.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=40: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +
    1.13 +[scriptable, uuid(15686f9d-483e-4361-98cd-37f1e8f1e61d)]
    1.14 +interface nsIFinalizationWitnessService: nsISupports
    1.15 +{
    1.16 +  /**
    1.17 +   * Create a new Finalization Witness.
    1.18 +   *
    1.19 +   * A finalization witness is an object whose sole role is to
    1.20 +   * broadcast when it is garbage-collected. Once the witness is
    1.21 +   * created, call method its method |forget()| to prevent the
    1.22 +   * broadcast.
    1.23 +   *
    1.24 +   * @param aTopic The topic that the witness will broadcast using
    1.25 +   *               Services.obs.
    1.26 +   * @param aString The string that the witness will broadcast.
    1.27 +   * @return An object with a single method |forget()|.
    1.28 +   */
    1.29 +  [implicit_jscontext]
    1.30 +  jsval make(in string aTopic, in wstring aString);
    1.31 +};
    1.32 +
    1.33 +%{ C++
    1.34 +
    1.35 +#define FINALIZATIONWITNESSSERVICE_CID {0x15686f9d,0x483e,0x4361,{0x98,0xcd,0x37,0xf1,0xe8,0xf1,0xe6,0x1d}}
    1.36 +#define FINALIZATIONWITNESSSERVICE_CONTRACTID "@mozilla.org/toolkit/finalizationwitness;1"
    1.37 +
    1.38 +%}

mercurial