Skip to content

Commit

Permalink
Bug 898914 (part 1) - Remove JSBool.
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 2d202e0e5005a7f54724b1540481c15cde3ad52e
  • Loading branch information
nnethercote committed Aug 8, 2013
1 parent c6053ed commit d8f824e
Show file tree
Hide file tree
Showing 229 changed files with 3,078 additions and 2,763 deletions.
2 changes: 1 addition & 1 deletion caps/include/nsJSPrincipals.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class nsCString;

struct nsJSPrincipals : nsIPrincipal, JSPrincipals
{
static JSBool Subsume(JSPrincipals *jsprin, JSPrincipals *other);
static bool Subsume(JSPrincipals *jsprin, JSPrincipals *other);
static void Destroy(JSPrincipals *jsprin);

/*
Expand Down
4 changes: 2 additions & 2 deletions caps/include/nsScriptSecurityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ class nsScriptSecurityManager : public nsIScriptSecurityManager,

bool SubjectIsPrivileged();

static JSBool
static bool
CheckObjectAccess(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, JSAccessMode mode,
JS::MutableHandle<JS::Value> vp);

// Decides, based on CSP, whether or not eval() and stuff can be executed.
static JSBool
static bool
ContentSecurityPolicyPermitsJSAction(JSContext *cx);

// Returns null if a principal cannot be found; generally callers
Expand Down
2 changes: 1 addition & 1 deletion caps/src/nsJSPrincipals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// for mozilla::dom::workers::kJSPrincipalsDebugToken
#include "mozilla/dom/workers/Workers.h"

/* static */ JSBool
/* static */ bool
nsJSPrincipals::Subsume(JSPrincipals *jsprin, JSPrincipals *other)
{
bool result;
Expand Down
4 changes: 2 additions & 2 deletions caps/src/nsScriptSecurityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ NS_IMPL_ISUPPORTS4(nsScriptSecurityManager,

///////////////// Security Checks /////////////////

JSBool
bool
nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
{
// Get the security manager
Expand Down Expand Up @@ -483,7 +483,7 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
}


JSBool
bool
nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, JSAccessMode mode,
JS::MutableHandle<JS::Value> vp)
Expand Down
2 changes: 1 addition & 1 deletion content/base/src/nsFrameMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ nsFrameMessageManager::RemoveDelayedFrameScript(const nsAString& aURL)
return NS_OK;
}

static JSBool
static bool
JSONCreator(const jschar* aBuf, uint32_t aLen, void* aData)
{
nsAString* result = static_cast<nsAString*>(aData);
Expand Down
2 changes: 1 addition & 1 deletion content/xbl/src/nsXBLBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ XBLFinalize(JSFreeOp *fop, JSObject *obj)
c->Drop();
}

static JSBool
static bool
XBLEnumerate(JSContext *cx, JS::Handle<JSObject*> obj)
{
nsXBLPrototypeBinding* protoBinding =
Expand Down
18 changes: 9 additions & 9 deletions content/xbl/src/nsXBLDocumentInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class nsXBLDocGlobalObject : public nsIScriptGlobalObject
// nsIScriptObjectPrincipal methods
virtual nsIPrincipal* GetPrincipal();

static JSBool doCheckAccess(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, uint32_t accessType);
static bool doCheckAccess(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, uint32_t accessType);

NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXBLDocGlobalObject,
nsIScriptGlobalObject)
Expand All @@ -90,7 +90,7 @@ class nsXBLDocGlobalObject : public nsIScriptGlobalObject
static JSClass gSharedGlobalClass;
};

JSBool
bool
nsXBLDocGlobalObject::doCheckAccess(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, uint32_t accessType)
{
Expand Down Expand Up @@ -118,23 +118,23 @@ nsXBLDocGlobalObject::doCheckAccess(JSContext *cx, JS::Handle<JSObject*> obj,
return NS_SUCCEEDED(rv);
}

static JSBool
static bool
nsXBLDocGlobalObject_getProperty(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
{
return nsXBLDocGlobalObject::
doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
}

static JSBool
static bool
nsXBLDocGlobalObject_setProperty(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp)
JS::Handle<jsid> id, bool strict, JS::MutableHandle<JS::Value> vp)
{
return nsXBLDocGlobalObject::
doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_SET_PROPERTY);
}

static JSBool
static bool
nsXBLDocGlobalObject_checkAccess(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
JSAccessMode mode, JS::MutableHandle<JS::Value> vp)
{
Expand Down Expand Up @@ -163,10 +163,10 @@ nsXBLDocGlobalObject_finalize(JSFreeOp *fop, JSObject *obj)
NS_RELEASE(nativeThis);
}

static JSBool
static bool
nsXBLDocGlobalObject_resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id)
{
JSBool did_resolve = false;
bool did_resolve = false;
return JS_ResolveStandardClass(cx, obj, id, &did_resolve);
}

Expand Down
2 changes: 1 addition & 1 deletion content/xbl/src/nsXBLProtoImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ nsXBLProtoImpl::UndefineFields(JSContext *cx, JS::Handle<JSObject*> obj) const
nsDependentString name(f->GetName());

const jschar* s = reinterpret_cast<const jschar*>(name.get());
JSBool hasProp;
bool hasProp;
if (::JS_AlreadyHasOwnUCProperty(cx, obj, s, name.Length(), &hasProp) &&
hasProp) {
bool dummy;
Expand Down
4 changes: 2 additions & 2 deletions content/xbl/src/nsXBLProtoImplField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ValueHasISupportsPrivate(const JS::Value &v)
// contents of the callee's reserved slots. If the property was defined,
// *installed will be true, and idp will be set to the property name that was
// defined.
static JSBool
static bool
InstallXBLField(JSContext* cx,
JS::Handle<JSObject*> callee, JS::Handle<JSObject*> thisObj,
JS::MutableHandle<jsid> idp, bool* installed)
Expand Down Expand Up @@ -323,7 +323,7 @@ nsXBLProtoImplField::InstallAccessors(JSContext* aCx,
// Properties/Methods have historically taken precendence over fields. We
// install members first, so just bounce here if the property is already
// defined.
JSBool found = false;
bool found = false;
if (!JS_AlreadyHasOwnPropertyById(aCx, aTargetClassObject, id, &found))
return NS_ERROR_FAILURE;
if (found)
Expand Down
2 changes: 1 addition & 1 deletion content/xbl/src/nsXBLProtoImplMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
rv = nsContentUtils::GetSecurityManager()->CheckFunctionAccess(cx, method,
thisObject);

JSBool ok = true;
bool ok = true;
if (NS_SUCCEEDED(rv)) {
JS::Rooted<JS::Value> retval(cx);
ok = ::JS_CallFunctionValue(cx, thisObject, OBJECT_TO_JSVAL(method),
Expand Down
4 changes: 2 additions & 2 deletions content/xul/document/src/nsXULPrototypeDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ nsXULPDGlobalObject_finalize(JSFreeOp *fop, JSObject *obj)
}


JSBool
bool
nsXULPDGlobalObject_resolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id)
{
JSBool did_resolve = false;
bool did_resolve = false;

return JS_ResolveStandardClass(cx, obj, id, &did_resolve);
}
Expand Down
48 changes: 24 additions & 24 deletions dom/base/nsDOMClassInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ nsDOMClassInfo::PostCreatePrototype(JSContext * cx, JSObject * aProto)
}

// Don't overwrite a property set by content.
JSBool found;
bool found;
if (!::JS_AlreadyHasOwnUCProperty(cx, global, reinterpret_cast<const jschar*>(mData->mNameUTF16),
NS_strlen(mData->mNameUTF16), &found)) {
return NS_ERROR_FAILURE;
Expand Down Expand Up @@ -2346,7 +2346,7 @@ static JSClass sGlobalScopePolluterClass = {


// static
JSBool
bool
nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
{
Expand All @@ -2369,7 +2369,7 @@ nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JS::Handle<JSObject*>
}

// Gets a subframe.
static JSBool
static bool
ChildWindowGetter(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
JS::MutableHandle<JS::Value> vp)
{
Expand Down Expand Up @@ -2406,7 +2406,7 @@ GetDocument(JSObject *obj)
}

// static
JSBool
bool
nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, unsigned flags,
JS::MutableHandle<JSObject*> objp)
Expand Down Expand Up @@ -2452,7 +2452,7 @@ nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle<JSObject*> o
if (!::JS_GetPrototype(cx, obj, &proto)) {
return false;
}
JSBool hasProp;
bool hasProp;

if (!proto || !::JS_HasPropertyById(cx, proto, id, &hasProp) ||
hasProp) {
Expand Down Expand Up @@ -2503,7 +2503,7 @@ nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JS::Handle<JSObject*> o
}

// static
JSBool
bool
nsWindowSH::InvalidateGlobalScopePolluter(JSContext *cx,
JS::Handle<JSObject*> aObj)
{
Expand Down Expand Up @@ -2861,7 +2861,7 @@ class nsDOMConstructor MOZ_FINAL : public nsIDOMDOMConstructor
{
JS::Rooted<JS::Value> thisAsVal(cx, aThisAsVal);
// The 'attrs' argument used to be JSPROP_PERMANENT. See bug 628612.
JSBool ok = JS_WrapValue(cx, thisAsVal.address()) &&
bool ok = JS_WrapValue(cx, thisAsVal.address()) &&
::JS_DefineUCProperty(cx, target,
reinterpret_cast<const jschar *>(mClassName),
NS_strlen(mClassName), thisAsVal, JS_PropertyStub,
Expand Down Expand Up @@ -3763,9 +3763,9 @@ nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
return NS_ERROR_UNEXPECTED;
}

JSBool ok = ::JS_DefinePropertyById(cx, obj, id, prop_val,
JS_PropertyStub, JS_StrictPropertyStub,
JSPROP_ENUMERATE);
bool ok = ::JS_DefinePropertyById(cx, obj, id, prop_val,
JS_PropertyStub, JS_StrictPropertyStub,
JSPROP_ENUMERATE);

*did_resolve = true;

Expand Down Expand Up @@ -3850,8 +3850,8 @@ LocationSetterGuts(JSContext *cx, JSObject *obj, jsval *vp)
}

template<class Interface>
static JSBool
LocationSetter(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,
static bool
LocationSetter(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, bool strict,
JS::MutableHandle<JS::Value> vp)
{
nsresult rv = LocationSetterGuts<Interface>(cx, obj, vp.address());
Expand All @@ -3863,9 +3863,9 @@ LocationSetter(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS
return true;
}

static JSBool
static bool
LocationSetterUnwrapper(JSContext *cx, JS::Handle<JSObject*> obj_, JS::Handle<jsid> id,
JSBool strict, JS::MutableHandle<JS::Value> vp)
bool strict, JS::MutableHandle<JS::Value> vp)
{
JS::RootedObject obj(cx, obj_);

Expand Down Expand Up @@ -3990,8 +3990,8 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
// Don't resolve standard classes on XrayWrappers, only resolve them if we're
// resolving on the real global object.
if (!xpc::WrapperFactory::IsXrayWrapper(obj)) {
JSBool did_resolve = false;
JSBool ok = true;
bool did_resolve = false;
bool ok = true;
JS::Rooted<JS::Value> exn(cx, JSVAL_VOID);

{
Expand Down Expand Up @@ -4068,7 +4068,7 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
v.address(), getter_AddRefs(holder));
NS_ENSURE_SUCCESS(rv, rv);

JSBool ok = JS_WrapValue(cx, v.address()) &&
bool ok = JS_WrapValue(cx, v.address()) &&
JS_DefinePropertyById(cx, obj, id, v, JS_PropertyStub,
LocationSetterUnwrapper,
JSPROP_PERMANENT | JSPROP_ENUMERATE);
Expand Down Expand Up @@ -4517,7 +4517,7 @@ nsGenericArraySH::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
sCurrentlyEnumerating = true;

JS::Rooted<JS::Value> len_val(cx);
JSBool ok = ::JS_GetProperty(cx, obj, "length", &len_val);
bool ok = ::JS_GetProperty(cx, obj, "length", &len_val);

if (ok && JSVAL_IS_INT(len_val)) {
int32_t length = JSVAL_TO_INT(len_val);
Expand Down Expand Up @@ -4613,7 +4613,7 @@ JSClass sHTMLDocumentAllClass = {


// static
JSBool
bool
nsHTMLDocumentSH::GetDocumentAllNodeList(JSContext *cx,
JS::Handle<JSObject*> obj,
nsDocument *domdoc,
Expand Down Expand Up @@ -4679,7 +4679,7 @@ nsHTMLDocumentSH::GetDocumentAllNodeList(JSContext *cx,
return *nodeList != nullptr;
}

JSBool
bool
nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JS::Handle<JSObject*> obj_,
JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp)
{
Expand Down Expand Up @@ -4776,7 +4776,7 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JS::Handle<JSObject*> ob
return true;
}

JSBool
bool
nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JS::Handle<JSObject*> obj,
JS::Handle<jsid> id, unsigned flags,
JS::MutableHandle<JSObject*> objp)
Expand Down Expand Up @@ -4806,7 +4806,7 @@ nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JS::Handle<JSObject*> obj
}
}

JSBool ok = true;
bool ok = true;

if (v.get() != JSVAL_VOID) {
ok = ::JS_DefinePropertyById(cx, obj, id, v, nullptr, nullptr, 0);
Expand Down Expand Up @@ -5052,7 +5052,7 @@ nsStorage2SH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
if (!::JS_GetPrototype(cx, realObj, &proto)) {
return NS_ERROR_FAILURE;
}
JSBool hasProp;
bool hasProp;

if (proto &&
(::JS_HasPropertyById(cx, proto, id, &hasProp) &&
Expand Down Expand Up @@ -5298,7 +5298,7 @@ nsDOMConstructorSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx
// looked-for constant. Note that we don't have to worry about infinitely
// recurring back here because the Xray wrapper's holder object doesn't call
// NewResolve hooks.
JSBool found;
bool found;
if (!JS_HasPropertyById(cx, nativePropsObj, id, &found)) {
*_retval = false;
return NS_OK;
Expand Down
Loading

0 comments on commit d8f824e

Please sign in to comment.