Bug 1854550 - pt 10. Allow LOG() with zero extra arguments r=glandium
[gecko.git] / dom / base / nsContentPolicy.h
blob079f7f6b8701854aa274b31439768f309dd7d08d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 // vim: ft=cpp ts=8 sw=2 et 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 __nsContentPolicy_h__
8 #define __nsContentPolicy_h__
10 #include "nsIContentPolicy.h"
11 #include "nsCategoryCache.h"
14 * Implementation of the "@mozilla.org/layout/content-policy;1" contract.
17 class nsContentPolicy : public nsIContentPolicy {
18 public:
19 NS_DECL_ISUPPORTS
20 NS_DECL_NSICONTENTPOLICY
22 nsContentPolicy();
24 protected:
25 virtual ~nsContentPolicy();
27 private:
28 // Array of policies
29 nsCategoryCache<nsIContentPolicy> mPolicies;
31 // Helper type for CheckPolicy
32 using CPMethod = decltype(&nsIContentPolicy::ShouldProcess);
34 // Helper method that applies policyMethod across all policies in mPolicies
35 // with the given parameters
36 nsresult CheckPolicy(CPMethod policyMethod, nsIURI* aURI,
37 nsILoadInfo* aLoadInfo, const nsACString& mimeGuess,
38 int16_t* decision);
41 nsresult NS_NewContentPolicy(nsIContentPolicy** aResult);
43 #endif /* __nsContentPolicy_h__ */