Ejemplo n.º 1
0
RefPtr<LegacyWebArchive> LegacyWebArchive::create(Frame& frame)
{
    DocumentLoader* documentLoader = frame.loader().documentLoader();

    if (!documentLoader)
        return nullptr;
        
    Vector<RefPtr<LegacyWebArchive>> subframeArchives;
    
    for (unsigned i = 0; i < frame.tree().childCount(); ++i) {
        if (RefPtr<LegacyWebArchive> childFrameArchive = create(*frame.tree().child(i)))
            subframeArchives.append(WTFMove(childFrameArchive));
    }

    auto subresources = documentLoader->subresources();
    return create(documentLoader->mainResource(), WTFMove(subresources), WTFMove(subframeArchives));
}