tor-browser

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

InterceptionInfo.h (1361B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      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 #ifndef mozilla_net_InterceptionInfo_h
      8 #define mozilla_net_InterceptionInfo_h
      9 
     10 #include "nsIContentPolicy.h"
     11 #include "nsIInterceptionInfo.h"
     12 #include "nsIPrincipal.h"
     13 #include "nsIRedirectHistoryEntry.h"
     14 #include "nsTArray.h"
     15 #include "nsCOMPtr.h"
     16 
     17 namespace mozilla::net {
     18 
     19 using RedirectHistoryArray = nsTArray<nsCOMPtr<nsIRedirectHistoryEntry>>;
     20 
     21 class InterceptionInfo final : public nsIInterceptionInfo {
     22 public:
     23  NS_DECL_THREADSAFE_ISUPPORTS
     24  NS_DECL_NSIINTERCEPTIONINFO
     25 
     26  InterceptionInfo(nsIPrincipal* aTriggeringPrincipal,
     27                   nsContentPolicyType aContentPolicyType,
     28                   const RedirectHistoryArray& aRedirectChain,
     29                   bool aFromThirdParty);
     30 
     31  using nsIInterceptionInfo::GetExtContentPolicyType;
     32 
     33 private:
     34  ~InterceptionInfo() = default;
     35 
     36  nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
     37  nsContentPolicyType mContentPolicyType{nsIContentPolicy::TYPE_INVALID};
     38  RedirectHistoryArray mRedirectChain;
     39  bool mFromThirdParty = false;
     40 };
     41 
     42 }  // namespace mozilla::net
     43 
     44 #endif