void JSWorker::mark()
{
    DOMObject::mark();

    markIfNotNull(m_impl->onmessage());
    markIfNotNull(m_impl->onerror());

    typedef Worker::EventListenersMap EventListenersMap;
    typedef Worker::ListenerVector ListenerVector;
    EventListenersMap& eventListeners = m_impl->eventListeners();
    for (EventListenersMap::iterator mapIter = eventListeners.begin(); mapIter != eventListeners.end(); ++mapIter) {
        for (ListenerVector::iterator vecIter = mapIter->second.begin(); vecIter != mapIter->second.end(); ++vecIter)
            (*vecIter)->markJSFunction();
    }
}
void JSXMLHttpRequestUpload::mark()
{
    Base::mark();

    if (XMLHttpRequest* xmlHttpRequest = m_impl->associatedXMLHttpRequest()) {
        DOMObject* wrapper = getCachedDOMObjectWrapper(*Heap::heap(this)->globalData(), xmlHttpRequest);
        if (wrapper && !wrapper->marked())
            wrapper->mark();
    }

    markIfNotNull(m_impl->onabort());
    markIfNotNull(m_impl->onerror());
    markIfNotNull(m_impl->onload());
    markIfNotNull(m_impl->onloadstart());
    markIfNotNull(m_impl->onprogress());
    
    typedef XMLHttpRequestUpload::EventListenersMap EventListenersMap;
    typedef XMLHttpRequestUpload::ListenerVector ListenerVector;
    EventListenersMap& eventListeners = m_impl->eventListeners();
    for (EventListenersMap::iterator mapIter = eventListeners.begin(); mapIter != eventListeners.end(); ++mapIter) {
        for (ListenerVector::iterator vecIter = mapIter->second.begin(); vecIter != mapIter->second.end(); ++vecIter)
            (*vecIter)->markJSFunction();
    }
}
void JSDOMApplicationCache::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    markIfNotNull(markStack, m_impl->onchecking());
    markIfNotNull(markStack, m_impl->onerror());
    markIfNotNull(markStack, m_impl->onnoupdate());
    markIfNotNull(markStack, m_impl->ondownloading());
    markIfNotNull(markStack, m_impl->onprogress());
    markIfNotNull(markStack, m_impl->onupdateready());
    markIfNotNull(markStack, m_impl->oncached());
    markIfNotNull(markStack, m_impl->onobsolete());

    typedef DOMApplicationCache::EventListenersMap EventListenersMap;
    typedef DOMApplicationCache::ListenerVector ListenerVector;
    EventListenersMap& eventListeners = m_impl->eventListeners();
    for (EventListenersMap::iterator mapIter = eventListeners.begin(); mapIter != eventListeners.end(); ++mapIter) {
        for (ListenerVector::iterator vecIter = mapIter->second.begin(); vecIter != mapIter->second.end(); ++vecIter)
            (*vecIter)->markJSFunction(markStack);
    }
}
void JSWorker::markChildren(MarkStack& markStack)
{
    Base::markChildren(markStack);

    markIfNotNull(markStack, static_cast<Worker*>(impl())->onmessage());
}