xpcom/components/nsIClassInfo.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #include "nsISupports.idl"
michael@0 8
michael@0 9 /**
michael@0 10 * Provides information about a specific implementation class. If you want
michael@0 11 * your class to implement nsIClassInfo, see nsIClassInfoImpl.h for
michael@0 12 * instructions--you most likely do not want to inherit from nsIClassInfo.
michael@0 13 */
michael@0 14
michael@0 15 [scriptable, uuid(986c11d0-f340-11d4-9075-0010a4e73d9a)]
michael@0 16 interface nsIClassInfo : nsISupports
michael@0 17 {
michael@0 18 /**
michael@0 19 * Get an ordered list of the interface ids that instances of the class
michael@0 20 * promise to implement. Note that nsISupports is an implicit member
michael@0 21 * of any such list and need not be included.
michael@0 22 *
michael@0 23 * Should set *count = 0 and *array = null and return NS_OK if getting the
michael@0 24 * list is not supported.
michael@0 25 */
michael@0 26 void getInterfaces(out uint32_t count,
michael@0 27 [array, size_is(count), retval] out nsIIDPtr array);
michael@0 28
michael@0 29 /**
michael@0 30 * Get a language mapping specific helper object that may assist in using
michael@0 31 * objects of this class in a specific lanaguage. For instance, if asked
michael@0 32 * for the helper for nsIProgrammingLanguage::JAVASCRIPT this might return
michael@0 33 * an object that can be QI'd into the nsIXPCScriptable interface to assist
michael@0 34 * XPConnect in supplying JavaScript specific behavior to callers of the
michael@0 35 * instance object.
michael@0 36 *
michael@0 37 * see: nsIProgrammingLanguage.idl
michael@0 38 *
michael@0 39 * Should return null if no helper available for given language.
michael@0 40 */
michael@0 41 nsISupports getHelperForLanguage(in uint32_t language);
michael@0 42
michael@0 43 /**
michael@0 44 * A contract ID through which an instance of this class can be created
michael@0 45 * (or accessed as a service, if |flags & SINGLETON|), or null.
michael@0 46 */
michael@0 47 readonly attribute string contractID;
michael@0 48
michael@0 49 /**
michael@0 50 * A human readable string naming the class, or null.
michael@0 51 */
michael@0 52 readonly attribute string classDescription;
michael@0 53
michael@0 54 /**
michael@0 55 * A class ID through which an instance of this class can be created
michael@0 56 * (or accessed as a service, if |flags & SINGLETON|), or null.
michael@0 57 */
michael@0 58 readonly attribute nsCIDPtr classID;
michael@0 59
michael@0 60 /**
michael@0 61 * Return language type from list in nsIProgrammingLanguage
michael@0 62 */
michael@0 63
michael@0 64 readonly attribute uint32_t implementationLanguage;
michael@0 65
michael@0 66 /**
michael@0 67 * Bitflags for 'flags' attribute.
michael@0 68 */
michael@0 69 const uint32_t SINGLETON = 1 << 0;
michael@0 70 const uint32_t THREADSAFE = 1 << 1;
michael@0 71 const uint32_t MAIN_THREAD_ONLY = 1 << 2;
michael@0 72 const uint32_t DOM_OBJECT = 1 << 3;
michael@0 73 const uint32_t PLUGIN_OBJECT = 1 << 4;
michael@0 74 const uint32_t SINGLETON_CLASSINFO = 1 << 5;
michael@0 75
michael@0 76 /**
michael@0 77 * 'flags' attribute bitflag: whether objects of this type implement
michael@0 78 * nsIContent.
michael@0 79 */
michael@0 80 const uint32_t CONTENT_NODE = 1 << 6;
michael@0 81
michael@0 82 // The high order bit is RESERVED for consumers of these flags.
michael@0 83 // No implementor of this interface should ever return flags
michael@0 84 // with this bit set.
michael@0 85 const uint32_t RESERVED = 1 << 31;
michael@0 86
michael@0 87
michael@0 88 readonly attribute uint32_t flags;
michael@0 89
michael@0 90 /**
michael@0 91 * Also a class ID through which an instance of this class can be created
michael@0 92 * (or accessed as a service, if |flags & SINGLETON|). If the class does
michael@0 93 * not have a CID, it should return NS_ERROR_NOT_AVAILABLE. This attribute
michael@0 94 * exists so C++ callers can avoid allocating and freeing a CID, as would
michael@0 95 * happen if they used classID.
michael@0 96 */
michael@0 97 [noscript] readonly attribute nsCID classIDNoAlloc;
michael@0 98
michael@0 99 };

mercurial