IntegrityPolicyService.h (1253B)
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 IntegrityPolicyService_h___ 8 #define IntegrityPolicyService_h___ 9 10 #include "mozilla/dom/IntegrityPolicy.h" 11 #include "nsIContentPolicy.h" 12 13 #define NS_INTEGRITYPOLICYSERVICE_CONTRACTID \ 14 "@mozilla.org/integritypolicyservice;1" 15 #define INTEGRITYPOLICYSERVICE_CID \ 16 {0x3662958c, 0x0e34, 0x4f57, {0xbc, 0x6d, 0x2a, 0xcc, 0xde, 0xb4, 0x34, 0x2e}} 17 18 namespace mozilla::dom { 19 20 class IntegrityPolicyService : public nsIContentPolicy { 21 public: 22 NS_DECL_ISUPPORTS 23 NS_DECL_NSICONTENTPOLICY 24 25 IntegrityPolicyService() = default; 26 27 bool ShouldRequestBeBlocked(nsIURI* aContentLocation, nsILoadInfo* aLoadInfo); 28 29 void MaybeReport(nsIURI* aContentLocation, nsILoadInfo* aLoadInfo, 30 IntegrityPolicy::DestinationType aDestination, bool aEnforce, 31 bool aReportOnly); 32 33 protected: 34 virtual ~IntegrityPolicyService(); 35 }; 36 } // namespace mozilla::dom 37 38 #endif /* IntegrityPolicyService_h___ */