NetworkBlobRegistry.h [plain text]
#ifndef NetworkBlobRegistry_h
#define NetworkBlobRegistry_h
#if ENABLE(NETWORK_PROCESS)
#include <WebCore/URLHash.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
namespace WebCore {
class BlobDataFileReference;
class BlobPart;
}
namespace WebKit {
class NetworkConnectionToWebProcess;
class SandboxExtension;
class NetworkBlobRegistry {
WTF_MAKE_NONCOPYABLE(NetworkBlobRegistry);
public:
NetworkBlobRegistry();
static NetworkBlobRegistry& shared();
void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, PassRefPtr<SandboxExtension>, const String& contentType);
void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);
void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL);
void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
void unregisterBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&);
uint64_t blobSize(NetworkConnectionToWebProcess*, const WebCore::URL&);
void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*);
Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(NetworkConnectionToWebProcess*, const WebCore::URL&);
private:
~NetworkBlobRegistry();
typedef HashMap<NetworkConnectionToWebProcess*, HashSet<WebCore::URL>> BlobForConnectionMap;
BlobForConnectionMap m_blobsForConnection;
};
}
#endif // ENABLE(NETWORK_PROCESS)
#endif // NetworkBlobRegistry_h