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

Unified Diff: WebCore/fileapi/FileReaderLoader.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/fileapi/FileReader.cpp ('k') | WebCore/fileapi/ThreadableBlobRegistry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/fileapi/FileReaderLoader.cpp
===================================================================
--- WebCore/fileapi/FileReaderLoader.cpp (revision 140218)
+++ WebCore/fileapi/FileReaderLoader.cpp (working copy)
@@ -36,12 +36,12 @@
#include "Blob.h"
#include "BlobURL.h"
+#include "BlobRegistry.h"
#include "FileReaderLoaderClient.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
#include "ScriptExecutionContext.h"
#include "TextResourceDecoder.h"
-#include "ThreadableBlobRegistry.h"
#include "ThreadableLoader.h"
#include <wtf/ArrayBuffer.h>
#include <wtf/PassRefPtr.h>
@@ -69,18 +69,20 @@
{
terminate();
if (!m_urlForReading.isEmpty())
- ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
+ blobRegistry().revokePublicBlobURL(m_urlForReading);
}
void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blob* blob)
{
+ ASSERT(m_urlForReading.isEmpty()); // Instances can not be reused.
+
// The blob is read by routing through the request handling layer given a temporary public url.
m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
if (m_urlForReading.isEmpty()) {
failed(FileError::SECURITY_ERR);
return;
}
- ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blob->url());
+ blobRegistry().registerPublicBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blob->blobDataHandle());
// Construct and load the request.
ResourceRequest request(m_urlForReading);
« no previous file with comments | « WebCore/fileapi/FileReader.cpp ('k') | WebCore/fileapi/ThreadableBlobRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698