tor-browser

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

LoadContextInfo.h (1453B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef nsLoadContextInfo_h__
      6 #define nsLoadContextInfo_h__
      7 
      8 #include "nsILoadContextInfo.h"
      9 
     10 class nsIChannel;
     11 class nsILoadContext;
     12 
     13 namespace mozilla {
     14 namespace net {
     15 
     16 class LoadContextInfo final : public nsILoadContextInfo {
     17 public:
     18  NS_DECL_THREADSAFE_ISUPPORTS
     19  NS_DECL_NSILOADCONTEXTINFO
     20 
     21  LoadContextInfo(bool aIsAnonymous, OriginAttributes aOriginAttributes);
     22 
     23 private:
     24  virtual ~LoadContextInfo() = default;
     25 
     26 protected:
     27  bool mIsAnonymous : 1;
     28  OriginAttributes mOriginAttributes;
     29 };
     30 
     31 class LoadContextInfoFactory : public nsILoadContextInfoFactory {
     32  virtual ~LoadContextInfoFactory() = default;
     33 
     34 public:
     35  NS_DECL_ISUPPORTS  // deliberately not thread-safe
     36      NS_DECL_NSILOADCONTEXTINFOFACTORY
     37 };
     38 
     39 LoadContextInfo* GetLoadContextInfo(nsIChannel* aChannel);
     40 
     41 LoadContextInfo* GetLoadContextInfo(nsILoadContext* aLoadContext,
     42                                    bool aIsAnonymous);
     43 
     44 LoadContextInfo* GetLoadContextInfo(nsIDOMWindow* aWindow, bool aIsAnonymous);
     45 
     46 LoadContextInfo* GetLoadContextInfo(nsILoadContextInfo* aInfo);
     47 
     48 LoadContextInfo* GetLoadContextInfo(bool const aIsAnonymous,
     49                                    OriginAttributes const& aOriginAttributes);
     50 
     51 }  // namespace net
     52 }  // namespace mozilla
     53 
     54 #endif