netwerk/base/public/nsILoadContextInfo.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsISupports.idl"
     8 /**
     9  * Helper interface to carry informatin about the load context
    10  * encapsulating an AppID, IsInBrowser and IsPrivite properties.
    11  * It shall be used where nsILoadContext cannot be used or is not
    12  * available.
    13  */
    14 [scriptable, uuid(1ea9cbdb-9df4-46a0-8c45-f4091aad9459)]
    15 interface nsILoadContextInfo : nsISupports
    16 {
    17   /**
    18    * Whether the context is in a Private Browsing mode
    19    */
    20   readonly attribute boolean isPrivate;
    22   /**
    23    * Whether the context belongs under an App
    24    */
    25   const unsigned long NO_APP_ID = 0;
    26   const unsigned long UNKNOWN_APP_ID = 4294967295; // UINT32_MAX
    27   readonly attribute uint32_t appId;
    29   /**
    30    * Whether the context is in a browser tag
    31    */
    32   readonly attribute boolean isInBrowserElement;
    34   /**
    35    * Whether the load is initiated as anonymous
    36    */
    37   readonly attribute boolean isAnonymous;
    39 %{C++
    40   /**
    41    * De-XPCOMed getters
    42    */
    43   bool IsPrivate()
    44   {
    45     bool pb;
    46     GetIsPrivate(&pb);
    47     return pb;
    48   }
    50   uint32_t AppId()
    51   {
    52     uint32_t appId;
    53     GetAppId(&appId);
    54     return appId;
    55   }
    57   bool IsInBrowserElement()
    58   {
    59     bool ib;
    60     GetIsInBrowserElement(&ib);
    61     return ib;
    62   }
    64   bool IsAnonymous()
    65   {
    66     bool anon;
    67     GetIsAnonymous(&anon);
    68     return anon;
    69   }
    71   bool Equals(nsILoadContextInfo *aOther)
    72   {
    73     return (IsPrivate() == aOther->IsPrivate() &&
    74             AppId() == aOther->AppId() &&
    75             IsInBrowserElement() == aOther->IsInBrowserElement() &&
    76             IsAnonymous() == aOther->IsAnonymous());
    77   }
    78 %}
    79 };

mercurial