diff options
Diffstat (limited to 'Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h')
-rw-r--r-- | Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h b/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h index 16c6adb09..40378b0bf 100644 --- a/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h +++ b/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013-2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,17 +23,16 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef NetworkBlobRegistry_h -#define NetworkBlobRegistry_h - -#if ENABLE(BLOB) && ENABLE(NETWORK_PROCESS) +#pragma once #include <WebCore/URLHash.h> +#include <wtf/Function.h> #include <wtf/HashMap.h> #include <wtf/HashSet.h> namespace WebCore { -class BlobData; +class BlobDataFileReference; +class BlobPart; } namespace WebKit { @@ -45,28 +44,26 @@ class NetworkBlobRegistry { WTF_MAKE_NONCOPYABLE(NetworkBlobRegistry); public: NetworkBlobRegistry(); - static NetworkBlobRegistry& shared(); + static NetworkBlobRegistry& singleton(); - void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, std::unique_ptr<WebCore::BlobData>, const Vector<RefPtr<SandboxExtension>>&); + void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, RefPtr<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 registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType); + 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 writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>&)>&& completionHandler); void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*); - const Vector<RefPtr<SandboxExtension>> sandboxExtensions(const WebCore::URL&); + Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(NetworkConnectionToWebProcess&, const WebCore::URL&); private: ~NetworkBlobRegistry(); - typedef HashMap<String, Vector<RefPtr<SandboxExtension>>> SandboxExtensionMap; - SandboxExtensionMap m_sandboxExtensions; - typedef HashMap<NetworkConnectionToWebProcess*, HashSet<WebCore::URL>> BlobForConnectionMap; BlobForConnectionMap m_blobsForConnection; }; } - -#endif // ENABLE(BLOB) && ENABLE(NETWORK_PROCESS) - -#endif // NetworkBlobRegistry_h |