/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Netscape Public License * Version 1.0 (the "NPL"); you may not use this file except in * compliance with the NPL. You may obtain a copy of the NPL at * http://www.mozilla.org/NPL/ * * Software distributed under the NPL is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL * for the specific language governing rights and limitations under the * NPL. * * The Initial Developer of this code under the NPL is Netscape * Communications Corporation. Portions created by Netscape are * Copyright (C) 1999 Netscape Communications Corporation. All Rights * Reserved. */ #include "nsISupports.idl" #include "nsIPrincipal.idl" [ptr] native nsJSPrincipalsList(nsJSPrincipalsList); [ptr] native JSContext(JSContext); [ptr] native JSObject(JSObject); [ptr] native JSFunction(JSFunction); [ptr] native jsval(jsval); interface nsString; interface nsIScriptContext; interface nsIScriptGlobalObject; interface nsIURI; %{C++ struct nsJSPrincipalsList; struct JSContext; struct JSObject; %} [uuid(58df5780-8006-11d2-bd91-00805f8ae3f4)] interface nsIScriptSecurityManager : nsISupports { // NB TODO: Change to string representation const short SCRIPT_SECURITY_ALL_ACCESS = 0 << 0; const short SCRIPT_SECURITY_NO_ACCESS = 1 << 0; const short SCRIPT_SECURITY_SAME_DOMAIN_ACCESS = 1 << 1; const short SCRIPT_SECURITY_SIGNED_ACCESS = 1 << 2; // NB TODO: Move to Capabilities manager const short eJSTarget_UniversalBrowserRead=0; const short eJSTarget_UniversalBrowserWrite=1; const short eJSTarget_UniversalSendMail=2; const short eJSTarget_UniversalFileRead=3; const short eJSTarget_UniversalFileWrite=4; const short eJSTarget_UniversalPreferencesRead=5; const short eJSTarget_UniversalPreferencesWrite=6; const short eJSTarget_UniversalDialerAccess=7; const short eJSTarget_Max=8; boolean CheckScriptAccess(in nsIScriptContext cx, in voidStar obj, [const] in string prop, in boolean isWrite); boolean CheckURI(in nsIScriptContext cx, in nsIURI uri); nsIPrincipal GetSystemPrincipal(); nsIPrincipal CreateCodebasePrincipal(in nsIURI aURI); }; %{C++ #define NS_SCRIPTSECURITYMANAGER_PROGID "component://netscape/scriptsecuritymanager" #define NS_SCRIPTSECURITYMANAGER_CLASSNAME "scriptsecuritymanager" %}