Пример #1
0
bool JSBarPropOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSBarProp* jsBarProp = jsCast<JSBarProp*>(handle.get().asCell());
    if (!isObservable(jsBarProp))
        return false;
    Frame* root = jsBarProp->impl().frame();
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
Пример #2
0
bool JSDOMPluginArrayOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSDOMPluginArray* jsDOMPluginArray = static_cast<JSDOMPluginArray*>(handle.get().asCell());
    if (!isObservable(jsDOMPluginArray))
        return false;
    Frame* root = jsDOMPluginArray->impl()->frame();
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
Пример #3
0
bool JSMessagePortOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSMessagePort* jsMessagePort = static_cast<JSMessagePort*>(handle.get().asCell());
    if (jsMessagePort->impl()->hasPendingActivity())
        return true;
    if (!isObservable(jsMessagePort))
        return false;
    MessagePort* root = jsMessagePort->impl();
    return visitor.containsOpaqueRoot(root);
}
Пример #4
0
bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    MutationObserver* observer = jsCast<JSMutationObserver*>(handle.get().asCell())->impl();
    HashSet<Node*> observedNodes = observer->getObservedNodes();
    for (HashSet<Node*>::iterator it = observedNodes.begin(); it != observedNodes.end(); ++it) {
        if (visitor.containsOpaqueRoot(root(*it)))
            return true;
    }
    return false;
}
Пример #5
0
bool JSStyleSheetListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSStyleSheetList* jsStyleSheetList = static_cast<JSStyleSheetList*>(handle.get().asCell());
    if (!isObservable(jsStyleSheetList))
        return false;
    Document* root = jsStyleSheetList->impl()->document();
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
Пример #6
0
bool JSStyleMediaOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSStyleMedia* jsStyleMedia = static_cast<JSStyleMedia*>(handle.get().asCell());
    if (!isObservable(jsStyleMedia))
        return false;
    Frame* root = jsStyleMedia->impl()->frame();
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
Пример #7
0
bool JSAudioNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSAudioNode* jsAudioNode = jsCast<JSAudioNode*>(handle.get().asCell());
    if (jsAudioNode->impl().isFiringEventListeners())
        return true;
    if (!isObservable(jsAudioNode))
        return false;
    AudioNode* root = &jsAudioNode->impl();
    return visitor.containsOpaqueRoot(root);
}
Пример #8
0
bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void* context, SlotVisitor& visitor)
{
    JSCSSValue* jsCSSValue = jsCast<JSCSSValue*>(handle.slot()->asCell());
    if (!jsCSSValue->hasCustomProperties())
        return false;
    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
    void* root = world->m_cssValueRoots.get(&jsCSSValue->wrapped());
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
Пример #9
0
bool JSNamedNodeMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSNamedNodeMap* jsNamedNodeMap = static_cast<JSNamedNodeMap*>(handle.get().asCell());
    if (!isObservable(jsNamedNodeMap))
        return false;
    Element* element = jsNamedNodeMap->impl()->element();
    if (!element)
        return false;
    void* root = WebCore::root(element);
    return visitor.containsOpaqueRoot(root);
}
Пример #10
0
bool JSAudioTrackOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSAudioTrack* jsAudioTrack = jsCast<JSAudioTrack*>(handle.get().asCell());
    if (!isObservable(jsAudioTrack))
        return false;
    Element* element = jsAudioTrack->impl().element();
    if (!element)
        return false;
    void* root = WebCore::root(element);
    return visitor.containsOpaqueRoot(root);
}
bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char**reason)
{
    for (auto* node : jsCast<JSMutationObserver*>(handle.slot()->asCell())->wrapped().observedNodes()) {
        if (visitor.containsOpaqueRoot(root(node))) {
            if (UNLIKELY(reason))
                *reason = "Reachable from observed nodes";
            return true;
        }
    }
    return false;
}
Пример #12
0
bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSTextTrackCue* jsTextTrackCue = jsCast<JSTextTrackCue*>(handle.slot()->asCell());
    TextTrackCue& textTrackCue = jsTextTrackCue->wrapped();

    // If the cue is firing event listeners, its wrapper is reachable because
    // the wrapper is responsible for marking those event listeners.
    if (textTrackCue.isFiringEventListeners())
        return true;

    // If the cue is not associated with a track, it is not reachable.
    if (!textTrackCue.track())
        return false;

    return visitor.containsOpaqueRoot(root(textTrackCue.track()));
}
Пример #13
0
bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSTextTrackCue* jsTextTrackCue = jsCast<JSTextTrackCue*>(handle.get().asCell());
    TextTrackCue* textTrackCue = static_cast<TextTrackCue*>(jsTextTrackCue->impl());

    // If the cue is firing event listeners, its wrapper is reachable because
    // the wrapper is responsible for marking those event listeners.
    if (textTrackCue->isFiringEventListeners())
        return true;

    // If the cue has no event listeners and has no custom properties, it is not reachable.
    if (!textTrackCue->hasEventListeners() && !jsTextTrackCue->hasCustomProperties())
        return false;

    // If the cue is not associated with a track, it is not reachable.
    if (!textTrackCue->track())
        return false;

    return visitor.containsOpaqueRoot(root(textTrackCue->track()));
}
Пример #14
0
bool JSNodeFilterCondition::WeakOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, SlotVisitor& visitor)
{
    return visitor.containsOpaqueRoot(context);
}
Пример #15
0
bool JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    auto* jsTestGenerateIsReachable = jsCast<JSTestGenerateIsReachable*>(handle.slot()->asCell());
    TestGenerateIsReachable* root = &jsTestGenerateIsReachable->wrapped();
    return visitor.containsOpaqueRoot(root);
}
Пример #16
0
bool JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots(JSC::JSCell& cell, void*, SlotVisitor& visitor)
{
    auto& jsTestGenerateIsReachable = jsCast<JSTestGenerateIsReachable&>(cell);
    TestGenerateIsReachable* root = &jsTestGenerateIsReachable.impl();
    return visitor.containsOpaqueRoot(root);
}