Back out bug 665564 (rev 9de9b3a9458c) and bug 666790 (rev 7d3d5b9710ea) due to Mac test orange.

This commit is contained in:
Boris Zbarsky 2011-06-24 00:42:23 -04:00
Родитель 9a6ee7d7db
Коммит a32f6d6c85
11 изменённых файлов: 76 добавлений и 91 удалений

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

@ -995,7 +995,7 @@
// undetermined state and then schedule a proper check at the next
// opportunity
this.setProgress(0, -1);
this._timeout = setTimeout(this.updateProgress.bind(this), 0);
setTimeout(this.updateProgress.bind(this), 0);
]]></constructor>
<destructor><![CDATA[
@ -1022,7 +1022,6 @@
this.notification.options.installs.forEach(function(aInstall) {
aInstall.removeListener(this);
}, this);
clearTimeout(this._timeout);
]]></body>
</method>

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

@ -5378,14 +5378,10 @@ public:
mFlags = WANT_ALL_TRACES;
}
NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refCount,
size_t objSz,
const char *objName)
{
}
NS_IMETHOD_(void) DescribeGCedNode(PRBool isMarked,
size_t objSz,
const char *objName)
NS_IMETHOD_(void) DescribeNode(CCNodeType type,
nsrefcnt refcount,
size_t objsz,
const char* objname)
{
}
NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root)

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

@ -1813,10 +1813,11 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
else {
PR_snprintf(name, sizeof(name), "nsDocument %s", uri.get());
}
cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsDocument), name);
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsDocument), name);
}
else {
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsDocument, tmp->mRefCnt.get())
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsDocument),
"nsDocument");
}
// Always need to traverse script objects, so do that before we check

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

@ -4322,11 +4322,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericElement)
else {
PR_snprintf(name, sizeof(name), "nsGenericElement %s", localName.get());
}
cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsGenericElement),
name);
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsGenericElement),
name);
}
else {
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsGenericElement, tmp->mRefCnt.get())
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsGenericElement),
"nsGenericElement");
}
// Always need to traverse script objects, so do that before we check

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

@ -198,10 +198,11 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsNodeInfo)
PR_snprintf(name, sizeof(name), "nsNodeInfo %s", localName.get());
}
cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsNodeInfo), name);
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsNodeInfo), name);
}
else {
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsNodeInfo, tmp->mRefCnt.get())
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsNodeInfo),
"nsNodeInfo");
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mOwnerManager,

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

@ -142,12 +142,13 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsJSScriptTimeoutHandler)
}
}
}
cb.DescribeRefCountedNode(tmp->mRefCnt.get(),
sizeof(nsJSScriptTimeoutHandler), foo.get());
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
sizeof(nsJSScriptTimeoutHandler), foo.get());
}
else {
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsJSScriptTimeoutHandler,
tmp->mRefCnt.get())
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
sizeof(nsJSScriptTimeoutHandler),
"nsJSScriptTimeoutHandler");
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContext)

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

@ -747,7 +747,7 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb)
}
}
PRBool isMarked;
CCNodeType type;
#ifdef DEBUG_CC
// Note that the conditions under which we specify GCMarked vs.
@ -765,13 +765,14 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb)
// ExplainLiveExpectedGarbage codepath
PLDHashEntryHdr* entry =
PL_DHashTableOperate(&mJSRoots, p, PL_DHASH_LOOKUP);
isMarked = markJSObject || PL_DHASH_ENTRY_IS_BUSY(entry);
type = markJSObject || PL_DHASH_ENTRY_IS_BUSY(entry) ? GCMarked :
GCUnmarked;
}
else
#endif
{
// Normal codepath (matches non-DEBUG_CC codepath).
isMarked = markJSObject || !xpc_IsGrayGCThing(p);
type = !markJSObject && xpc_IsGrayGCThing(p) ? GCUnmarked : GCMarked;
}
if (cb.WantDebugInfo()) {
@ -844,19 +845,19 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb)
char fullname[100];
JS_snprintf(fullname, sizeof(fullname),
"%s (global=%p)", name, global);
cb.DescribeGCedNode(isMarked, sizeof(JSObject), fullname);
cb.DescribeNode(type, 0, sizeof(JSObject), fullname);
} else {
cb.DescribeGCedNode(isMarked, sizeof(JSObject), name);
cb.DescribeNode(type, 0, sizeof(JSObject), name);
}
} else {
cb.DescribeGCedNode(isMarked, sizeof(JSObject), "JS Object");
cb.DescribeNode(type, 0, sizeof(JSObject), "JS Object");
}
// There's no need to trace objects that have already been marked by the JS
// GC. Any JS objects hanging from them will already be marked. Only do this
// if DEBUG_CC is not defined, else we do want to know about all JS objects
// to get better graphs and explanations.
if(!cb.WantAllTraces() && isMarked)
if(!cb.WantAllTraces() && type == GCMarked)
return NS_OK;
TraversalTracer trc(cb);
@ -931,7 +932,8 @@ public:
// edges will ensure that any cycles this context is in won't be
// collected.
unsigned refCount = nsXPConnect::GetXPConnect()->GetOutstandingRequests(cx) + 1;
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(JSContext, refCount)
cb.DescribeNode(RefCounted, refCount, sizeof(JSContext), "JSContext");
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "[global object]");
if (cx->globalObject) {
cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT,

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

@ -67,9 +67,10 @@ NS_CYCLE_COLLECTION_CLASSNAME(nsXPCWrappedJS)::Traverse
tmp->GetClass()->GetInterfaceName());
else
JS_snprintf(name, sizeof(name), "nsXPCWrappedJS");
cb.DescribeRefCountedNode(refcnt, sizeof(nsXPCWrappedJS), name);
cb.DescribeNode(RefCounted, refcnt, sizeof(nsXPCWrappedJS), name);
} else {
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsXPCWrappedJS, refcnt)
cb.DescribeNode(RefCounted, refcnt, sizeof(nsXPCWrappedJS),
"nsXPCWrappedJS");
}
// nsXPCWrappedJS keeps its own refcount artificially at or above 1, see the

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

@ -115,10 +115,11 @@ NS_CYCLE_COLLECTION_CLASSNAME(XPCWrappedNative)::Traverse(void *p,
else
JS_snprintf(name, sizeof(name), "XPCWrappedNative");
cb.DescribeRefCountedNode(tmp->mRefCnt.get(),
sizeof(XPCWrappedNative), name);
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
sizeof(XPCWrappedNative), name);
} else {
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(XPCWrappedNative, tmp->mRefCnt.get())
cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
sizeof(XPCWrappedNative), "XPCWrappedNative");
}
if(tmp->mRefCnt.get() > 1) {

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

@ -1461,30 +1461,8 @@ public:
NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root);
private:
void DescribeNode(PRUint32 refCount,
size_t objSz,
const char *objName)
{
#ifdef DEBUG_CC
mCurrPi->mBytes = objSz;
mCurrPi->mName = PL_strdup(objName);
#endif
if (mListener) {
mListener->NoteObject((PRUint64)mCurrPi->mPointer, objName);
}
mCurrPi->mRefCount = refCount;
#ifdef DEBUG_CC
sCollector->mStats.mVisitedNode++;
#endif
}
NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refCount, size_t objSz,
const char *objName);
NS_IMETHOD_(void) DescribeGCedNode(PRBool isMarked, size_t objSz,
const char *objName);
NS_IMETHOD_(void) DescribeNode(CCNodeType type, nsrefcnt refCount,
size_t objSz, const char *objName);
NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void *child,
nsCycleCollectionParticipant* participant);
NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child);
@ -1616,22 +1594,32 @@ GCGraphBuilder::NoteRoot(PRUint32 langID, void *root,
}
NS_IMETHODIMP_(void)
GCGraphBuilder::DescribeRefCountedNode(nsrefcnt refCount, size_t objSz,
const char *objName)
GCGraphBuilder::DescribeNode(CCNodeType type, nsrefcnt refCount,
size_t objSz, const char *objName)
{
if (refCount == 0)
Fault("zero refcount", mCurrPi);
if (refCount == PR_UINT32_MAX)
Fault("overflowing refcount", mCurrPi);
DescribeNode(refCount, objSz, objName);
}
#ifdef DEBUG_CC
mCurrPi->mBytes = objSz;
mCurrPi->mName = PL_strdup(objName);
#endif
NS_IMETHODIMP_(void)
GCGraphBuilder::DescribeGCedNode(PRBool isMarked, size_t objSz,
const char *objName)
{
PRUint32 refCount = isMarked ? PR_UINT32_MAX : 0;
DescribeNode(refCount, objSz, objName);
if (mListener) {
mListener->NoteObject((PRUint64)mCurrPi->mPointer, objName);
}
if (type == RefCounted) {
if (refCount == 0)
Fault("zero refcount", mCurrPi);
if (refCount == PR_UINT32_MAX)
Fault("overflowing refcount", mCurrPi);
mCurrPi->mRefCount = refCount;
}
else {
mCurrPi->mRefCount = type == GCMarked ? PR_UINT32_MAX : 0;
}
#ifdef DEBUG_CC
sCollector->mStats.mVisitedNode++;
#endif
}
NS_IMETHODIMP_(void)
@ -2291,14 +2279,8 @@ public:
return mSuppressThisNode;
}
NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refCount, size_t objSz,
const char *objName)
{
mSuppressThisNode = (PL_strstr(sSuppressionList, objName) != nsnull);
}
NS_IMETHOD_(void) DescribeGCedNode(PRBool isMarked, size_t objSz,
const char *objName)
NS_IMETHOD_(void) DescribeNode(CCNodeType type, nsrefcnt refCount,
size_t objSz, const char *objName)
{
mSuppressThisNode = (PL_strstr(sSuppressionList, objName) != nsnull);
}

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

@ -81,19 +81,20 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionISupports,
class nsCycleCollectionParticipant;
enum CCNodeType { RefCounted, GCMarked, GCUnmarked };
class NS_NO_VTABLE nsCycleCollectionTraversalCallback
{
public:
// You must call DescribeRefCountedNode() with an accurate
// If type is RefCounted you must call DescribeNode() with an accurate
// refcount, otherwise cycle collection will fail, and probably crash.
// If type is not refcounted then the refcount will be ignored.
// If the callback cares about objsz or objname, it should
// put WANT_DEBUG_INFO in mFlags.
NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refcount,
size_t objsz,
const char *objname) = 0;
NS_IMETHOD_(void) DescribeGCedNode(PRBool ismarked,
size_t objsz,
const char *objname) = 0;
NS_IMETHOD_(void) DescribeNode(CCNodeType type,
nsrefcnt refcount,
size_t objsz,
const char *objname) = 0;
NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root) = 0;
NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void *root,
nsCycleCollectionParticipant* helper) = 0;
@ -111,9 +112,8 @@ public:
enum {
// Values for flags:
// Caller should pass useful objsz and objname to
// DescribeRefCountedNode and DescribeGCedNode and should call
// NoteNextEdgeName.
// Caller should pass useful objsz and objname to DescribeNode
// and should call NoteNextEdgeName.
WANT_DEBUG_INFO = (1<<0),
// Caller should not skip objects that we know will be
@ -307,7 +307,7 @@ public:
///////////////////////////////////////////////////////////////////////////////
#define NS_IMPL_CYCLE_COLLECTION_DESCRIBE(_class, _refcnt) \
cb.DescribeRefCountedNode(_refcnt, sizeof(_class), #_class);
cb.DescribeNode(RefCounted, _refcnt, sizeof(_class), #_class);
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(_class) \
NS_IMETHODIMP \