Bug 1047778 - Fix some bad implicit constructors in xpcprivate.h; r=bholley

This commit is contained in:
Ehsan Akhgari 2014-08-03 10:40:44 -04:00
parent 357fc78489
commit 734ad0d3f8
2 changed files with 33 additions and 33 deletions

View File

@ -684,7 +684,7 @@ XPCWrappedNative::GatherProtoScriptableCreateInfo(nsIClassInfo* classInfo,
dont_AddRef(static_cast<nsIXPCScriptable*>(classInfoHelper));
uint32_t flags = classInfoHelper->GetScriptableFlags();
sciProto.SetCallback(helper.forget());
sciProto.SetFlags(flags);
sciProto.SetFlags(XPCNativeScriptableFlags(flags));
sciProto.SetInterfacesBitmap(classInfoHelper->GetInterfacesBitmap());
return;
@ -698,7 +698,7 @@ XPCWrappedNative::GatherProtoScriptableCreateInfo(nsIClassInfo* classInfo,
if (helper) {
uint32_t flags = helper->GetScriptableFlags();
sciProto.SetCallback(helper.forget());
sciProto.SetFlags(flags);
sciProto.SetFlags(XPCNativeScriptableFlags(flags));
}
}
}
@ -725,7 +725,7 @@ XPCWrappedNative::GatherScriptableCreateInfo(nsISupports* obj,
if (helper) {
uint32_t flags = helper->GetScriptableFlags();
sciWrapper.SetCallback(helper.forget());
sciWrapper.SetFlags(flags);
sciWrapper.SetFlags(XPCNativeScriptableFlags(flags));
// A whole series of assertions to catch bad uses of scriptable flags on
// the siWrapper...

View File

@ -621,7 +621,7 @@ public:
private:
XPCJSRuntime(); // no implementation
XPCJSRuntime(nsXPConnect* aXPConnect);
explicit XPCJSRuntime(nsXPConnect* aXPConnect);
void ReleaseIncrementally(nsTArray<nsISupports *> &array);
@ -1100,7 +1100,7 @@ public:
DebugDump(int16_t depth);
struct ScopeSizeInfo {
ScopeSizeInfo(mozilla::MallocSizeOf mallocSizeOf)
explicit ScopeSizeInfo(mozilla::MallocSizeOf mallocSizeOf)
: mMallocSizeOf(mallocSizeOf),
mScopeAndMapSize(0),
mProtoAndIfaceCacheSize(0)
@ -1400,9 +1400,9 @@ private:
class XPCNativeSetKey
{
public:
XPCNativeSetKey(XPCNativeSet* BaseSet = nullptr,
XPCNativeInterface* Addition = nullptr,
uint16_t Position = 0)
explicit XPCNativeSetKey(XPCNativeSet* BaseSet = nullptr,
XPCNativeInterface* Addition = nullptr,
uint16_t Position = 0)
: mIsAKey(IS_A_KEY), mPosition(Position), mBaseSet(BaseSet),
mAddition(Addition) {}
~XPCNativeSetKey() {}
@ -1575,7 +1575,7 @@ private:
public:
XPCNativeScriptableFlags(uint32_t flags = 0) : mFlags(flags) {}
explicit XPCNativeScriptableFlags(uint32_t flags = 0) : mFlags(flags) {}
uint32_t GetFlags() const {return mFlags & ~XPC_WN_SJSFLAGS_MARK_FLAG;}
void SetFlags(uint32_t flags) {mFlags = flags;}
@ -1725,8 +1725,8 @@ public:
void AutoTrace(JSTracer *trc) {}
protected:
XPCNativeScriptableInfo(nsIXPCScriptable* scriptable = nullptr,
XPCNativeScriptableShared* shared = nullptr)
explicit XPCNativeScriptableInfo(nsIXPCScriptable* scriptable = nullptr,
XPCNativeScriptableShared* shared = nullptr)
: mCallback(scriptable), mShared(shared)
{MOZ_COUNT_CTOR(XPCNativeScriptableInfo);}
public:
@ -1751,7 +1751,7 @@ class MOZ_STACK_CLASS XPCNativeScriptableCreateInfo
{
public:
XPCNativeScriptableCreateInfo(const XPCNativeScriptableInfo& si)
explicit XPCNativeScriptableCreateInfo(const XPCNativeScriptableInfo& si)
: mCallback(si.GetCallback()), mFlags(si.GetFlags()),
mInterfacesBitmap(si.GetInterfacesBitmap()) {}
@ -2519,7 +2519,7 @@ public:
private:
virtual ~XPCJSObjectHolder();
XPCJSObjectHolder(JSObject* obj);
explicit XPCJSObjectHolder(JSObject* obj);
XPCJSObjectHolder(); // not implemented
JS::Heap<JSObject*> mJSObj;
@ -2771,7 +2771,7 @@ public:
static already_AddRefed<nsJSIID> NewID(nsIInterfaceInfo* aInfo);
nsJSIID(nsIInterfaceInfo* aInfo);
explicit nsJSIID(nsIInterfaceInfo* aInfo);
nsJSIID(); // not implemented
private:
@ -2812,7 +2812,7 @@ private:
// XPCJSContextStack is not actually an xpcom object, but xpcom calls are
// delegated to it as an implementation detail.
struct XPCJSContextInfo {
XPCJSContextInfo(JSContext* aCx) :
explicit XPCJSContextInfo(JSContext* aCx) :
cx(aCx),
savedFrameChain(false)
{}
@ -2837,7 +2837,7 @@ void PopJSContextNoScriptContext();
class XPCJSContextStack
{
public:
XPCJSContextStack(XPCJSRuntime *aRuntime)
explicit XPCJSContextStack(XPCJSRuntime *aRuntime)
: mRuntime(aRuntime)
, mSafeJSContext(nullptr)
, mSafeJSContextGlobal(aRuntime->Runtime(), nullptr)
@ -2897,7 +2897,7 @@ public:
protected:
virtual ~nsXPCComponentsBase();
nsXPCComponentsBase(XPCWrappedNativeScope* aScope);
explicit nsXPCComponentsBase(XPCWrappedNativeScope* aScope);
virtual void ClearMembers();
XPCWrappedNativeScope* mScope;
@ -2919,7 +2919,7 @@ public:
NS_DECL_NSIXPCCOMPONENTS
protected:
nsXPCComponents(XPCWrappedNativeScope* aScope);
explicit nsXPCComponents(XPCWrappedNativeScope* aScope);
virtual ~nsXPCComponents();
virtual void ClearMembers() MOZ_OVERRIDE;
@ -3001,7 +3001,7 @@ public:
* Saves the JSContext as well as initializing our state
* @param cx The JSContext, this can be null, we don't do anything then
*/
AutoScriptEvaluate(JSContext * cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
explicit AutoScriptEvaluate(JSContext * cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: mJSContext(cx), mErrorReporterSet(false), mEvaluated(false) {
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
}
@ -3072,7 +3072,7 @@ private:
class AutoMarkingPtr
{
public:
AutoMarkingPtr(JSContext* cx) {
explicit AutoMarkingPtr(JSContext* cx) {
mRoot = XPCJSRuntime::Get()->GetAutoRootsAdr();
mNext = *mRoot;
*mRoot = this;
@ -3108,7 +3108,7 @@ template<class T>
class TypedAutoMarkingPtr : public AutoMarkingPtr
{
public:
TypedAutoMarkingPtr(JSContext* cx) : AutoMarkingPtr(cx), mPtr(nullptr) {}
explicit TypedAutoMarkingPtr(JSContext* cx) : AutoMarkingPtr(cx), mPtr(nullptr) {}
TypedAutoMarkingPtr(JSContext* cx, T* ptr) : AutoMarkingPtr(cx), mPtr(ptr) {}
T* get() const { return mPtr; }
@ -3147,7 +3147,7 @@ template<class T>
class ArrayAutoMarkingPtr : public AutoMarkingPtr
{
public:
ArrayAutoMarkingPtr(JSContext* cx)
explicit ArrayAutoMarkingPtr(JSContext* cx)
: AutoMarkingPtr(cx), mPtr(nullptr), mCount(0) {}
ArrayAutoMarkingPtr(JSContext* cx, T** ptr, uint32_t count, bool clear)
: AutoMarkingPtr(cx), mPtr(ptr), mCount(count)
@ -3384,8 +3384,8 @@ IsSandbox(JSObject *obj);
class MOZ_STACK_CLASS OptionsBase {
public:
OptionsBase(JSContext *cx = xpc_GetSafeJSContext(),
JSObject *options = nullptr)
explicit OptionsBase(JSContext *cx = xpc_GetSafeJSContext(),
JSObject *options = nullptr)
: mCx(cx)
, mObject(cx, options)
{ }
@ -3407,8 +3407,8 @@ protected:
class MOZ_STACK_CLASS SandboxOptions : public OptionsBase {
public:
SandboxOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject *options = nullptr)
explicit SandboxOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject *options = nullptr)
: OptionsBase(cx, options)
, wantXrays(true)
, wantComponents(true)
@ -3443,8 +3443,8 @@ protected:
class MOZ_STACK_CLASS CreateObjectInOptions : public OptionsBase {
public:
CreateObjectInOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
explicit CreateObjectInOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
: OptionsBase(cx, options)
, defineAs(cx, JSID_VOID)
{ }
@ -3456,8 +3456,8 @@ public:
class MOZ_STACK_CLASS ExportFunctionOptions : public OptionsBase {
public:
ExportFunctionOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
explicit ExportFunctionOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
: OptionsBase(cx, options)
, defineAs(cx, JSID_VOID)
{ }
@ -3471,8 +3471,8 @@ public:
class MOZ_STACK_CLASS StackScopedCloneOptions : public OptionsBase {
public:
StackScopedCloneOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
explicit StackScopedCloneOptions(JSContext *cx = xpc_GetSafeJSContext(),
JSObject* options = nullptr)
: OptionsBase(cx, options)
, wrapReflectors(false)
, cloneFunctions(false)
@ -3579,7 +3579,7 @@ public:
LocationHintAddon
};
CompartmentPrivate(JSCompartment *c)
explicit CompartmentPrivate(JSCompartment *c)
: wantXrays(false)
, writeToGlobalPrototype(false)
, skipWriteToGlobalPrototype(false)