mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
c2e992ed6e
We log to MOZ_LOG, report an error to the console, send telemetry, and in debug builds - crash Differential Revision: https://phabricator.services.mozilla.com/D45055 --HG-- extra : moz-landing-system : lando
32 lines
1018 B
C++
32 lines
1018 B
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
/* A namespace class for static content security utilities. */
|
|
|
|
#ifndef nsContentSecurityUtils_h___
|
|
#define nsContentSecurityUtils_h___
|
|
|
|
namespace mozilla {
|
|
namespace dom {
|
|
class Document;
|
|
} // namespace dom
|
|
} // namespace mozilla
|
|
|
|
typedef mozilla::Pair<nsCString, mozilla::Maybe<nsString>> FilenameType;
|
|
|
|
class nsContentSecurityUtils {
|
|
public:
|
|
static FilenameType FilenameToEvalType(const nsString& fileName);
|
|
static bool IsEvalAllowed(JSContext* cx, nsIPrincipal* aSubjectPrincipal,
|
|
const nsAString& aScript);
|
|
|
|
#if defined(DEBUG)
|
|
static void AssertAboutPageHasCSP(mozilla::dom::Document* aDocument);
|
|
#endif
|
|
};
|
|
|
|
#endif /* nsContentSecurityUtils_h___ */
|