image/public/imgICache.idl

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
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: 2 -*-
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 interface nsIURI;
michael@0 10 interface imgIRequest;
michael@0 11 interface nsIProperties;
michael@0 12
michael@0 13 /**
michael@0 14 * imgICache interface
michael@0 15 *
michael@0 16 * @author Stuart Parmenter <pavlov@netscape.com>
michael@0 17 * @version 0.1
michael@0 18 * @see imagelib2
michael@0 19 */
michael@0 20 [scriptable, builtinclass, uuid(b06e0fa5-d6e2-4fa3-8fc0-7775aed96522)]
michael@0 21 interface imgICache : nsISupports
michael@0 22 {
michael@0 23 /**
michael@0 24 * Evict images from the cache.
michael@0 25 *
michael@0 26 * @param chrome If TRUE, evict only chrome images.
michael@0 27 * If FALSE, evict everything except chrome images.
michael@0 28 */
michael@0 29 void clearCache(in boolean chrome);
michael@0 30
michael@0 31 /**
michael@0 32 * Evict images from the cache.
michael@0 33 *
michael@0 34 * @param uri The URI to remove.
michael@0 35 * @throws NS_ERROR_NOT_AVAILABLE if \a uri was unable to be removed from the cache.
michael@0 36 */
michael@0 37 void removeEntry(in nsIURI uri);
michael@0 38
michael@0 39 /**
michael@0 40 * Find Properties
michael@0 41 * Used to get properties such as 'type' and 'content-disposition'
michael@0 42 * 'type' is a nsISupportsCString containing the images' mime type such as 'image/png'
michael@0 43 * 'content-disposition' will be a nsISupportsCString containing the header
michael@0 44 * If you call this before any data has been loaded from a URI, it will succeed,
michael@0 45 * but come back empty.
michael@0 46 *
michael@0 47 * Hopefully this will be removed with bug 805119
michael@0 48 *
michael@0 49 * @param uri The URI to look up.
michael@0 50 * @returns NULL if the URL was not found in the cache
michael@0 51 */
michael@0 52 nsIProperties findEntryProperties(in nsIURI uri);
michael@0 53
michael@0 54 /**
michael@0 55 * Make this cache instance respect private browsing notifications. This entails clearing
michael@0 56 * the chrome and content caches whenever the last-pb-context-exited notification is
michael@0 57 * observed.
michael@0 58 */
michael@0 59 void respectPrivacyNotifications();
michael@0 60 };

mercurial