Bug 464174 - Pass a principal in when compiling fields. r+sr=sicking a=dveditz
git-svn-id: svn://10.0.0.236/trunk@255136 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
156cc452d8
commit
4185ee6ae0
@ -206,6 +206,7 @@ XBLResolve(JSContext *cx, JSObject *obj, jsval id, uintN flags,
|
||||
// Now we either resolve or fail
|
||||
PRBool didInstall;
|
||||
nsresult rv = field->InstallField(context, origObj,
|
||||
content->NodePrincipal(),
|
||||
protoBinding->DocURI(),
|
||||
&didInstall);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
||||
@ -94,6 +94,7 @@ nsXBLProtoImplField::AppendFieldText(const nsAString& aText)
|
||||
nsresult
|
||||
nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
|
||||
JSObject* aBoundNode,
|
||||
nsIPrincipal* aPrincipal,
|
||||
nsIURI* aBindingDocURI,
|
||||
PRBool* aDidInstall) const
|
||||
{
|
||||
@ -124,14 +125,12 @@ nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
|
||||
"Shouldn't get here when an exception is pending!");
|
||||
|
||||
// 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))
|
||||
|
||||
@ -64,6 +64,7 @@ public:
|
||||
|
||||
nsresult InstallField(nsIScriptContext* aContext,
|
||||
JSObject* aBoundNode,
|
||||
nsIPrincipal* aPrincipal,
|
||||
nsIURI* aBindingDocURI,
|
||||
PRBool* aDidInstall) const;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user