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

Unified Diff: WebCore/platform/network/chromium/BlobRegistryProxy.cpp

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/chromium/BlobRegistryProxy.h ('k') | WebCore/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/network/chromium/BlobRegistryProxy.cpp
===================================================================
--- WebCore/platform/network/chromium/BlobRegistryProxy.cpp (revision 140218)
+++ WebCore/platform/network/chromium/BlobRegistryProxy.cpp (working copy)
@@ -37,6 +37,7 @@
#include "BlobData.h"
#include "KURL.h"
#include "ResourceHandle.h"
+#include "SecurityOrigin.h"
#include <public/Platform.h>
#include <public/WebBlobData.h>
#include <public/WebBlobRegistry.h>
@@ -46,9 +47,13 @@
namespace WebCore {
+// FIXME: ensure webkit::init causes this to be initalized.
+// Alternatively, remove the blobRegistry() accessor from WebKit::Platform and instead
+// define a WebBlobRegistry::setBlobRegistry(WebBlobRegistry*) for embedders to inject
+// and instance pointer into. Injecting these things is frustratingly messy?
BlobRegistry& blobRegistry()
{
- ASSERT(isMainThread());
+ // AtomicallyInitializedStatic(BlobRegistryProxy&, intance = *new BlobRegistryProxy); ??
DEFINE_STATIC_LOCAL(BlobRegistryProxy, instance, ());
return instance;
}
@@ -56,28 +61,48 @@
BlobRegistryProxy::BlobRegistryProxy()
: m_webBlobRegistry(WebKit::Platform::current()->blobRegistry())
{
+ //ASSERT(isMainThread()); // FIXME: restore this assertion or claim this is ok.
}
-void BlobRegistryProxy::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blobData)
+void BlobRegistryProxy::registerBlobData(const String& uuid, PassOwnPtr<BlobData> blobData)
{
if (m_webBlobRegistry) {
WebKit::WebBlobData webBlobData(blobData);
- m_webBlobRegistry->registerBlobURL(url, webBlobData);
+ m_webBlobRegistry->registerBlobData(uuid, webBlobData);
}
}
-void BlobRegistryProxy::registerBlobURL(const KURL& url, const KURL& srcURL)
+void BlobRegistryProxy::addBlobDataRef(const String& uuid)
{
if (m_webBlobRegistry)
- m_webBlobRegistry->registerBlobURL(url, srcURL);
+ m_webBlobRegistry->addBlobDataRef(uuid);
}
-void BlobRegistryProxy::unregisterBlobURL(const KURL& url)
+void BlobRegistryProxy::removeBlobDataRef(const String& uuid)
{
if (m_webBlobRegistry)
- m_webBlobRegistry->unregisterBlobURL(url);
+ m_webBlobRegistry->removeBlobDataRef(uuid);
}
+void BlobRegistryProxy::registerPublicBlobURL(SecurityOrigin* origin, const KURL& url, PassRefPtr<BlobDataHandle> blobDataHandle)
+{
+ BlobRegistry::setCachedUniqueOrigin(url, origin);
+ if (m_webBlobRegistry)
+ m_webBlobRegistry->registerPublicBlobURL(url, blobDataHandle->uuid());
+}
+
+void BlobRegistryProxy::revokePublicBlobURL(const KURL& url)
+{
+ BlobRegistry::clearCachedUniqueOrigin(url);
+ if (m_webBlobRegistry)
+ m_webBlobRegistry->revokePublicBlobURL(url);
+}
+
+PassRefPtr<SecurityOrigin> BlobRegistryProxy::cachedUniqueOrigin(const KURL& url)
+{
+ return BlobRegistry::getCachedUniqueOrigin(url);
+}
+
} // namespace WebCore
#endif
« no previous file with comments | « WebCore/platform/network/chromium/BlobRegistryProxy.h ('k') | WebCore/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698