tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIInterceptionInfo.idl (2478B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 * vim: ft=cpp tw=78 sw=2 et ts=2 sts=2 cin
      3 * This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "nsISupports.idl"
      8 #include "nsIContentPolicy.idl"
      9 
     10 interface nsIPrincipal;
     11 interface nsIRedirectHistoryEntry;
     12 
     13 %{C++
     14 #include "nsTArray.h"
     15 %}
     16 
     17 [ref] native nsIRedirectHistoryEntryArray(const nsTArray<nsCOMPtr<nsIRedirectHistoryEntry>>);
     18 /**
     19 * nsIInterceptionInfo is used to record the needed information of the
     20 * InterceptedHttpChannel.
     21 * This infomration need to be propagated to the new channel which created by
     22 * FetchEvent.request or ServiceWorker NavigationPreload.
     23 */
     24 [scriptable, builtinclass, uuid(8b9cd81f-3cd1-4f6a-9086-92a9bbf055f4)]
     25 interface nsIInterceptionInfo : nsISupports
     26 {
     27  /**
     28   * InterceptedHttpChannel's triggering principal
     29   */
     30  [noscript, notxpcom, nostdcall, binaryname(TriggeringPrincipal)]
     31  nsIPrincipal binaryTriggeringPrincipal();
     32 
     33  [noscript, notxpcom, nostdcall, binaryname(SetTriggeringPrincipal)]
     34  void binarySetTriggeringPrincipal(in nsIPrincipal aPrincipal);
     35 
     36  /**
     37   * InterceptedHttpChannel's content policy type
     38   */
     39  [noscript, notxpcom, nostdcall, binaryname(ContentPolicyType)]
     40  nsContentPolicyType binaryContentPolicyType();
     41 
     42  [noscript, notxpcom, nostdcall, binaryname(ExternalContentPolicyType)]
     43  nsContentPolicyType binaryExternalContentPolicyType();
     44 
     45  [noscript, notxpcom, nostdcall, binaryname(SetContentPolicyType)]
     46  void binarySetContentPolicyType(in nsContentPolicyType aContentPolicyType);
     47 
     48 %{ C++
     49  inline ExtContentPolicyType GetExtContentPolicyType()
     50  {
     51    return static_cast<ExtContentPolicyType>(ExternalContentPolicyType());
     52  }
     53 %}
     54 
     55  /**
     56   * The InterceptedHttpChannel's redirect chain
     57   */
     58  [noscript, notxpcom, nostdcall, binaryname(RedirectChain)]
     59  nsIRedirectHistoryEntryArray binaryRedirectChain();
     60 
     61  [noscript, notxpcom, nostdcall, binaryname(SetRedirectChain)]
     62  void binarySetRedirectChain(
     63      in nsIRedirectHistoryEntryArray aRedirectChain);
     64 
     65  /**
     66   * The InterceptedHttpChannel is a third party channel or not.
     67   */
     68  [noscript, notxpcom, nostdcall, binaryname(FromThirdParty)]
     69  boolean binaryFromThirdParty();
     70 
     71  [noscript, notxpcom, nostdcall, binaryname(SetFromThirdParty)]
     72  void binarySetFromThirdParty(in boolean aFromThirdParty);
     73 };