Tue, 06 Jan 2015 21:39:09 +0100
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: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIFile; |
michael@0 | 9 | interface nsIComponentManager; |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * The nsIModule interface. |
michael@0 | 13 | */ |
michael@0 | 14 | |
michael@0 | 15 | [scriptable, uuid(7392D032-5371-11d3-994E-00805FD26FEE)] |
michael@0 | 16 | interface nsIModule : nsISupports |
michael@0 | 17 | { |
michael@0 | 18 | /** |
michael@0 | 19 | * Object Instance Creation |
michael@0 | 20 | * |
michael@0 | 21 | * Obtains a Class Object from a nsIModule for a given CID and IID pair. |
michael@0 | 22 | * This class object can either be query to a nsIFactory or a may be |
michael@0 | 23 | * query to a nsIClassInfo. |
michael@0 | 24 | * |
michael@0 | 25 | * @param aCompMgr : The global component manager |
michael@0 | 26 | * @param aClass : ClassID of object instance requested |
michael@0 | 27 | * @param aIID : IID of interface requested |
michael@0 | 28 | * |
michael@0 | 29 | */ |
michael@0 | 30 | void getClassObject(in nsIComponentManager aCompMgr, |
michael@0 | 31 | in nsCIDRef aClass, |
michael@0 | 32 | in nsIIDRef aIID, |
michael@0 | 33 | [retval, iid_is(aIID)] out nsQIResult aResult); |
michael@0 | 34 | |
michael@0 | 35 | |
michael@0 | 36 | /** |
michael@0 | 37 | * One time registration callback |
michael@0 | 38 | * |
michael@0 | 39 | * When the nsIModule is discovered, this method will be |
michael@0 | 40 | * called so that any setup registration can be preformed. |
michael@0 | 41 | * |
michael@0 | 42 | * @param aCompMgr : The global component manager |
michael@0 | 43 | * @param aLocation : The location of the nsIModule on disk |
michael@0 | 44 | * @param aLoaderStr: Opaque loader specific string |
michael@0 | 45 | * @param aType : Loader Type being used to load this module |
michael@0 | 46 | */ |
michael@0 | 47 | void registerSelf(in nsIComponentManager aCompMgr, |
michael@0 | 48 | in nsIFile aLocation, |
michael@0 | 49 | in string aLoaderStr, |
michael@0 | 50 | in string aType); |
michael@0 | 51 | /** |
michael@0 | 52 | * One time unregistration callback |
michael@0 | 53 | * |
michael@0 | 54 | * When the nsIModule is being unregistered, this method will be |
michael@0 | 55 | * called so that any unregistration can be preformed |
michael@0 | 56 | * |
michael@0 | 57 | * @param aCompMgr : The global component manager |
michael@0 | 58 | * @param aLocation : The location of the nsIModule on disk |
michael@0 | 59 | * @param aLoaderStr : Opaque loader specific string |
michael@0 | 60 | * |
michael@0 | 61 | */ |
michael@0 | 62 | void unregisterSelf(in nsIComponentManager aCompMgr, |
michael@0 | 63 | in nsIFile aLocation, |
michael@0 | 64 | in string aLoaderStr); |
michael@0 | 65 | |
michael@0 | 66 | /** |
michael@0 | 67 | * Module load management |
michael@0 | 68 | * |
michael@0 | 69 | * @param aCompMgr : The global component manager |
michael@0 | 70 | * |
michael@0 | 71 | * @return indicates to the caller if the module can be unloaded. |
michael@0 | 72 | * Returning PR_TRUE isn't a guarantee that the module will be |
michael@0 | 73 | * unloaded. It constitues only willingness of the module to be |
michael@0 | 74 | * unloaded. It is very important to ensure that no outstanding |
michael@0 | 75 | * references to the module's code/data exist before returning |
michael@0 | 76 | * PR_TRUE. |
michael@0 | 77 | * Returning PR_FALSE guaratees that the module won't be unloaded. |
michael@0 | 78 | */ |
michael@0 | 79 | boolean canUnload(in nsIComponentManager aCompMgr); |
michael@0 | 80 | }; |
michael@0 | 81 | |
michael@0 | 82 |