Currently there are two kinds of active objects (XMLHttpRequest and MessagePort), but there will be more in the near future. We should abstract out as much code as possible to avoid tracking them all separately in Document.
Created attachment 24454 [details] proposed patch MessagePort is a special case, because these need to be tracked for cross-heap GC.
Comment on attachment 24454 [details] proposed patch + ActiveDOMObject(Document* document, void* upcastPointer); The document parameter name here is not needed. + template<class T> void setPendingActivity(T* This) + { + ASSERT(This == this); We don't usually have variables that start with a capital letter. Perhaps thisObject? +} // namespace WebCore + +#endif // MessagePort_h You meant ActiveDOMObject_h I think. My main concern with this patch is the name ActiveDOMObject, which I don't think conveys the idea intended. I also think it may be cleaner to store the upcaster pointer in the ActiveDOMObject instead of the HashMap. r=me.
Committed revision 37649. Discussed suggestions on IRC - sadly, we don't have an idea for a better name.