[webkit-dev] about hashmap staticDOMObjects

ZHOU Xiao-bo zhxb.ustc at gmail.com
Wed Apr 22 01:15:41 PDT 2009


oh, I got an idea:
Is it because these domobjects doesn't belong to a Document, so they can't
be
stored in

static NodePerDocMap& domNodesPerDocument()
{
    ASSERT(JSLock::lockCount());
    static NodePerDocMap staticDOMNodesPerDocument;
    return staticDOMNodesPerDocument;
}




2009/4/22 ZHOU Xiao-bo <zhxb.ustc at gmail.com>

> hi all:
>      I still don't understand the purpose of the HashMap:
>
> static DOMObjectMap& domObjects()
> {
>     // Don't use malloc here. Calling malloc from a mark function can
> deadlock.
>     static DOMObjectMap staticDOMObjects;
>     return staticDOMObjects;
> }
>
> what kind of DOMObjects should be stored in it? And why?
> I searched the source codes and I found that these classes below will do
> that:
>
> Document, Event, HTMLCollection, XMLHttpRequest, CanvasGradient,
> CanvasPattern, CanvasRenderingContext2D, DOMCoreException,
> DOMImplementation, DOMParser, EventException, History, NamedNodeMap,
> NodeFilter, NodeIterator, NodeList, Range, RangeException, TreeWalker,
> XMLHttpRequestException, XMLSerializer, Clipboard
>
> but what's the reason? Is it because these classes are essentially simple
> and just acting as a tool?
>
> thanks a lot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090422/b2968d2c/attachment.html>


More information about the webkit-dev mailing list