Bug 464174. r=sicking, sr=sicking, a=beltzner
authorBlake Kaplan <mrbkap@gmail.com>
Fri, 28 Nov 2008 18:16:17 -0800
changeset 22121 4cfa752afa85bd81a29a5ef0826661bc81ecee5a
parent 22120 a2c5f14c8d3339eb5d236f60d5a21b4e4aa0f4fb
child 22122 60ba92ead6d390821b3901c4c048beb957997a89
push id3806
push usersdwilsh@shawnwilsher.com
push dateSat, 29 Nov 2008 02:20:30 +0000
treeherdermozilla-central@4cfa752afa85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking, sicking, beltzner
bugs464174
milestone1.9.1b3pre
Bug 464174. r=sicking, sr=sicking, a=beltzner
content/xbl/src/nsXBLBinding.cpp
content/xbl/src/nsXBLProtoImplField.cpp
content/xbl/src/nsXBLProtoImplField.h
--- a/content/xbl/src/nsXBLBinding.cpp
+++ b/content/xbl/src/nsXBLBinding.cpp
@@ -201,16 +201,17 @@ XBLResolve(JSContext *cx, JSObject *obj,
   if (!context) {
     return JS_TRUE;
   }
 
 
   // Now we either resolve or fail
   PRBool didInstall;
   nsresult rv = field->InstallField(context, origObj,
+                                    content->NodePrincipal(),
                                     protoBinding->DocURI(),
                                     &didInstall);
   if (NS_FAILED(rv)) {
     if (!::JS_IsExceptionPending(cx)) {
       nsDOMClassInfo::ThrowJSException(cx, rv);
     }
 
     return JS_FALSE;
--- a/content/xbl/src/nsXBLProtoImplField.cpp
+++ b/content/xbl/src/nsXBLProtoImplField.cpp
@@ -89,16 +89,17 @@ nsXBLProtoImplField::AppendFieldText(con
     mFieldText = ToNewUnicode(aText);
     mFieldTextLength = aText.Length();
   }
 }
 
 nsresult
 nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
                                   JSObject* aBoundNode,
+                                  nsIPrincipal* aPrincipal,
                                   nsIURI* aBindingDocURI,
                                   PRBool* aDidInstall) const
 {
   NS_PRECONDITION(aBoundNode,
                   "uh-oh, bound node should NOT be null or bad things will "
                   "happen");
 
   *aDidInstall = PR_FALSE;
@@ -126,17 +127,17 @@ nsXBLProtoImplField::InstallField(nsIScr
   // compile the literal string
   // XXX Could we produce a better principal here?  Should be able
   // to, really!
   PRBool undefined;
   nsCOMPtr<nsIScriptContext> context = aContext;
   rv = context->EvaluateStringWithValue(nsDependentString(mFieldText,
                                                           mFieldTextLength), 
                                         aBoundNode,
-                                        nsnull, uriSpec.get(),
+                                        aPrincipal, uriSpec.get(),
                                         mLineNumber, JSVERSION_LATEST,
                                         (void*) &result, &undefined);
   if (NS_FAILED(rv))
     return rv;
 
   // If EvaluateStringWithValue() threw an exception, just report it now.
   // Failure to evaluate a field should stop neither the get of the field value
   // nor an enumeration attempt.
--- a/content/xbl/src/nsXBLProtoImplField.h
+++ b/content/xbl/src/nsXBLProtoImplField.h
@@ -59,16 +59,17 @@ public:
     mLineNumber = aLineNumber;
   }
   
   nsXBLProtoImplField* GetNext() const { return mNext; }
   void SetNext(nsXBLProtoImplField* aNext) { mNext = aNext; }
 
   nsresult InstallField(nsIScriptContext* aContext,
                         JSObject* aBoundNode,
+                        nsIPrincipal* aPrincipal,
                         nsIURI* aBindingDocURI,
                         PRBool* aDidInstall) const;
 
   const PRUnichar* GetName() const { return mName; }
 
 protected:
   nsXBLProtoImplField* mNext;
   PRUnichar* mName;