LegacyWebArchive.h [plain text]
#pragma once
#include "Archive.h"
#include <wtf/Function.h>
namespace WebCore {
class Frame;
class Node;
class Range;
class LegacyWebArchive final : public Archive {
public:
WEBCORE_EXPORT static Ref<LegacyWebArchive> create();
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(SharedBuffer&);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(const URL&, SharedBuffer&);
WEBCORE_EXPORT static Ref<LegacyWebArchive> create(Ref<ArchiveResource>&& mainResource, Vector<Ref<ArchiveResource>>&& subresources, Vector<Ref<LegacyWebArchive>>&& subframeArchives);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(Node&, WTF::Function<bool(Frame&)>&& frameFilter = { });
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(Frame&);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> createFromSelection(Frame*);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(Range*);
WEBCORE_EXPORT RetainPtr<CFDataRef> rawDataRepresentation();
private:
LegacyWebArchive() = default;
bool shouldLoadFromArchiveOnly() const final { return false; }
bool shouldOverrideBaseURL() const final { return false; }
bool shouldUseMainResourceEncoding() const final { return true; }
bool shouldUseMainResourceURL() const final { return true; }
enum MainResourceStatus { Subresource, MainResource };
static RefPtr<LegacyWebArchive> create(const String& markupString, Frame&, const Vector<Node*>& nodes, WTF::Function<bool (Frame&)>&& frameFilter);
static RefPtr<ArchiveResource> createResource(CFDictionaryRef);
static ResourceResponse createResourceResponseFromMacArchivedData(CFDataRef);
static ResourceResponse createResourceResponseFromPropertyListData(CFDataRef, CFStringRef responseDataType);
static RetainPtr<CFDataRef> createPropertyListRepresentation(const ResourceResponse&);
static RetainPtr<CFDictionaryRef> createPropertyListRepresentation(Archive&);
static RetainPtr<CFDictionaryRef> createPropertyListRepresentation(ArchiveResource*, MainResourceStatus);
bool extract(CFDictionaryRef);
};
}