Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2889)

Unified Diff: WebCore/platform/network/BlobRegistry.h

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/platform/network/BlobData.cpp ('k') | WebCore/platform/network/BlobRegistry.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/network/BlobRegistry.h
===================================================================
--- WebCore/platform/network/BlobRegistry.h (revision 140218)
+++ WebCore/platform/network/BlobRegistry.h (working copy)
@@ -33,38 +33,42 @@
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
+#include <wtf/text/WTFString.h>
#include <wtf/Vector.h>
namespace WebCore {
class BlobData;
-class BlobRegistry;
+class BlobDataHandle;
class KURL;
class ResourceError;
class ResourceHandle;
class ResourceHandleClient;
class ResourceRequest;
class ResourceResponse;
+class SecurityOrigin;
-// Returns a single instance of BlobRegistry.
-BlobRegistry& blobRegistry();
-
-// BlobRegistry is not thread-safe. It should only be called from main thread.
class BlobRegistry {
public:
- // Registers a blob URL referring to the specified blob data.
- virtual void registerBlobURL(const KURL&, PassOwnPtr<BlobData>) = 0;
-
- // Registers a blob URL referring to the blob data identified by the specified srcURL.
- virtual void registerBlobURL(const KURL&, const KURL& srcURL) = 0;
+ // BlobData registration: may be called on any thread.
+ virtual void registerBlobData(const String& uuid, PassOwnPtr<BlobData>) = 0;
+ virtual void addBlobDataRef(const String& uuid) = 0;
+ virtual void removeBlobDataRef(const String& uuid) = 0;
- virtual void unregisterBlobURL(const KURL&) = 0;
- virtual bool loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data) = 0;
+ // Public Blob URL registration: may be called on any thread.
+ virtual void registerPublicBlobURL(SecurityOrigin*, const KURL&, PassRefPtr<BlobDataHandle>) = 0;
+ virtual void revokePublicBlobURL(const KURL&) = 0;
+ virtual PassRefPtr<SecurityOrigin> cachedUniqueOrigin(const KURL&) = 0;
protected:
- virtual ~BlobRegistry() { }
+ // Helpers for derivatives to maintain a mapping from Blob URL to unique security origins. This mapping is thead-specific.
+ static void setCachedUniqueOrigin(const KURL&, SecurityOrigin*);
+ static void clearCachedUniqueOrigin(const KURL&);
+ static PassRefPtr<SecurityOrigin> getCachedUniqueOrigin(const KURL&);
};
+BlobRegistry& blobRegistry();
+
} // namespace WebCore
#endif // BlobRegistry_h
« no previous file with comments | « WebCore/platform/network/BlobData.cpp ('k') | WebCore/platform/network/BlobRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698