/src/mozilla-central/dom/security/nsContentSecurityManager.h
Line | Count | Source (jump to first uncovered line) |
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 nsContentSecurityManager_h___ |
8 | | #define nsContentSecurityManager_h___ |
9 | | |
10 | | #include "nsIContentSecurityManager.h" |
11 | | #include "nsIChannel.h" |
12 | | #include "nsIChannelEventSink.h" |
13 | | |
14 | | class nsIStreamListener; |
15 | | class nsIDocument; |
16 | | |
17 | | #define NS_CONTENTSECURITYMANAGER_CONTRACTID "@mozilla.org/contentsecuritymanager;1" |
18 | | // cdcc1ab8-3cea-4e6c-a294-a651fa35227f |
19 | | #define NS_CONTENTSECURITYMANAGER_CID \ |
20 | | { 0xcdcc1ab8, 0x3cea, 0x4e6c, \ |
21 | | { 0xa2, 0x94, 0xa6, 0x51, 0xfa, 0x35, 0x22, 0x7f } } |
22 | | |
23 | | class nsContentSecurityManager : public nsIContentSecurityManager |
24 | | , public nsIChannelEventSink |
25 | | { |
26 | | public: |
27 | | NS_DECL_ISUPPORTS |
28 | | NS_DECL_NSICONTENTSECURITYMANAGER |
29 | | NS_DECL_NSICHANNELEVENTSINK |
30 | | |
31 | | nsContentSecurityManager() {} |
32 | | |
33 | | static nsresult doContentSecurityCheck(nsIChannel* aChannel, |
34 | | nsCOMPtr<nsIStreamListener>& aInAndOutListener); |
35 | | |
36 | | static bool AllowTopLevelNavigationToDataURI(nsIChannel* aChannel); |
37 | | static bool AllowInsecureRedirectToDataURI(nsIChannel* aNewChannel); |
38 | | |
39 | | private: |
40 | | static nsresult CheckChannel(nsIChannel* aChannel); |
41 | | static nsresult CheckFTPSubresourceLoad(nsIChannel* aChannel); |
42 | | |
43 | 0 | virtual ~nsContentSecurityManager() {} |
44 | | |
45 | | }; |
46 | | |
47 | | #endif /* nsContentSecurityManager_h___ */ |