+2013-11-05 Zan Dobersek <zdobersek@igalia.com>
+
+ Main thread tasks in ThreadableBlobRegistry should use std::unique_ptr
+ https://bugs.webkit.org/show_bug.cgi?id=122946
+
+ Reviewed by Darin Adler.
+
+ The new BlobRegistryContext objects don't have to be adopted into OwnPtr and then have OwnPtr's leaked pointer
+ passed into the WTF::callOnMainThread call - the pointer to the new heap-allocated object is passed in directly,
+ with the object ending up being managed by std::unique_ptr in the designated main thread task.
+
+ * fileapi/ThreadableBlobRegistry.cpp:
+ (WebCore::registerBlobURLTask):
+ (WebCore::ThreadableBlobRegistry::registerBlobURL):
+ (WebCore::registerBlobURLFromTask):
+ (WebCore::unregisterBlobURLTask):
+ (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
+
2013-11-05 Gyuyoung Kim <gyuyoung.kim@samsung.com>
[CSS] Enable css-image-orientation on EFL and GTK ports.
*/
#include "config.h"
-
#include "ThreadableBlobRegistry.h"
#include "BlobData.h"
static void registerBlobURLTask(void* context)
{
- OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context));
+ std::unique_ptr<BlobRegistryContext> blobRegistryContext(static_cast<BlobRegistryContext*>(context));
blobRegistry().registerBlobURL(blobRegistryContext->url, std::move(blobRegistryContext->blobData));
}
{
if (isMainThread())
blobRegistry().registerBlobURL(url, std::move(blobData));
- else {
- OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url, std::move(blobData)));
- callOnMainThread(®isterBlobURLTask, context.leakPtr());
- }
+ else
+ callOnMainThread(®isterBlobURLTask, new BlobRegistryContext(url, std::move(blobData)));
}
static void registerBlobURLFromTask(void* context)
{
- OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context));
+ std::unique_ptr<BlobRegistryContext> blobRegistryContext(static_cast<BlobRegistryContext*>(context));
blobRegistry().registerBlobURL(blobRegistryContext->url, blobRegistryContext->srcURL);
}
if (isMainThread())
blobRegistry().registerBlobURL(url, srcURL);
- else {
- OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url, srcURL));
- callOnMainThread(®isterBlobURLFromTask, context.leakPtr());
- }
+ else
+ callOnMainThread(®isterBlobURLFromTask, new BlobRegistryContext(url, srcURL));
}
static void unregisterBlobURLTask(void* context)
{
- OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context));
+ std::unique_ptr<BlobRegistryContext> blobRegistryContext(static_cast<BlobRegistryContext*>(context));
blobRegistry().unregisterBlobURL(blobRegistryContext->url);
}
if (isMainThread())
blobRegistry().unregisterBlobURL(url);
- else {
- OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url));
- callOnMainThread(&unregisterBlobURLTask, context.leakPtr());
- }
+ else
+ callOnMainThread(&unregisterBlobURLTask, new BlobRegistryContext(url));
}
PassRefPtr<SecurityOrigin> ThreadableBlobRegistry::getCachedOrigin(const URL& url)