Bug 1013326 - Move script principals APIs to jsfriendapi; r=luke

This commit is contained in:
Jim Chen 2014-06-06 18:39:40 -04:00
parent 1a88865e7b
commit 64ede06933
7 changed files with 21 additions and 18 deletions

View File

@ -291,12 +291,6 @@ JS_GetFunctionScript(JSContext *cx, JS::HandleFunction fun);
extern JS_PUBLIC_API(JSNative)
JS_GetFunctionNative(JSContext *cx, JSFunction *fun);
extern JS_PUBLIC_API(JSPrincipals *)
JS_GetScriptPrincipals(JSScript *script);
extern JS_PUBLIC_API(JSPrincipals *)
JS_GetScriptOriginPrincipals(JSScript *script);
JS_PUBLIC_API(JSFunction *)
JS_GetScriptFunction(JSContext *cx, JSScript *script);

View File

@ -7,6 +7,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "jsfriendapi.h"
#include "js/OldDebugAPI.h"
#include "jsapi-tests/tests.h"

View File

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "jsfriendapi.h"
#include "js/OldDebugAPI.h"
#include "jsapi-tests/tests.h"

View File

@ -247,6 +247,18 @@ JS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals
compartment->isSystem = isSystem;
}
JS_FRIEND_API(JSPrincipals *)
JS_GetScriptPrincipals(JSScript *script)
{
return script->principals();
}
JS_FRIEND_API(JSPrincipals *)
JS_GetScriptOriginPrincipals(JSScript *script)
{
return script->originPrincipals();
}
JS_FRIEND_API(bool)
JS_WrapPropertyDescriptor(JSContext *cx, JS::MutableHandle<js::PropertyDescriptor> desc)
{

View File

@ -122,6 +122,12 @@ JS_GetCompartmentPrincipals(JSCompartment *compartment);
extern JS_FRIEND_API(void)
JS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);
extern JS_FRIEND_API(JSPrincipals *)
JS_GetScriptPrincipals(JSScript *script);
extern JS_FRIEND_API(JSPrincipals *)
JS_GetScriptOriginPrincipals(JSScript *script);
/* Safe to call with input obj == nullptr. Returns non-nullptr iff obj != nullptr. */
extern JS_FRIEND_API(JSObject *)
JS_ObjectToInnerObject(JSContext *cx, JS::HandleObject obj);

View File

@ -512,18 +512,6 @@ JS_GetFunctionNative(JSContext *cx, JSFunction *fun)
return fun->maybeNative();
}
JS_PUBLIC_API(JSPrincipals *)
JS_GetScriptPrincipals(JSScript *script)
{
return script->principals();
}
JS_PUBLIC_API(JSPrincipals *)
JS_GetScriptOriginPrincipals(JSScript *script)
{
return script->originPrincipals();
}
/************************************************************************/
JS_PUBLIC_API(JSFunction *)

View File

@ -7,6 +7,7 @@
#include "nsAutoPtr.h"
#include "jsapi.h"
#include "jsfriendapi.h"
#include "js/OldDebugAPI.h"
#include "nsJSPrincipals.h"