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: 2; 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 nsISimpleEnumerator; |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * nsIDirectoryServiceProvider |
michael@0 | 13 | * |
michael@0 | 14 | * Used by Directory Service to get file locations. |
michael@0 | 15 | */ |
michael@0 | 16 | |
michael@0 | 17 | [scriptable, uuid(bbf8cab0-d43a-11d3-8cc2-00609792278c)] |
michael@0 | 18 | interface nsIDirectoryServiceProvider: nsISupports |
michael@0 | 19 | { |
michael@0 | 20 | /** |
michael@0 | 21 | * getFile |
michael@0 | 22 | * |
michael@0 | 23 | * Directory Service calls this when it gets the first request for |
michael@0 | 24 | * a prop or on every request if the prop is not persistent. |
michael@0 | 25 | * |
michael@0 | 26 | * @param prop The symbolic name of the file. |
michael@0 | 27 | * @param persistent TRUE - The returned file will be cached by Directory |
michael@0 | 28 | * Service. Subsequent requests for this prop will |
michael@0 | 29 | * bypass the provider and use the cache. |
michael@0 | 30 | * FALSE - The provider will be asked for this prop |
michael@0 | 31 | * each time it is requested. |
michael@0 | 32 | * |
michael@0 | 33 | * @return The file represented by the property. |
michael@0 | 34 | * |
michael@0 | 35 | */ |
michael@0 | 36 | nsIFile getFile(in string prop, out boolean persistent); |
michael@0 | 37 | }; |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | * nsIDirectoryServiceProvider2 |
michael@0 | 41 | * |
michael@0 | 42 | * An extension of nsIDirectoryServiceProvider which allows |
michael@0 | 43 | * multiple files to be returned for the given key. |
michael@0 | 44 | */ |
michael@0 | 45 | |
michael@0 | 46 | [scriptable, uuid(2f977d4b-5485-11d4-87e2-0010a4e75ef2)] |
michael@0 | 47 | interface nsIDirectoryServiceProvider2: nsIDirectoryServiceProvider |
michael@0 | 48 | { |
michael@0 | 49 | /** |
michael@0 | 50 | * getFiles |
michael@0 | 51 | * |
michael@0 | 52 | * Directory Service calls this when it gets a request for |
michael@0 | 53 | * a prop and the requested type is nsISimpleEnumerator. |
michael@0 | 54 | * |
michael@0 | 55 | * @param prop The symbolic name of the file list. |
michael@0 | 56 | * |
michael@0 | 57 | * @return An enumerator for a list of file locations. |
michael@0 | 58 | * The elements in the enumeration are nsIFile |
michael@0 | 59 | * @returnCode NS_SUCCESS_AGGREGATE_RESULT if this result should be |
michael@0 | 60 | * aggregated with other "lower" providers. |
michael@0 | 61 | */ |
michael@0 | 62 | nsISimpleEnumerator getFiles(in string prop); |
michael@0 | 63 | }; |
michael@0 | 64 | |
michael@0 | 65 | /** |
michael@0 | 66 | * nsIDirectoryService |
michael@0 | 67 | */ |
michael@0 | 68 | |
michael@0 | 69 | [scriptable, uuid(57a66a60-d43a-11d3-8cc2-00609792278c)] |
michael@0 | 70 | interface nsIDirectoryService: nsISupports |
michael@0 | 71 | { |
michael@0 | 72 | /** |
michael@0 | 73 | * init |
michael@0 | 74 | * |
michael@0 | 75 | * Must be called. Used internally by XPCOM initialization. |
michael@0 | 76 | * |
michael@0 | 77 | */ |
michael@0 | 78 | void init(); |
michael@0 | 79 | |
michael@0 | 80 | /** |
michael@0 | 81 | * registerProvider |
michael@0 | 82 | * |
michael@0 | 83 | * Register a provider with the service. |
michael@0 | 84 | * |
michael@0 | 85 | * @param prov The service will keep a strong reference |
michael@0 | 86 | * to this object. It will be released when |
michael@0 | 87 | * the service is released. |
michael@0 | 88 | * |
michael@0 | 89 | */ |
michael@0 | 90 | void registerProvider(in nsIDirectoryServiceProvider prov); |
michael@0 | 91 | |
michael@0 | 92 | /** |
michael@0 | 93 | * unregisterProvider |
michael@0 | 94 | * |
michael@0 | 95 | * Unregister a provider with the service. |
michael@0 | 96 | * |
michael@0 | 97 | * @param prov |
michael@0 | 98 | * |
michael@0 | 99 | */ |
michael@0 | 100 | void unregisterProvider(in nsIDirectoryServiceProvider prov); |
michael@0 | 101 | }; |
michael@0 | 102 | |
michael@0 | 103 |