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)); }
PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Frame* frame) { ASSERT(frame); DocumentLoader* documentLoader = frame->loader()->documentLoader(); if (!documentLoader) return 0; Vector<PassRefPtr<LegacyWebArchive> > subframeArchives; unsigned children = frame->tree()->childCount(); for (unsigned i = 0; i < children; ++i) { RefPtr<LegacyWebArchive> childFrameArchive = create(frame->tree()->child(i)); if (childFrameArchive) subframeArchives.append(childFrameArchive.release()); } Vector<PassRefPtr<ArchiveResource> > subresources; documentLoader->getSubresources(subresources); return create(documentLoader->mainResource(), subresources, subframeArchives); }