tor-browser

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

FeaturePolicyParser.h (981B)


      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_dom_FeaturePolicyParser_h
      8 #define mozilla_dom_FeaturePolicyParser_h
      9 
     10 #include "nsString.h"
     11 
     12 class nsIPrincipal;
     13 
     14 namespace mozilla::dom {
     15 
     16 class Document;
     17 class Feature;
     18 
     19 class FeaturePolicyParser final {
     20 public:
     21  // aSelfOrigin must not be null. if aSrcOrigin is null, the parsing will not
     22  // support 'src' as valid allow directive value.
     23  static bool ParseString(const nsAString& aPolicy, Document* aDocument,
     24                          nsIPrincipal* aSelfOrigin, nsIPrincipal* aSrcOrigin,
     25                          nsTArray<Feature>& aParsedFeatures);
     26 };
     27 
     28 }  // namespace mozilla::dom
     29 
     30 #endif  // mozilla_dom_FeaturePolicyParser_h