Bug 21642 - Abstract out active object tracking
Summary: Abstract out active object tracking
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 09:57 PDT by Alexey Proskuryakov
Modified: 2008-10-17 01:12 PDT (History)
0 users

See Also:


Attachments
proposed patch (33.98 KB, patch)
2008-10-17 00:18 PDT, Alexey Proskuryakov
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2008-10-16 09:57:42 PDT
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.
Comment 1 Alexey Proskuryakov 2008-10-17 00:18:46 PDT
Created attachment 24454 [details]
proposed patch

MessagePort is a special case, because these need to be tracked for cross-heap GC.
Comment 2 Sam Weinig 2008-10-17 00:53:18 PDT
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.
Comment 3 Alexey Proskuryakov 2008-10-17 01:12:38 PDT
Committed revision 37649.

Discussed suggestions on IRC - sadly, we don't have an idea for a better name.