diff -U 10 -r -N old/plugin/oji/MRJCarbon/plugin/Resources/Strings.r new/plugin/oji/MRJCarbon/plugin/Resources/Strings.r
--- old/plugin/oji/MRJCarbon/plugin/Resources/Strings.r	2007-04-18 10:28:27.000000000 -0500
+++ new/plugin/oji/MRJCarbon/plugin/Resources/Strings.r	2007-10-06 20:48:23.000000000 -0500
@@ -74,21 +74,21 @@
 
 resource 'STR#' (126, purgeable) {
 	{	/* array StringArray: 2 elements */
 		/* [1] */
 		"Runs Java applets using the latest installed versions of Java. "
 		"For more information: "
 		"<A HREF=http://javaplugin.sourceforge.net/>Java Embedding Plugin</A>. "
 		"Run version test: "
 		"<A HREF=http://gemal.dk/browserspy/java.html>Java Information</A>.",
 		/* [2] */
-		"Java Embedding Plugin 0.9.6.3"
+		"Java Embedding Plugin 0.9.6.4"
 	}
 };
 
 resource 'STR#' (128, purgeable) {
 	{	/* array StringArray: 30 elements */
 		/* [1] */
 		"application/x-java-vm",
 		/* [2] */
 		"xjv",
 		/* [3] */
diff -U 10 -r -N old/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp new/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp
--- old/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp	2007-06-30 16:46:01.000000000 -0500
+++ new/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.cpp	2008-04-11 15:45:56.000000000 -0500
@@ -79,20 +79,23 @@
 nsID nsIScriptSecurityManagerNewIID = NS_ISCRIPTSECURITYMANAGERNEW_IID;
 nsID nsIScriptSecurityManagerNewAlt1IID = NS_ISCRIPTSECURITYMANAGERNEWALT1_IID;
 nsID nsIScriptSecurityManagerNewAlt2IID = NS_ISCRIPTSECURITYMANAGERNEWALT2_IID;
 nsID nsIScriptSecurityManagerNewAlt3IID = NS_ISCRIPTSECURITYMANAGERNEWALT3_IID;
 nsID nsIScriptSecurityManagerNewAlt4IID = NS_ISCRIPTSECURITYMANAGERNEWALT4_IID;
 nsID nsIScriptSecurityManagerNewerAlt1IID = NS_ISCRIPTSECURITYMANAGERNEWERALT1_IID;
 nsID nsIScriptSecurityManagerNewerAlt2IID = NS_ISCRIPTSECURITYMANAGERNEWERALT2_IID;
 nsID nsIScriptSecurityManagerNewerAlt3IID = NS_ISCRIPTSECURITYMANAGERNEWERALT3_IID;
 nsID nsIScriptSecurityManagerNewerAlt4IID = NS_ISCRIPTSECURITYMANAGERNEWERALT4_IID;
 nsID nsIScriptSecurityManagerNewerAlt5IID = NS_ISCRIPTSECURITYMANAGERNEWERALT5_IID;
+nsID nsIScriptSecurityManagerNewerAlt6IID = NS_ISCRIPTSECURITYMANAGERNEWERALT6_IID;
+nsID nsIScriptSecurityManagerNewerAlt7IID = NS_ISCRIPTSECURITYMANAGERNEWERALT7_IID;
+nsID nsIScriptSecurityManagerNewestAlt1IID = NS_ISCRIPTSECURITYMANAGERNEWESTALT1_IID;
 nsID nsIScriptSecurityManagerObsoleteIID = NS_ISCRIPTSECURITYMANAGEROBSOLETE_IID;
 
 #define PROXY_JNI_CALLS 1
 #define USE_LIVECONNECT_PROXY 1
 #define LOCAL_REFS_ARE_GLOBAL USE_LIVECONNECT_PROXY
 
 inline jobject ToGlobalRef(JNIEnv* env, jobject localRef)
 {
     if (!localRef)
         return NULL;
@@ -592,23 +595,25 @@
 #if USE_LIVECONNECT_PROXY
     JNIEnv* env = mSession->getCurrentEnv();
     // XXX this needs to be optimized up the wazoo.
     // somehow, get the associated class loader for the codebase of the currently running
     // script. doing this here would require us to use lots of unfrozen interfaces.
     nsresult rv = NS_OK;
     cfref<CFStringRef> info;
     nsIScriptSecurityManager *scriptSecurityManager = NULL;
     nsIScriptSecurityManagerNew *scriptSecurityManagerNew = NULL;
     nsIScriptSecurityManagerNewer *scriptSecurityManagerNewer = NULL;
+    nsIScriptSecurityManagerNewest *scriptSecurityManagerNewest = NULL;
     nsIPrincipal* scriptPrincipal = NULL;
     if (debugProxyJNI || (!mScriptSecurityManager &&
-        !mScriptSecurityManagerNew && !mScriptSecurityManagerNewer))
+        !mScriptSecurityManagerNew && !mScriptSecurityManagerNewer &&
+        !mScriptSecurityManagerNewest))
     {
 		/* The following is needed to work around a bug in Firefox 1.0RC1 (and
 		 * everything on the Aviary branch(es)), which was subsequently added
 		 * to Mozilla 1.7.5 (and everything on the Mozilla 1.7 branch), plus
 		 * two (unrelated) changes that were made (on 2004-04-25 and 2005-02-02)
 		 * to the nsIScriptSecurityManager on the trunk.
 		 * **The Bug**
 		 * Firefox 1.0RC1 made a backwards-incompatible change in the
 		 * nsIScriptSecurityManager XPCOM "service" ... despite (or perhaps
 		 * because of) an attempt to preserve backwards compatibility.  As of
@@ -677,79 +682,100 @@
                                        nsIScriptSecurityManagerNewAlt3IID,
                                        (void**)&scriptSecurityManagerNew);
         }
         if (!NS_SUCCEEDED(rv)) {
             rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
                                        nsIScriptSecurityManagerNewAlt4IID,
                                        (void**)&scriptSecurityManagerNew);
         }
         if (!NS_SUCCEEDED(rv)) {
             rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
-                                       nsIScriptSecurityManagerNewerAlt1IID,
+                                       nsIScriptSecurityManagerNewestAlt1IID,
+                                       (void**)&scriptSecurityManagerNewest);
+        }
+        if (!NS_SUCCEEDED(rv)) {
+            rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
+                                       nsIScriptSecurityManagerNewerAlt7IID,
+                                       (void**)&scriptSecurityManagerNewer);
+        }
+        if (!NS_SUCCEEDED(rv)) {
+            rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
+                                       nsIScriptSecurityManagerNewerAlt6IID,
+                                       (void**)&scriptSecurityManagerNewer);
+        }
+        if (!NS_SUCCEEDED(rv)) {
+            rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
+                                       nsIScriptSecurityManagerNewerAlt5IID,
+                                       (void**)&scriptSecurityManagerNewer);
+        }
+        if (!NS_SUCCEEDED(rv)) {
+            rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
+                                       nsIScriptSecurityManagerNewerAlt4IID,
                                        (void**)&scriptSecurityManagerNewer);
         }
         //if (!NS_SUCCEEDED(rv)) {
         //    rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
-        //                               nsIScriptSecurityManagerNewerAlt2IID,
+        //                               nsIScriptSecurityManagerNewerAlt3IID,
         //                               (void**)&scriptSecurityManagerNewer);
         //}
         //if (!NS_SUCCEEDED(rv)) {
         //    rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
-        //                               nsIScriptSecurityManagerNewerAlt3IID,
+        //                               nsIScriptSecurityManagerNewerAlt2IID,
         //                               (void**)&scriptSecurityManagerNewer);
         //}
         if (!NS_SUCCEEDED(rv)) {
             rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
-                                       nsIScriptSecurityManagerNewerAlt4IID,
-                                       (void**)&scriptSecurityManagerNewer);
-        }
-        if (!NS_SUCCEEDED(rv)) {
-            rv = MRJPlugin::GetService("@mozilla.org/scriptsecuritymanager;1",
-                                       nsIScriptSecurityManagerNewerAlt5IID,
+                                       nsIScriptSecurityManagerNewerAlt1IID,
                                        (void**)&scriptSecurityManagerNewer);
         }
         if (NS_SUCCEEDED(rv)) {
             if (scriptSecurityManager && !mScriptSecurityManager)
                 mScriptSecurityManager = scriptSecurityManager;
             if (scriptSecurityManagerNew && !mScriptSecurityManagerNew)
                 mScriptSecurityManagerNew = scriptSecurityManagerNew;
             if (scriptSecurityManagerNewer && !mScriptSecurityManagerNewer)
                 mScriptSecurityManagerNewer = scriptSecurityManagerNewer;
+            if (scriptSecurityManagerNewest && !mScriptSecurityManagerNewest)
+                mScriptSecurityManagerNewest = scriptSecurityManagerNewest;
         }
         if (debugProxyJNI) {
             if (NS_SUCCEEDED(rv)) {
                 info = CFStringCreateWithFormat(NULL, NULL,
                     CFSTR("MRJPluginJEP: GetService() succeeded, security manager 0x%.8X"),
                     ((unsigned) scriptSecurityManager ? (unsigned) scriptSecurityManager :
                     ((unsigned) scriptSecurityManagerNew ? (unsigned) scriptSecurityManagerNew :
-                    (unsigned) scriptSecurityManagerNewer)));
+                    ((unsigned) scriptSecurityManagerNewest ? (unsigned) scriptSecurityManagerNewest :
+                    (unsigned) scriptSecurityManagerNewer))));
             } else {
                 info = CFStringCreateWithFormat(NULL, NULL,
                     CFSTR("MRJPluginJEP: GetService() failed"));
             }
             JEPLogJavaMessage(info);
         }
     }
     // XXX Simple principal caching mechanism. If the principal is the same as
     // last time, then keep using the same LiveConnect proxy class. This should
     // be adequate for the simple cases of a single document using LiveConnect.
     // There should also be some caching going on inside ProxyClassLoaderFactory,
     // which should return the same class loader for the same URL, until this
     // prinicipal changes. Idea:  could use a weak reference dictionary that
     // only holds the class loader while there are other strong references to it.
     if (NS_SUCCEEDED(rv) && (mScriptSecurityManager ||
-        mScriptSecurityManagerNew || mScriptSecurityManagerNewer))
+        mScriptSecurityManagerNew || mScriptSecurityManagerNewer ||
+        mScriptSecurityManagerNewest))
     {
         if (mScriptSecurityManager) {
             rv = mScriptSecurityManager->GetSubjectPrincipal(&scriptPrincipal);
         } else if (mScriptSecurityManagerNew) {
             rv = mScriptSecurityManagerNew->GetSubjectPrincipal(&scriptPrincipal);
+        } else if (mScriptSecurityManagerNewest) {
+            rv = mScriptSecurityManagerNewest->GetSubjectPrincipal(&scriptPrincipal);
         } else {
             rv = mScriptSecurityManagerNewer->GetSubjectPrincipal(&scriptPrincipal);
         }
         if (NS_SUCCEEDED(rv)) {
             if (debugProxyJNI) {
                 info = CFStringCreateWithFormat(NULL, NULL,
                     CFSTR("MRJPluginJEP: GetSubjectPrincipal() succeeded, principal 0x%.8X"),
                     (unsigned) scriptPrincipal);
                 JEPLogJavaMessage(info);
             }
@@ -787,23 +813,24 @@
          * allowing it to proceed with no security.
          */
         printf("MRJ Plugin JEP: JavaScript-to-Java LiveConnect failed -- no security manager!\n");
         return;
     }
     if (mLiveConnectProxy) {
         proxyJNIProxySecurityBreak();
         if (debugProxyJNI) {
             info = CFStringCreateWithFormat(NULL, NULL,
                 CFSTR("MRJPluginJEP: doing proxyJNI with LiveConnectProxy security, security manager 0x%.8X"),
-                ((unsigned) mScriptSecurityManager ? (unsigned) mScriptSecurityManager :
-                ((unsigned) mScriptSecurityManagerNew ? (unsigned) mScriptSecurityManagerNew :
-                (unsigned) mScriptSecurityManagerNewer)));
+                ((unsigned) scriptSecurityManager ? (unsigned) scriptSecurityManager :
+                ((unsigned) scriptSecurityManagerNew ? (unsigned) scriptSecurityManagerNew :
+                ((unsigned) scriptSecurityManagerNewest ? (unsigned) scriptSecurityManagerNewest :
+                (unsigned) scriptSecurityManagerNewer))));
             JEPLogJavaMessage(info);
         }
         jobject runnable = CreateJNIRunnable(env, msg);
         if (runnable) {
             if (JEPCheckBundle()) {
                 jobject applet = NULL;
                 MRJPluginInstance *pluginInstance = msg->getPluginInstance();
                 if (pluginInstance)
                     pluginInstance->GetJavaObject(&applet);
                 Boolean isCallMethodCall = msg->isCallMethodCall();
@@ -821,23 +848,24 @@
         }
     } else {
         if (!scriptPrincipal) {
             proxyJNINoSecurityNullPrincipalBreak();
         } else {
             proxyJNINoSecurityBreak();
         }
         if (debugProxyJNI) {
             info = CFStringCreateWithFormat(NULL, NULL,
                 CFSTR("MRJPluginJEP: doing proxyJNI with no additional security, security manager 0x%.8X"),
-                ((unsigned) mScriptSecurityManager ? (unsigned) mScriptSecurityManager :
-                ((unsigned) mScriptSecurityManagerNew ? (unsigned) mScriptSecurityManagerNew :
-                (unsigned) mScriptSecurityManagerNewer)));
+                ((unsigned) scriptSecurityManager ? (unsigned) scriptSecurityManager :
+                ((unsigned) scriptSecurityManagerNew ? (unsigned) scriptSecurityManagerNew :
+                ((unsigned) scriptSecurityManagerNewest ? (unsigned) scriptSecurityManagerNewest :
+                (unsigned) scriptSecurityManagerNewer))));
             JEPLogJavaMessage(info);
         }
         msg->execute(env);
         savePendingException(env);
     }
 #else
 	messageLoop(mProxyEnv, msg, mJavaQueue, mNativeQueue, true);
 #endif
 }
 
@@ -924,22 +952,22 @@
 	env->DeleteLocalRef(description);
 	return retval;
 }
 
 CSecureEnv::CSecureEnv(MRJPlugin* plugin, JNIEnv* proxyEnv, JNIEnv* javaEnv)
 	:	mPlugin(plugin), mProxyEnv(proxyEnv), mJavaEnv(javaEnv),
 		mSession(plugin->getSession()), mThreadManager(plugin->getThreadManager()),
 		mIsRunning(NULL), mJavaQueue(NULL), mNativeQueue(NULL),
 		mPendingException(NULL),
 		mScriptSecurityManager(NULL), mScriptSecurityManagerNew(NULL),
-		mScriptSecurityManagerNewer(NULL), mScriptPrincipal(NULL),
-		mLiveConnectProxy(NULL)
+		mScriptSecurityManagerNewer(NULL), mScriptSecurityManagerNewest(NULL),
+		mScriptPrincipal(NULL), mLiveConnectProxy(NULL)
 {
 	if (mJavaEnv != NULL) {
 		CreateNativeThread(this);
 	} else {
 #if USE_LIVECONNECT_PROXY
 		mJavaEnv = mSession->getCurrentEnv();
 #else
 		CreateJNIThread(this);
 #endif
 	}
@@ -961,20 +989,21 @@
     
     if (mLiveConnectProxy) {
         env->DeleteGlobalRef(mLiveConnectProxy);
         mLiveConnectProxy = NULL;
     }
     
     NS_IF_RELEASE(mScriptPrincipal);
     NS_IF_RELEASE(mScriptSecurityManager);
     NS_IF_RELEASE(mScriptSecurityManagerNew);
     NS_IF_RELEASE(mScriptSecurityManagerNewer);
+    NS_IF_RELEASE(mScriptSecurityManagerNewest);
 }
 
 NS_IMPL_ADDREF(CSecureEnv)
 NS_IMPL_RELEASE(CSecureEnv)
 
 NS_METHOD CSecureEnv::QueryInterface(const nsIID& aIID, void** aInstancePtr)
 {
 	static nsID nsISecureEnvIID = NS_ISECUREENV_IID;
     if (aInstancePtr == NULL) {
         return NS_ERROR_NULL_POINTER;
diff -U 10 -r -N old/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h new/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h
--- old/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h	2007-06-30 16:44:31.000000000 -0500
+++ new/plugin/oji/MRJCarbon/plugin/Source/CSecureEnv.h	2008-04-11 15:26:36.000000000 -0500
@@ -42,20 +42,21 @@
 
 #ifndef CSecureJNI2_h___
 #define CSecureJNI_h___
 
 #include <MacTypes.h>
 #include "nsISecureEnv.h"
 #include "nsjvmFixes.h"
 #include "nsIScriptSecurityManagerOld.h"
 #include "nsIScriptSecurityManagerNew.h"
 #include "nsIScriptSecurityManagerNewer.h"
+#include "nsIScriptSecurityManagerNewest.h"
 
 /* See https://bugzilla.mozilla.org/show_bug.cgi?id=293973 for the latest
  * on this issue -- proliferating nsIScriptSecurityManager IIDs.
  */
 #define NS_ISCRIPTSECURITYMANAGERNEW_IID \
   {0x18158378, 0xb632, 0x436a, \
     { 0x9c, 0xed, 0xc5, 0x2d, 0xed, 0x35, 0x0b, 0xde }}
 #define NS_ISCRIPTSECURITYMANAGERNEWALT1_IID \
   {0x82bff35d, 0xebb7, 0x4cb9, \
     { 0xbb, 0x47, 0x4f, 0x9e, 0xbd, 0xf1, 0x1f, 0x77 }}
@@ -76,20 +77,29 @@
     { 0x98, 0x05, 0x7a, 0xb8, 0x57, 0xb3, 0x35, 0xa1 }}
 #define NS_ISCRIPTSECURITYMANAGERNEWERALT3_IID \
   {0xb9024f88, 0x9ad2, 0x491c, \
     { 0x97, 0x77, 0xce, 0x51, 0x91, 0x03, 0x3d, 0x3d }}
 #define NS_ISCRIPTSECURITYMANAGERNEWERALT4_IID \
   {0xc61d3ad1, 0x00aa, 0x407c, \
     { 0xb7, 0xd7, 0xde, 0x48, 0xb3, 0xf1, 0x86, 0x62 }}
 #define NS_ISCRIPTSECURITYMANAGERNEWERALT5_IID \
   {0x0b8a9b32, 0x713f, 0x4c39, \
     { 0xbe, 0xa0, 0x6c, 0xac, 0xec, 0x46, 0xf3, 0x85 }}
+#define NS_ISCRIPTSECURITYMANAGERNEWERALT6_IID \
+  {0xce216cf7, 0x3bcb, 0x48ab, \
+    { 0x9f, 0xf8, 0xd0, 0x3a, 0x24, 0xf1, 0x9c, 0xa5 }}
+#define NS_ISCRIPTSECURITYMANAGERNEWERALT7_IID \
+  {0x3fffd8e8, 0x3fea, 0x442e, \
+    { 0xa0, 0xed, 0x2b, 0xa8, 0x1a, 0xe1, 0x97, 0xd5 }}
+#define NS_ISCRIPTSECURITYMANAGERNEWESTALT1_IID \
+  {0xe74487fd, 0x98ef, 0x48d1, \
+    { 0xb9, 0x73, 0x3f, 0x29, 0x38, 0xf0, 0x4e, 0x8e }}
 #ifndef NS_ISCRIPTSECURITYMANAGEROBSOLETE_IID
 #define NS_ISCRIPTSECURITYMANAGEROBSOLETE_IID \
   {0x58df5780, 0x8006, 0x11d2, \
     { 0xbd, 0x91, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4 }}
 #endif
 
 class MRJPlugin;
 class MRJSession;
 
 class Monitor;
@@ -453,20 +463,21 @@
     jboolean*                   mIsRunning;
     JavaMessageQueue*           mJavaQueue;
     JavaMessageQueue*           mNativeQueue;
 
     jthrowable                  mPendingException;
     static long                 mSuspendExceptionsLevel;
     
     nsIScriptSecurityManager*       mScriptSecurityManager;
     nsIScriptSecurityManagerNew*    mScriptSecurityManagerNew;
     nsIScriptSecurityManagerNewer*  mScriptSecurityManagerNewer;
+    nsIScriptSecurityManagerNewest* mScriptSecurityManagerNewest;
     nsIPrincipal*                   mScriptPrincipal;
     jclass                          mLiveConnectProxy;
 };
 
 /**
  * Returns the secure JNI associated with the current thread (if any).
  */
 CSecureEnv* GetSecureJNI(JNIEnv* env, jobject thread);
 
 #endif // CSecureJNI2_h___
diff -U 10 -r -N old/plugin/oji/MRJCarbon/plugin/Source/JavaEmbeddingPlugin.h new/plugin/oji/MRJCarbon/plugin/Source/JavaEmbeddingPlugin.h
--- old/plugin/oji/MRJCarbon/plugin/Source/JavaEmbeddingPlugin.h	2007-04-18 10:28:10.000000000 -0500
+++ new/plugin/oji/MRJCarbon/plugin/Source/JavaEmbeddingPlugin.h	2007-10-06 20:46:43.000000000 -0500
@@ -37,21 +37,21 @@
  * handler in a browser that (like all of the Mozilla family) assumes applet
  * creation and initialization will be synchronous.  To go back to the
  * original, fully asynchronous behavior, add "-Djep.asyncinit=true" to the
  * Java Control Panel's "runtime parameters".)
  */
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#define JEP_VERSION "0.9.6.3"
+#define JEP_VERSION "0.9.6.4"
 #define JEP_VERSION_OPTION "jep.version"
 
 /* As described above */
 #define JEP_ASYNCINIT_OPTION "jep.asyncinit"
 /* As of JEP 0.8.7, JSObject's methods (the Java-to-JavaScript LiveConnect
  * calls) time out after a fairly long interval (currently 2000 milliseconds).
  * This was how versions 0.8.3 through 0.8.5 behaved.  Version 0.8.6 waited
  * indefinitely for these calls to return.  This sometimes allows poorly
  * written applets to hang the browser, but timing out the calls can also
  * cause trouble.  Adding "-Djep.jsobjectnotimeout=true" to the Java Control
diff -U 10 -r -N old/plugin/oji/MRJCarbon/plugin/Source/nsIScriptSecurityManagerNewest.h new/plugin/oji/MRJCarbon/plugin/Source/nsIScriptSecurityManagerNewest.h
--- old/plugin/oji/MRJCarbon/plugin/Source/nsIScriptSecurityManagerNewest.h	1969-12-31 18:00:00.000000000 -0600
+++ new/plugin/oji/MRJCarbon/plugin/Source/nsIScriptSecurityManagerNewest.h	2008-04-11 16:07:11.000000000 -0500
@@ -0,0 +1,573 @@
+/*
+ * DO NOT EDIT.  THIS FILE IS GENERATED FROM /usr/local/src/Mozilla/cvs/mozilla/caps/idl/nsIScriptSecurityManager.idl
+ */
+
+#ifndef __gen_nsIScriptSecurityManagerNewest_h__
+#define __gen_nsIScriptSecurityManagerNewest_h__
+
+
+#ifndef __gen_nsISupports_h__
+#include "nsISupports.h"
+#endif
+
+#ifndef __gen_nsIPrincipal_h__
+#include "nsIPrincipal.h"
+#endif
+
+#ifndef __gen_nsIXPCSecurityManager_h__
+#include "nsIXPCSecurityManager.h"
+#endif
+
+/* For IDL files that don't want to include root IDL files. */
+#ifndef NS_NO_VTABLE
+#define NS_NO_VTABLE
+#endif
+class nsIURI; /* forward declaration */
+
+class nsIChannel; /* forward declaration */
+
+
+/* starting interface:    nsIScriptSecurityManager */
+#define NS_ISCRIPTSECURITYMANAGERNEWESTALT1_IID_STR "e74487fd-98ef-48d1-b973-3f2938f04e8e"
+
+#ifndef NS_ISCRIPTSECURITYMANAGERNEWESTALT1_IID
+#define NS_ISCRIPTSECURITYMANAGERNEWESTALT1_IID \
+  {0xe74487fd, 0x98ef, 0x48d1, \
+    { 0xb9, 0x73, 0x3f, 0x29, 0x38, 0xf0, 0x4e, 0x8e }}
+#endif
+
+#ifndef NS_SCRIPTABLE
+#define NS_SCRIPTABLE
+#endif
+
+class NS_NO_VTABLE NS_SCRIPTABLE nsIScriptSecurityManagerNewest : public nsIXPCSecurityManager {
+ public: 
+
+#ifdef NS_DECLARE_STATIC_IID_ACCESSOR
+  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTSECURITYMANAGERNEWESTALT1_IID)
+#else
+  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTSECURITYMANAGERNEWESTALT1_IID)
+#endif
+
+  /**
+     * Checks whether the running script is allowed to access aProperty.
+     */
+  /* [noscript] void checkPropertyAccess (in JSContextPtr aJSContext, in JSObjectPtr aJSObject, in string aClassName, in JSVal aProperty, in PRUint32 aAction); */
+  NS_IMETHOD CheckPropertyAccess(JSContext * aJSContext, JSObject * aJSObject, const char *aClassName, jsval aProperty, PRUint32 aAction) = 0;
+
+  /**
+     * Check that the script currently running in context "cx" can load "uri".
+     *
+     * Will return error code NS_ERROR_DOM_BAD_URI if the load request 
+     * should be denied.
+     *
+     * @param cx the JSContext of the script causing the load
+     * @param uri the URI that is being loaded
+     */
+  /* [noscript] void checkLoadURIFromScript (in JSContextPtr cx, in nsIURI uri); */
+  NS_IMETHOD CheckLoadURIFromScript(JSContext * cx, nsIURI *uri) = 0;
+
+  /**
+     * Default CheckLoadURI permissions
+     */
+  enum { STANDARD = 0U };
+
+  enum { LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT = 1U };
+
+  enum { ALLOW_CHROME = 2U };
+
+  enum { DISALLOW_INHERIT_PRINCIPAL = 4U };
+
+  enum { DISALLOW_SCRIPT_OR_DATA = 4U };
+
+  enum { DISALLOW_SCRIPT = 8U };
+
+  /**
+     * Check that content with principal aPrincipal can load "uri".
+     *
+     * Will return error code NS_ERROR_DOM_BAD_URI if the load request 
+     * should be denied.
+     *
+     * @param aPrincipal the principal identifying the actor causing the load
+     * @param uri the URI that is being loaded
+     * @param flags the permission set, see above
+     */
+  /* void checkLoadURIWithPrincipal (in nsIPrincipal aPrincipal, in nsIURI uri, in unsigned long flags); */
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIWithPrincipal(nsIPrincipal *aPrincipal, nsIURI *uri, PRUint32 flags) = 0;
+
+  /**
+     * Check that content from "from" can load "uri".
+     *
+     * Will return error code NS_ERROR_DOM_BAD_URI if the load request 
+     * should be denied.
+     *
+     * @param from the URI causing the load
+     * @param uri the URI that is being loaded
+     * @param flags the permission set, see above
+     *
+     * @deprecated Use checkLoadURIWithPrincipal instead of this function.
+     */
+  /* void checkLoadURI (in nsIURI from, in nsIURI uri, in unsigned long flags); */
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURI(nsIURI *from, nsIURI *uri, PRUint32 flags) = 0;
+
+  /**
+     * Similar to checkLoadURIWithPrincipal but there are two differences:
+     *
+     * 1) The URI is a string, not a URI object.
+     * 2) This function assumes that the URI may still be subject to fixup (and
+     * hence will check whether fixed-up versions of the URI are allowed to
+     * load as well); if any of the versions of this URI is not allowed, this
+     * function will return error code NS_ERROR_DOM_BAD_URI.
+     */
+  /* void checkLoadURIStrWithPrincipal (in nsIPrincipal aPrincipal, in AUTF8String uri, in unsigned long flags); */
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStrWithPrincipal(nsIPrincipal *aPrincipal, const nsACString & uri, PRUint32 flags) = 0;
+
+  /**
+     * Same as CheckLoadURI but takes string arguments for ease of use
+     * by scripts
+     *
+     * @deprecated Use checkLoadURIStrWithPrincipal instead of this function.
+     */
+  /* void checkLoadURIStr (in AUTF8String from, in AUTF8String uri, in unsigned long flags); */
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStr(const nsACString & from, const nsACString & uri, PRUint32 flags) = 0;
+
+  /**
+     * Check that the function 'funObj' is allowed to run on 'targetObj'
+     *
+     * Will return error code NS_ERROR_DOM_SECURITY_ERR if the function
+     * should not run
+     *
+     * @param cx The current active JavaScript context.
+     * @param funObj The function trying to run..
+     * @param targetObj The object the function will run on.
+     */
+  /* [noscript] void checkFunctionAccess (in JSContextPtr cx, in voidPtr funObj, in voidPtr targetObj); */
+  NS_IMETHOD CheckFunctionAccess(JSContext * cx, void * funObj, void * targetObj) = 0;
+
+  /**
+     * Return true if content from the given principal is allowed to
+     * execute scripts.
+     */
+  /* [noscript] boolean canExecuteScripts (in JSContextPtr cx, in nsIPrincipal principal); */
+  NS_IMETHOD CanExecuteScripts(JSContext * cx, nsIPrincipal *principal, PRBool *_retval) = 0;
+
+  /**
+     * Return the principal of the innermost frame of the currently 
+     * executing script. Will return null if there is no script 
+     * currently executing.
+     */
+  /* [noscript] nsIPrincipal getSubjectPrincipal (); */
+  NS_IMETHOD GetSubjectPrincipal(nsIPrincipal **_retval) = 0;
+
+  /**
+     * Return the all-powerful system principal.
+     */
+  /* [noscript] nsIPrincipal getSystemPrincipal (); */
+  NS_IMETHOD GetSystemPrincipal(nsIPrincipal **_retval) = 0;
+
+  /**
+     * Return a principal with the specified certificate fingerprint, subject
+     * name (the full name or concatenated set of names of the entity
+     * represented by the certificate), pretty name, certificate, and
+     * codebase URI.  The certificate fingerprint and subject name MUST be
+     * nonempty; otherwise an error will be thrown.  Similarly, aCert must
+     * not be null.
+     */
+  /* [noscript] nsIPrincipal getCertificatePrincipal (in AUTF8String aCertFingerprint, in AUTF8String aSubjectName, in AUTF8String aPrettyName, in nsISupports aCert, in nsIURI aURI); */
+  NS_IMETHOD GetCertificatePrincipal(const nsACString & aCertFingerprint, const nsACString & aSubjectName, const nsACString & aPrettyName, nsISupports *aCert, nsIURI *aURI, nsIPrincipal **_retval) = 0;
+
+  /**
+     * Return a principal that has the same origin as aURI.
+     */
+  /* nsIPrincipal getCodebasePrincipal (in nsIURI aURI); */
+  NS_SCRIPTABLE NS_IMETHOD GetCodebasePrincipal(nsIURI *aURI, nsIPrincipal **_retval) = 0;
+
+  /**
+     * Request that 'capability' can be enabled by scripts or applets
+     * running with 'principal'. Will prompt user if
+     * necessary. Returns nsIPrincipal::ENABLE_GRANTED or
+     * nsIPrincipal::ENABLE_DENIED based on user's choice.
+     */
+  /* [noscript] short requestCapability (in nsIPrincipal principal, in string capability); */
+  NS_IMETHOD RequestCapability(nsIPrincipal *principal, const char *capability, PRInt16 *_retval) = 0;
+
+  /**
+     * Return true if the currently executing script has 'capability' enabled.
+     */
+  /* boolean isCapabilityEnabled (in string capability); */
+  NS_SCRIPTABLE NS_IMETHOD IsCapabilityEnabled(const char *capability, PRBool *_retval) = 0;
+
+  /**
+     * Enable 'capability' in the innermost frame of the currently executing
+     * script.
+     */
+  /* void enableCapability (in string capability); */
+  NS_SCRIPTABLE NS_IMETHOD EnableCapability(const char *capability) = 0;
+
+  /**
+     * Remove 'capability' from the innermost frame of the currently
+     * executing script. Any setting of 'capability' from enclosing
+     * frames thus comes into effect.
+     */
+  /* void revertCapability (in string capability); */
+  NS_SCRIPTABLE NS_IMETHOD RevertCapability(const char *capability) = 0;
+
+  /**
+     * Disable 'capability' in the innermost frame of the currently executing
+     * script.
+     */
+  /* void disableCapability (in string capability); */
+  NS_SCRIPTABLE NS_IMETHOD DisableCapability(const char *capability) = 0;
+
+  /**
+     * Allow 'certificateID' to enable 'capability.' Can only be performed
+     * by code signed by the system certificate.
+     */
+  /* void setCanEnableCapability (in AUTF8String certificateFingerprint, in string capability, in short canEnable); */
+  NS_SCRIPTABLE NS_IMETHOD SetCanEnableCapability(const nsACString & certificateFingerprint, const char *capability, PRInt16 canEnable) = 0;
+
+  /**
+     * Return the principal of the specified object in the specified context.
+     */
+  /* [noscript] nsIPrincipal getObjectPrincipal (in JSContextPtr cx, in JSObjectPtr obj); */
+  NS_IMETHOD GetObjectPrincipal(JSContext * cx, JSObject * obj, nsIPrincipal **_retval) = 0;
+
+  /**
+     * Returns true if the principal of the currently running script is the
+     * system principal, false otherwise.
+     */
+  /* [noscript] boolean subjectPrincipalIsSystem (); */
+  NS_IMETHOD SubjectPrincipalIsSystem(PRBool *_retval) = 0;
+
+  /**
+     * Returns OK if aJSContext and target have the same "origin"
+     * (scheme, host, and port).
+     */
+  /* [noscript] void checkSameOrigin (in JSContextPtr aJSContext, in nsIURI aTargetURI); */
+  NS_IMETHOD CheckSameOrigin(JSContext * aJSContext, nsIURI *aTargetURI) = 0;
+
+  /**
+     * Returns OK if aSourceURI and target have the same "origin"
+     * (scheme, host, and port).
+     * ReportError flag suppresses error reports for functions that
+     * don't need reporting.
+     */
+  /* void checkSameOriginURI (in nsIURI aSourceURI, in nsIURI aTargetURI, in boolean reportError); */
+  NS_SCRIPTABLE NS_IMETHOD CheckSameOriginURI(nsIURI *aSourceURI, nsIURI *aTargetURI, PRBool reportError) = 0;
+
+  /**
+     * Returns the principal of the global object of the given context, or null
+     * if no global or no principal.
+     */
+  /* [noscript] nsIPrincipal getPrincipalFromContext (in JSContextPtr cx); */
+  NS_IMETHOD GetPrincipalFromContext(JSContext * cx, nsIPrincipal **_retval) = 0;
+
+  /**
+     * Get the principal for the given channel.  This will typically be the
+     * channel owner if there is one, and the codebase principal for the
+     * channel's URI otherwise.  aChannel must not be null.
+     */
+  /* nsIPrincipal getChannelPrincipal (in nsIChannel aChannel); */
+  NS_SCRIPTABLE NS_IMETHOD GetChannelPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval) = 0;
+
+  /**
+     * Check whether a given principal is a system principal.  This allows us
+     * to avoid handing back the system principal to script while allowing
+     * script to check whether a given principal is system.
+     */
+  /* boolean isSystemPrincipal (in nsIPrincipal aPrincipal); */
+  NS_SCRIPTABLE NS_IMETHOD IsSystemPrincipal(nsIPrincipal *aPrincipal, PRBool *_retval) = 0;
+
+  /**
+     * Same as getSubjectPrincipal(), only faster. cx must *never* be
+     * passed null, and it must be the context on the top of the
+     * context stack. Does *not* reference count the returned
+     * principal.
+     */
+  /* [noscript, notxpcom] nsIPrincipal getCxSubjectPrincipal (in JSContextPtr cx); */
+  NS_IMETHOD_(nsIPrincipal *) GetCxSubjectPrincipal(JSContext * cx) = 0;
+
+};
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_NSISCRIPTSECURITYMANAGERNEWEST \
+  NS_IMETHOD CheckPropertyAccess(JSContext * aJSContext, JSObject * aJSObject, const char *aClassName, jsval aProperty, PRUint32 aAction); \
+  NS_IMETHOD CheckLoadURIFromScript(JSContext * cx, nsIURI *uri); \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIWithPrincipal(nsIPrincipal *aPrincipal, nsIURI *uri, PRUint32 flags); \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURI(nsIURI *from, nsIURI *uri, PRUint32 flags); \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStrWithPrincipal(nsIPrincipal *aPrincipal, const nsACString & uri, PRUint32 flags); \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStr(const nsACString & from, const nsACString & uri, PRUint32 flags); \
+  NS_IMETHOD CheckFunctionAccess(JSContext * cx, void * funObj, void * targetObj); \
+  NS_IMETHOD CanExecuteScripts(JSContext * cx, nsIPrincipal *principal, PRBool *_retval); \
+  NS_IMETHOD GetSubjectPrincipal(nsIPrincipal **_retval); \
+  NS_IMETHOD GetSystemPrincipal(nsIPrincipal **_retval); \
+  NS_IMETHOD GetCertificatePrincipal(const nsACString & aCertFingerprint, const nsACString & aSubjectName, const nsACString & aPrettyName, nsISupports *aCert, nsIURI *aURI, nsIPrincipal **_retval); \
+  NS_SCRIPTABLE NS_IMETHOD GetCodebasePrincipal(nsIURI *aURI, nsIPrincipal **_retval); \
+  NS_IMETHOD RequestCapability(nsIPrincipal *principal, const char *capability, PRInt16 *_retval); \
+  NS_SCRIPTABLE NS_IMETHOD IsCapabilityEnabled(const char *capability, PRBool *_retval); \
+  NS_SCRIPTABLE NS_IMETHOD EnableCapability(const char *capability); \
+  NS_SCRIPTABLE NS_IMETHOD RevertCapability(const char *capability); \
+  NS_SCRIPTABLE NS_IMETHOD DisableCapability(const char *capability); \
+  NS_SCRIPTABLE NS_IMETHOD SetCanEnableCapability(const nsACString & certificateFingerprint, const char *capability, PRInt16 canEnable); \
+  NS_IMETHOD GetObjectPrincipal(JSContext * cx, JSObject * obj, nsIPrincipal **_retval); \
+  NS_IMETHOD SubjectPrincipalIsSystem(PRBool *_retval); \
+  NS_IMETHOD CheckSameOrigin(JSContext * aJSContext, nsIURI *aTargetURI); \
+  NS_SCRIPTABLE NS_IMETHOD CheckSameOriginURI(nsIURI *aSourceURI, nsIURI *aTargetURI, PRBool reportError); \
+  NS_IMETHOD GetPrincipalFromContext(JSContext * cx, nsIPrincipal **_retval); \
+  NS_SCRIPTABLE NS_IMETHOD GetChannelPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval); \
+  NS_SCRIPTABLE NS_IMETHOD IsSystemPrincipal(nsIPrincipal *aPrincipal, PRBool *_retval); \
+  NS_IMETHOD_(nsIPrincipal *) GetCxSubjectPrincipal(JSContext * cx); 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_NSISCRIPTSECURITYMANAGERNEWEST(_to) \
+  NS_IMETHOD CheckPropertyAccess(JSContext * aJSContext, JSObject * aJSObject, const char *aClassName, jsval aProperty, PRUint32 aAction) { return _to CheckPropertyAccess(aJSContext, aJSObject, aClassName, aProperty, aAction); } \
+  NS_IMETHOD CheckLoadURIFromScript(JSContext * cx, nsIURI *uri) { return _to CheckLoadURIFromScript(cx, uri); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIWithPrincipal(nsIPrincipal *aPrincipal, nsIURI *uri, PRUint32 flags) { return _to CheckLoadURIWithPrincipal(aPrincipal, uri, flags); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURI(nsIURI *from, nsIURI *uri, PRUint32 flags) { return _to CheckLoadURI(from, uri, flags); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStrWithPrincipal(nsIPrincipal *aPrincipal, const nsACString & uri, PRUint32 flags) { return _to CheckLoadURIStrWithPrincipal(aPrincipal, uri, flags); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStr(const nsACString & from, const nsACString & uri, PRUint32 flags) { return _to CheckLoadURIStr(from, uri, flags); } \
+  NS_IMETHOD CheckFunctionAccess(JSContext * cx, void * funObj, void * targetObj) { return _to CheckFunctionAccess(cx, funObj, targetObj); } \
+  NS_IMETHOD CanExecuteScripts(JSContext * cx, nsIPrincipal *principal, PRBool *_retval) { return _to CanExecuteScripts(cx, principal, _retval); } \
+  NS_IMETHOD GetSubjectPrincipal(nsIPrincipal **_retval) { return _to GetSubjectPrincipal(_retval); } \
+  NS_IMETHOD GetSystemPrincipal(nsIPrincipal **_retval) { return _to GetSystemPrincipal(_retval); } \
+  NS_IMETHOD GetCertificatePrincipal(const nsACString & aCertFingerprint, const nsACString & aSubjectName, const nsACString & aPrettyName, nsISupports *aCert, nsIURI *aURI, nsIPrincipal **_retval) { return _to GetCertificatePrincipal(aCertFingerprint, aSubjectName, aPrettyName, aCert, aURI, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD GetCodebasePrincipal(nsIURI *aURI, nsIPrincipal **_retval) { return _to GetCodebasePrincipal(aURI, _retval); } \
+  NS_IMETHOD RequestCapability(nsIPrincipal *principal, const char *capability, PRInt16 *_retval) { return _to RequestCapability(principal, capability, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD IsCapabilityEnabled(const char *capability, PRBool *_retval) { return _to IsCapabilityEnabled(capability, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD EnableCapability(const char *capability) { return _to EnableCapability(capability); } \
+  NS_SCRIPTABLE NS_IMETHOD RevertCapability(const char *capability) { return _to RevertCapability(capability); } \
+  NS_SCRIPTABLE NS_IMETHOD DisableCapability(const char *capability) { return _to DisableCapability(capability); } \
+  NS_SCRIPTABLE NS_IMETHOD SetCanEnableCapability(const nsACString & certificateFingerprint, const char *capability, PRInt16 canEnable) { return _to SetCanEnableCapability(certificateFingerprint, capability, canEnable); } \
+  NS_IMETHOD GetObjectPrincipal(JSContext * cx, JSObject * obj, nsIPrincipal **_retval) { return _to GetObjectPrincipal(cx, obj, _retval); } \
+  NS_IMETHOD SubjectPrincipalIsSystem(PRBool *_retval) { return _to SubjectPrincipalIsSystem(_retval); } \
+  NS_IMETHOD CheckSameOrigin(JSContext * aJSContext, nsIURI *aTargetURI) { return _to CheckSameOrigin(aJSContext, aTargetURI); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckSameOriginURI(nsIURI *aSourceURI, nsIURI *aTargetURI, PRBool reportError) { return _to CheckSameOriginURI(aSourceURI, aTargetURI, reportError); } \
+  NS_IMETHOD GetPrincipalFromContext(JSContext * cx, nsIPrincipal **_retval) { return _to GetPrincipalFromContext(cx, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD GetChannelPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval) { return _to GetChannelPrincipal(aChannel, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD IsSystemPrincipal(nsIPrincipal *aPrincipal, PRBool *_retval) { return _to IsSystemPrincipal(aPrincipal, _retval); } \
+  NS_IMETHOD_(nsIPrincipal *) GetCxSubjectPrincipal(JSContext * cx) { return _to GetCxSubjectPrincipal(cx); } 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_NSISCRIPTSECURITYMANAGERNEWEST(_to) \
+  NS_IMETHOD CheckPropertyAccess(JSContext * aJSContext, JSObject * aJSObject, const char *aClassName, jsval aProperty, PRUint32 aAction) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckPropertyAccess(aJSContext, aJSObject, aClassName, aProperty, aAction); } \
+  NS_IMETHOD CheckLoadURIFromScript(JSContext * cx, nsIURI *uri) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckLoadURIFromScript(cx, uri); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIWithPrincipal(nsIPrincipal *aPrincipal, nsIURI *uri, PRUint32 flags) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckLoadURIWithPrincipal(aPrincipal, uri, flags); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURI(nsIURI *from, nsIURI *uri, PRUint32 flags) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckLoadURI(from, uri, flags); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStrWithPrincipal(nsIPrincipal *aPrincipal, const nsACString & uri, PRUint32 flags) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckLoadURIStrWithPrincipal(aPrincipal, uri, flags); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckLoadURIStr(const nsACString & from, const nsACString & uri, PRUint32 flags) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckLoadURIStr(from, uri, flags); } \
+  NS_IMETHOD CheckFunctionAccess(JSContext * cx, void * funObj, void * targetObj) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckFunctionAccess(cx, funObj, targetObj); } \
+  NS_IMETHOD CanExecuteScripts(JSContext * cx, nsIPrincipal *principal, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CanExecuteScripts(cx, principal, _retval); } \
+  NS_IMETHOD GetSubjectPrincipal(nsIPrincipal **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSubjectPrincipal(_retval); } \
+  NS_IMETHOD GetSystemPrincipal(nsIPrincipal **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSystemPrincipal(_retval); } \
+  NS_IMETHOD GetCertificatePrincipal(const nsACString & aCertFingerprint, const nsACString & aSubjectName, const nsACString & aPrettyName, nsISupports *aCert, nsIURI *aURI, nsIPrincipal **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCertificatePrincipal(aCertFingerprint, aSubjectName, aPrettyName, aCert, aURI, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD GetCodebasePrincipal(nsIURI *aURI, nsIPrincipal **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCodebasePrincipal(aURI, _retval); } \
+  NS_IMETHOD RequestCapability(nsIPrincipal *principal, const char *capability, PRInt16 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->RequestCapability(principal, capability, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD IsCapabilityEnabled(const char *capability, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCapabilityEnabled(capability, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD EnableCapability(const char *capability) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnableCapability(capability); } \
+  NS_SCRIPTABLE NS_IMETHOD RevertCapability(const char *capability) { return !_to ? NS_ERROR_NULL_POINTER : _to->RevertCapability(capability); } \
+  NS_SCRIPTABLE NS_IMETHOD DisableCapability(const char *capability) { return !_to ? NS_ERROR_NULL_POINTER : _to->DisableCapability(capability); } \
+  NS_SCRIPTABLE NS_IMETHOD SetCanEnableCapability(const nsACString & certificateFingerprint, const char *capability, PRInt16 canEnable) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCanEnableCapability(certificateFingerprint, capability, canEnable); } \
+  NS_IMETHOD GetObjectPrincipal(JSContext * cx, JSObject * obj, nsIPrincipal **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetObjectPrincipal(cx, obj, _retval); } \
+  NS_IMETHOD SubjectPrincipalIsSystem(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SubjectPrincipalIsSystem(_retval); } \
+  NS_IMETHOD CheckSameOrigin(JSContext * aJSContext, nsIURI *aTargetURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckSameOrigin(aJSContext, aTargetURI); } \
+  NS_SCRIPTABLE NS_IMETHOD CheckSameOriginURI(nsIURI *aSourceURI, nsIURI *aTargetURI, PRBool reportError) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckSameOriginURI(aSourceURI, aTargetURI, reportError); } \
+  NS_IMETHOD GetPrincipalFromContext(JSContext * cx, nsIPrincipal **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrincipalFromContext(cx, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD GetChannelPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChannelPrincipal(aChannel, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD IsSystemPrincipal(nsIPrincipal *aPrincipal, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsSystemPrincipal(aPrincipal, _retval); } \
+  NS_IMETHOD_(nsIPrincipal *) GetCxSubjectPrincipal(JSContext * cx) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCxSubjectPrincipal(cx); } 
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class nsScriptSecurityManager : public nsIScriptSecurityManager
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_NSISCRIPTSECURITYMANAGER
+
+  nsScriptSecurityManager();
+
+private:
+  ~nsScriptSecurityManager();
+
+protected:
+  /* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(nsScriptSecurityManager, nsIScriptSecurityManager)
+
+nsScriptSecurityManager::nsScriptSecurityManager()
+{
+  /* member initializers and constructor code */
+}
+
+nsScriptSecurityManager::~nsScriptSecurityManager()
+{
+  /* destructor code */
+}
+
+/* [noscript] void checkPropertyAccess (in JSContextPtr aJSContext, in JSObjectPtr aJSObject, in string aClassName, in JSVal aProperty, in PRUint32 aAction); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckPropertyAccess(JSContext * aJSContext, JSObject * aJSObject, const char *aClassName, jsval aProperty, PRUint32 aAction)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] void checkLoadURIFromScript (in JSContextPtr cx, in nsIURI uri); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckLoadURIFromScript(JSContext * cx, nsIURI *uri)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void checkLoadURIWithPrincipal (in nsIPrincipal aPrincipal, in nsIURI uri, in unsigned long flags); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal *aPrincipal, nsIURI *uri, PRUint32 flags)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void checkLoadURI (in nsIURI from, in nsIURI uri, in unsigned long flags); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckLoadURI(nsIURI *from, nsIURI *uri, PRUint32 flags)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void checkLoadURIStrWithPrincipal (in nsIPrincipal aPrincipal, in AUTF8String uri, in unsigned long flags); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckLoadURIStrWithPrincipal(nsIPrincipal *aPrincipal, const nsACString & uri, PRUint32 flags)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void checkLoadURIStr (in AUTF8String from, in AUTF8String uri, in unsigned long flags); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckLoadURIStr(const nsACString & from, const nsACString & uri, PRUint32 flags)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] void checkFunctionAccess (in JSContextPtr cx, in voidPtr funObj, in voidPtr targetObj); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckFunctionAccess(JSContext * cx, void * funObj, void * targetObj)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] boolean canExecuteScripts (in JSContextPtr cx, in nsIPrincipal principal); */
+NS_IMETHODIMP nsScriptSecurityManager::CanExecuteScripts(JSContext * cx, nsIPrincipal *principal, PRBool *_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] nsIPrincipal getSubjectPrincipal (); */
+NS_IMETHODIMP nsScriptSecurityManager::GetSubjectPrincipal(nsIPrincipal **_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] nsIPrincipal getSystemPrincipal (); */
+NS_IMETHODIMP nsScriptSecurityManager::GetSystemPrincipal(nsIPrincipal **_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] nsIPrincipal getCertificatePrincipal (in AUTF8String aCertFingerprint, in AUTF8String aSubjectName, in AUTF8String aPrettyName, in nsISupports aCert, in nsIURI aURI); */
+NS_IMETHODIMP nsScriptSecurityManager::GetCertificatePrincipal(const nsACString & aCertFingerprint, const nsACString & aSubjectName, const nsACString & aPrettyName, nsISupports *aCert, nsIURI *aURI, nsIPrincipal **_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsIPrincipal getCodebasePrincipal (in nsIURI aURI); */
+NS_IMETHODIMP nsScriptSecurityManager::GetCodebasePrincipal(nsIURI *aURI, nsIPrincipal **_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] short requestCapability (in nsIPrincipal principal, in string capability); */
+NS_IMETHODIMP nsScriptSecurityManager::RequestCapability(nsIPrincipal *principal, const char *capability, PRInt16 *_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* boolean isCapabilityEnabled (in string capability); */
+NS_IMETHODIMP nsScriptSecurityManager::IsCapabilityEnabled(const char *capability, PRBool *_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void enableCapability (in string capability); */
+NS_IMETHODIMP nsScriptSecurityManager::EnableCapability(const char *capability)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void revertCapability (in string capability); */
+NS_IMETHODIMP nsScriptSecurityManager::RevertCapability(const char *capability)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void disableCapability (in string capability); */
+NS_IMETHODIMP nsScriptSecurityManager::DisableCapability(const char *capability)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void setCanEnableCapability (in AUTF8String certificateFingerprint, in string capability, in short canEnable); */
+NS_IMETHODIMP nsScriptSecurityManager::SetCanEnableCapability(const nsACString & certificateFingerprint, const char *capability, PRInt16 canEnable)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] nsIPrincipal getObjectPrincipal (in JSContextPtr cx, in JSObjectPtr obj); */
+NS_IMETHODIMP nsScriptSecurityManager::GetObjectPrincipal(JSContext * cx, JSObject * obj, nsIPrincipal **_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] boolean subjectPrincipalIsSystem (); */
+NS_IMETHODIMP nsScriptSecurityManager::SubjectPrincipalIsSystem(PRBool *_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] void checkSameOrigin (in JSContextPtr aJSContext, in nsIURI aTargetURI); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckSameOrigin(JSContext * aJSContext, nsIURI *aTargetURI)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void checkSameOriginURI (in nsIURI aSourceURI, in nsIURI aTargetURI, in boolean reportError); */
+NS_IMETHODIMP nsScriptSecurityManager::CheckSameOriginURI(nsIURI *aSourceURI, nsIURI *aTargetURI, PRBool reportError)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript] nsIPrincipal getPrincipalFromContext (in JSContextPtr cx); */
+NS_IMETHODIMP nsScriptSecurityManager::GetPrincipalFromContext(JSContext * cx, nsIPrincipal **_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* nsIPrincipal getChannelPrincipal (in nsIChannel aChannel); */
+NS_IMETHODIMP nsScriptSecurityManager::GetChannelPrincipal(nsIChannel *aChannel, nsIPrincipal **_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* boolean isSystemPrincipal (in nsIPrincipal aPrincipal); */
+NS_IMETHODIMP nsScriptSecurityManager::IsSystemPrincipal(nsIPrincipal *aPrincipal, PRBool *_retval)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* [noscript, notxpcom] nsIPrincipal getCxSubjectPrincipal (in JSContextPtr cx); */
+NS_IMETHODIMP_(nsIPrincipal *) nsScriptSecurityManager::GetCxSubjectPrincipal(JSContext * cx)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+#define NS_SCRIPTSECURITYMANAGERNEWEST_CONTRACTID "@mozilla.org/scriptsecuritymanager;1"
+#define NS_SCRIPTSECURITYMANAGERNEWEST_CLASSNAME "scriptsecuritymanager"
+
+#endif /* __gen_nsIScriptSecurityManagerNewest_h__ */
