netwerk/base/public/nsIPrivateBrowsingChannel.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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 /**
michael@0 9 * This interface is implemented by channels which support overriding the
michael@0 10 * privacy state of the channel.
michael@0 11 *
michael@0 12 * This interface must be used only from the XPCOM main thread.
michael@0 13 */
michael@0 14 [scriptable, uuid(df702bb0-55b8-11e2-bcfd-0800200c9a66)]
michael@0 15 interface nsIPrivateBrowsingChannel : nsISupports
michael@0 16 {
michael@0 17 /**
michael@0 18 * Determine whether the channel is tied to a private browsing window.
michael@0 19 *
michael@0 20 * This value can be set only before the channel is opened. Setting it
michael@0 21 * after that does not have any effect. This value overrides the privacy
michael@0 22 * state of the channel, which means that if you call this method, then
michael@0 23 * the loadGroup and load context will no longer be consulted when we
michael@0 24 * need to know the private mode status for a channel.
michael@0 25 *
michael@0 26 * Note that this value is only meant to be used when the channel's privacy
michael@0 27 * status cannot be obtained from the loadGroup or load context (for
michael@0 28 * example, when the channel is not associated with any loadGroup or load
michael@0 29 * context.) Setting this value directly should be avoided if possible.
michael@0 30 *
michael@0 31 * Implementations must enforce the ordering semantics of this function by
michael@0 32 * raising errors if setPrivate is called on a channel which has a loadGroup
michael@0 33 * and/or callbacks that implement nsILoadContext, or if the loadGroup
michael@0 34 * or notificationCallbacks are set after setPrivate has been called.
michael@0 35 *
michael@0 36 * @param aPrivate whether the channel should be opened in private mode.
michael@0 37 */
michael@0 38 void setPrivate(in boolean aPrivate);
michael@0 39
michael@0 40 /**
michael@0 41 * States whether the channel is in private browsing mode. This may either
michael@0 42 * happen because the channel is opened from a private mode context or
michael@0 43 * when the mode is explicitly set with ::setPrivate().
michael@0 44 *
michael@0 45 * This attribute is equivalent to NS_UsePrivateBrowsing(), but scriptable.
michael@0 46 */
michael@0 47 readonly attribute boolean isChannelPrivate;
michael@0 48
michael@0 49 /*
michael@0 50 * This function is used to determine whether the channel's private mode
michael@0 51 * has been overridden by a call to setPrivate. It is intended to be used
michael@0 52 * by NS_UsePrivateBrowsing(), and you should not call it directly.
michael@0 53 *
michael@0 54 * @param aValue the overridden value. This will only be set if the function
michael@0 55 * returns true.
michael@0 56 */
michael@0 57 [noscript] boolean isPrivateModeOverriden(out boolean aValue);
michael@0 58 };

mercurial