nsIContentSecurityManager.idl (1561B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #include "nsISupports.idl" 6 7 interface nsIChannel; 8 interface nsIPrincipal; 9 interface nsIStreamListener; 10 interface nsIURI; 11 12 /** 13 * nsIContentSecurityManager 14 * Describes an XPCOM component used to perform security checks. 15 */ 16 17 [scriptable, uuid(3a9a1818-2ae8-4ec5-a340-8b29d31fca3b)] 18 interface nsIContentSecurityManager : nsISupports 19 { 20 /** 21 * Checks whether a channel is allowed to access the given URI and 22 * whether the channel should be openend or should be blocked consulting 23 * internal security checks like Same Origin Policy, Content Security 24 * Policy, Mixed Content Blocker, etc. 25 * 26 * If security checks within performSecurityCheck fail, the function 27 * throws an exception. 28 * 29 * @param aChannel 30 * The channel about to be openend 31 * @param aStreamListener 32 * The Streamlistener of the channel potentially wrapped 33 * into CORSListenerProxy. 34 * @return 35 * The StreamListener of the channel wrapped into CORSListenerProxy. 36 * 37 * @throws NS_ERROR_DOM_BAD_URI 38 * If accessing the URI is not allowed (e.g. prohibted by SOP) 39 * @throws NS_ERROR_CONTENT_BLOCKED 40 * If any of the security policies (CSP, Mixed content) is violated 41 */ 42 nsIStreamListener performSecurityCheck(in nsIChannel aChannel, 43 in nsIStreamListener aStreamListener); 44 45 };