Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 630200 Details for
Bug 754202
[patch]
Part 3 - Pull subject principals directly off the compartment. v2
Bug-754202---Pull-subject-principals-directly-off-.patch (text/plain), 1.32 KB, created by
Bobby Holley (:bholley)
(
hide
)
Description:
Part 3 - Pull subject principals directly off the compartment. v2
Filename:
MIME Type:
Creator:
Bobby Holley (:bholley)
Size:
1.32 KB
patch
obsolete
># HG changeset patch ># User Bobby Holley <bobbyholley@gmail.com> > >Bug 754202 - Pull subject principals directly off the compartment. v2 > >diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp >index 15177b5..b579673 100644 >--- a/caps/src/nsScriptSecurityManager.cpp >+++ b/caps/src/nsScriptSecurityManager.cpp >@@ -2359,19 +2359,26 @@ nsScriptSecurityManager::GetPrincipalAndFrame(JSContext *cx, > > return nsnull; > } > > nsIPrincipal* > nsScriptSecurityManager::GetSubjectPrincipal(JSContext *cx, > nsresult* rv) > { >- NS_PRECONDITION(rv, "Null out param"); >- JSStackFrame *fp; >- return GetPrincipalAndFrame(cx, &fp, rv); >+ *rv = NS_OK; >+ JSCompartment *compartment = js::GetContextCompartment(cx); >+ >+ // The context should always be in a compartment, either one it has entered >+ // or the one associated with its global. If there's no compartment, bail. >+ if (!compartment) >+ return nsnull; >+ >+ JSPrincipals *principals = JS_GetCompartmentPrincipals(compartment); >+ return nsJSPrincipals::get(principals); > } > > NS_IMETHODIMP > nsScriptSecurityManager::GetObjectPrincipal(JSContext *aCx, JSObject *aObj, > nsIPrincipal **result) > { > *result = doGetObjectPrincipal(aObj); > if (!*result)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
|
Review
Attachments on
bug 754202
:
625948
|
625950
|
625951
|
630200
|
630201
|
630202
|
630203
|
630204
|
630223
|
632263
|
632264
|
633471
|
637446
|
637487