| Index: Source/core/fileapi/FileReaderLoader.cpp
|
| diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp
|
| index 7448e678d2920e65b154bdfde199132c9723c19b..f81d2b354b069d5c7e0a126a1962cbe02e7ea983 100644
|
| --- a/Source/core/fileapi/FileReaderLoader.cpp
|
| +++ b/Source/core/fileapi/FileReaderLoader.cpp
|
| @@ -78,11 +78,11 @@ FileReaderLoader::~FileReaderLoader()
|
| if (m_urlForReadingIsStream)
|
| BlobRegistry::unregisterStreamURL(m_urlForReading);
|
| else
|
| - BlobRegistry::unregisterBlobURL(m_urlForReading);
|
| + BlobRegistry::revokePublicBlobURL(m_urlForReading);
|
| }
|
| }
|
|
|
| -void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url)
|
| +void FileReaderLoader::startInternal(ScriptExecutionContext* scriptExecutionContext, const Stream* stream, PassRefPtr<BlobDataHandle> blobData)
|
| {
|
| // The blob is read by routing through the request handling layer given a temporary public url.
|
| m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
|
| @@ -91,10 +91,13 @@ void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContex
|
| return;
|
| }
|
|
|
| - if (m_urlForReadingIsStream)
|
| - BlobRegistry::registerStreamURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url);
|
| - else
|
| - BlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url);
|
| + if (blobData) {
|
| + ASSERT(!stream);
|
| + BlobRegistry::registerPublicBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blobData);
|
| + } else {
|
| + ASSERT(stream);
|
| + BlobRegistry::registerStreamURL(scriptExecutionContext->securityOrigin(), m_urlForReading, stream->url());
|
| + }
|
|
|
| // Construct and load the request.
|
| ResourceRequest request(m_urlForReading);
|
| @@ -117,10 +120,10 @@ void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContex
|
| ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options);
|
| }
|
|
|
| -void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, const Blob& blob)
|
| +void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<BlobDataHandle> blobData)
|
| {
|
| m_urlForReadingIsStream = false;
|
| - startForURL(scriptExecutionContext, blob.url());
|
| + startInternal(scriptExecutionContext, 0, blobData);
|
| }
|
|
|
| void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, const Stream& stream, unsigned readSize)
|
| @@ -132,7 +135,7 @@ void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, con
|
| }
|
|
|
| m_urlForReadingIsStream = true;
|
| - startForURL(scriptExecutionContext, stream.url());
|
| + startInternal(scriptExecutionContext, &stream, 0);
|
| }
|
|
|
| void FileReaderLoader::cancel()
|
|
|