mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 540858 part I: separate the refcount logging of NPObject (which works for both plugin and proxy NPObject) from ctor/dtor logging of ChildNPObject (proxy only), r=bent
This commit is contained in:
parent
73a1d2211e
commit
1fc18fe407
@ -1067,7 +1067,7 @@ _createobject(NPP aNPP,
|
|||||||
if (newObject) {
|
if (newObject) {
|
||||||
newObject->_class = aClass;
|
newObject->_class = aClass;
|
||||||
newObject->referenceCount = 1;
|
newObject->referenceCount = 1;
|
||||||
NS_LOG_ADDREF(newObject, 1, "ChildNPObject", sizeof(NPObject));
|
NS_LOG_ADDREF(newObject, 1, "NPObject", sizeof(NPObject));
|
||||||
}
|
}
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
@ -1078,7 +1078,7 @@ _retainobject(NPObject* aNPObj)
|
|||||||
AssertPluginThread();
|
AssertPluginThread();
|
||||||
|
|
||||||
int32_t refCnt = PR_AtomicIncrement((PRInt32*)&aNPObj->referenceCount);
|
int32_t refCnt = PR_AtomicIncrement((PRInt32*)&aNPObj->referenceCount);
|
||||||
NS_LOG_ADDREF(aNPObj, refCnt, "ChildNPObject", sizeof(NPObject));
|
NS_LOG_ADDREF(aNPObj, refCnt, "NPObject", sizeof(NPObject));
|
||||||
|
|
||||||
return aNPObj;
|
return aNPObj;
|
||||||
}
|
}
|
||||||
@ -1089,7 +1089,7 @@ _releaseobject(NPObject* aNPObj)
|
|||||||
AssertPluginThread();
|
AssertPluginThread();
|
||||||
|
|
||||||
int32_t refCnt = PR_AtomicDecrement((PRInt32*)&aNPObj->referenceCount);
|
int32_t refCnt = PR_AtomicDecrement((PRInt32*)&aNPObj->referenceCount);
|
||||||
NS_LOG_RELEASE(aNPObj, refCnt, "ChildNPObject");
|
NS_LOG_RELEASE(aNPObj, refCnt, "NPObject");
|
||||||
|
|
||||||
if (refCnt == 0) {
|
if (refCnt == 0) {
|
||||||
if (aNPObj->_class && aNPObj->_class->deallocate) {
|
if (aNPObj->_class && aNPObj->_class->deallocate) {
|
||||||
|
@ -535,7 +535,7 @@ PluginScriptableObjectChild::CreateProxyObject()
|
|||||||
// own this actor. Set the reference count to 0 here so that when the object
|
// own this actor. Set the reference count to 0 here so that when the object
|
||||||
// dies we will send the destructor message to the child.
|
// dies we will send the destructor message to the child.
|
||||||
object->referenceCount = 0;
|
object->referenceCount = 0;
|
||||||
NS_LOG_RELEASE(object, 0, "ChildNPObject");
|
NS_LOG_RELEASE(object, 0, "NPObject");
|
||||||
|
|
||||||
object->parent = const_cast<PluginScriptableObjectChild*>(this);
|
object->parent = const_cast<PluginScriptableObjectChild*>(this);
|
||||||
return object;
|
return object;
|
||||||
|
@ -52,7 +52,15 @@ class PluginScriptableObjectChild;
|
|||||||
struct ChildNPObject : NPObject
|
struct ChildNPObject : NPObject
|
||||||
{
|
{
|
||||||
ChildNPObject()
|
ChildNPObject()
|
||||||
: NPObject(), parent(NULL), invalidated(false) { }
|
: NPObject(), parent(NULL), invalidated(false)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(ChildNPObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
~ChildNPObject()
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR(ChildNPObject);
|
||||||
|
}
|
||||||
|
|
||||||
// |parent| is always valid as long as the actor is alive. Once the actor is
|
// |parent| is always valid as long as the actor is alive. Once the actor is
|
||||||
// destroyed this will be set to null.
|
// destroyed this will be set to null.
|
||||||
|
Loading…
Reference in New Issue
Block a user