Bug 797821 - Remove the XPConnect Compartment Set. r=mrbkap

This commit is contained in:
Bobby Holley 2012-10-25 17:01:09 +02:00
Родитель e5281ffe10
Коммит 35f4a1d02f
3 изменённых файлов: 0 добавлений и 23 удалений

Просмотреть файл

@ -240,16 +240,11 @@ CompartmentDestroyedCallback(JSFreeOp *fop, JSCompartment *compartment)
XPCJSRuntime* self = nsXPConnect::GetRuntimeInstance();
if (!self)
return;
XPCCompartmentSet &set = self->GetCompartmentSet();
// Get the current compartment private into an AutoPtr (which will do the
// cleanup for us), and null out the private (which may already be null).
nsAutoPtr<CompartmentPrivate> priv(GetCompartmentPrivate(compartment));
JS_SetCompartmentPrivate(compartment, nullptr);
if (set.has(compartment))
set.remove(compartment);
return;
}
nsresult
@ -2421,8 +2416,6 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
mJSHolders.Init(512);
mCompartmentSet.init();
// Install a JavaScript 'debugger' keyword handler in debug builds only
#ifdef DEBUG
if (!JS_GetGlobalDebugHooks(mJSRuntime)->debuggerHandler)
@ -2466,7 +2459,6 @@ XPCJSRuntime::newXPCJSRuntime(nsXPConnect* aXPConnect)
self->GetNativeScriptableSharedMap() &&
self->GetDyingWrappedNativeProtoMap() &&
self->GetMapLock() &&
self->GetCompartmentSet().initialized() &&
self->mWatchdogThread) {
return self;
}

Просмотреть файл

@ -1092,11 +1092,6 @@ CreateGlobalObject(JSContext *cx, JSClass *clasp, nsIPrincipal *principal)
// The constructor automatically attaches the scope to the compartment private
// of |global|.
(void) new XPCWrappedNativeScope(cx, global);
JSCompartment *compartment = js::GetObjectCompartment(global);
XPCCompartmentSet& set = nsXPConnect::GetRuntimeInstance()->GetCompartmentSet();
if (!set.put(compartment))
return nullptr;
#ifdef DEBUG
// Verify that the right trace hook is called. Note that this doesn't

Просмотреть файл

@ -267,12 +267,6 @@ extern const char XPC_SCRIPT_ERROR_CONTRACTID[];
extern const char XPC_ID_CONTRACTID[];
extern const char XPC_XPCONNECT_CONTRACTID[];
typedef js::HashSet<JSCompartment *,
js::DefaultHasher<JSCompartment *>,
js::SystemAllocPolicy> XPCCompartmentSet;
typedef XPCCompartmentSet::Range XPCCompartmentRange;
/***************************************************************************/
// Useful macros...
@ -718,9 +712,6 @@ public:
XPCWrappedNativeProtoMap* GetDetachedWrappedNativeProtoMap() const
{return mDetachedWrappedNativeProtoMap;}
XPCCompartmentSet& GetCompartmentSet()
{return mCompartmentSet;}
XPCLock* GetMapLock() const {return mMapLock;}
JSBool OnJSContextNew(JSContext* cx);
@ -958,7 +949,6 @@ private:
XPCNativeScriptableSharedMap* mNativeScriptableSharedMap;
XPCWrappedNativeProtoMap* mDyingWrappedNativeProtoMap;
XPCWrappedNativeProtoMap* mDetachedWrappedNativeProtoMap;
XPCCompartmentSet mCompartmentSet;
XPCLock* mMapLock;
PRThread* mThreadRunningGC;
nsTArray<nsXPCWrappedJS*> mWrappedJSToReleaseArray;