Bug 1685822 [wpt PR 27117] - [Import Maps] Add tests for rejecting multiple import...
[gecko.git] / dom / security / CSPEvalChecker.h
blob912b70c62bccea7afb845dcaf7a406911cf70cdc
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/. */
7 #ifndef mozilla_dom_CSPEvalChecker_h
8 #define mozilla_dom_CSPEvalChecker_h
10 #include "nsString.h"
12 struct JSContext;
13 class nsGlobalWindowInner;
15 namespace mozilla {
16 namespace dom {
18 class WorkerPrivate;
20 class CSPEvalChecker final {
21 public:
22 static nsresult CheckForWindow(JSContext* aCx, nsGlobalWindowInner* aWindow,
23 const nsAString& aExpression,
24 bool* aAllowEval);
26 static nsresult CheckForWorker(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
27 const nsAString& aExpression,
28 bool* aAllowEval);
31 } // namespace dom
32 } // namespace mozilla
34 #endif // mozilla_dom_CSPEvalChecker_h