LegacyWebArchive.h [plain text]
#ifndef LegacyWebArchive_h
#define LegacyWebArchive_h
#include "Archive.h"
#include <functional>
namespace WebCore {
class Frame;
class Node;
class Range;
class LegacyWebArchive : 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 RefPtr<LegacyWebArchive> create(RefPtr<ArchiveResource>&& mainResource, Vector<RefPtr<ArchiveResource>>&& subresources, Vector<RefPtr<LegacyWebArchive>>&& subframeArchives);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(Node&, std::function<bool(Frame&)> frameFilter = nullptr);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(Frame&);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> createFromSelection(Frame*);
WEBCORE_EXPORT static RefPtr<LegacyWebArchive> create(Range*);
Type type() const override;
WEBCORE_EXPORT RetainPtr<CFDataRef> rawDataRepresentation();
private:
LegacyWebArchive() { }
enum MainResourceStatus { Subresource, MainResource };
static RefPtr<LegacyWebArchive> create(const String& markupString, Frame&, const Vector<Node*>& nodes, std::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);
};
}
#endif // Archive