| Index: Source/core/fileapi/FileReaderLoader.cpp
|
| diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp
|
| index 030b24c62b7ab48d8471724031f5bb2702c03215..d18e095033f1aea02d6b78cdf1fa5b9a40b5297a 100644
|
| --- a/Source/core/fileapi/FileReaderLoader.cpp
|
| +++ b/Source/core/fileapi/FileReaderLoader.cpp
|
| @@ -80,11 +80,12 @@ FileReaderLoader::~FileReaderLoader()
|
| if (m_urlForReadingIsStream)
|
| BlobRegistry::unregisterStreamURL(m_urlForReading);
|
| else
|
| - BlobRegistry::unregisterBlobURL(m_urlForReading);
|
| + BlobRegistry::revokePublicBlobURL(m_urlForReading);
|
| }
|
| }
|
|
|
| -void FileReaderLoader::startForURL(ExecutionContext* executionContext, const KURL& url)
|
| +
|
| +void FileReaderLoader::startInternal(ExecutionContext* executionContext, 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(executionContext->securityOrigin());
|
| @@ -93,10 +94,13 @@ void FileReaderLoader::startForURL(ExecutionContext* executionContext, const KUR
|
| return;
|
| }
|
|
|
| - if (m_urlForReadingIsStream)
|
| - BlobRegistry::registerStreamURL(executionContext->securityOrigin(), m_urlForReading, url);
|
| - else
|
| - BlobRegistry::registerBlobURL(executionContext->securityOrigin(), m_urlForReading, url);
|
| + if (blobData) {
|
| + ASSERT(!stream);
|
| + BlobRegistry::registerPublicBlobURL(executionContext->securityOrigin(), m_urlForReading, blobData);
|
| + } else {
|
| + ASSERT(stream);
|
| + BlobRegistry::registerStreamURL(executionContext->securityOrigin(), m_urlForReading, stream->url());
|
| + }
|
|
|
| // Construct and load the request.
|
| ResourceRequest request(m_urlForReading);
|
| @@ -121,10 +125,10 @@ void FileReaderLoader::startForURL(ExecutionContext* executionContext, const KUR
|
| ThreadableLoader::loadResourceSynchronously(executionContext, request, *this, options);
|
| }
|
|
|
| -void FileReaderLoader::start(ExecutionContext* executionContext, const Blob& blob)
|
| +void FileReaderLoader::start(ExecutionContext* executionContext, PassRefPtr<BlobDataHandle> blobData)
|
| {
|
| m_urlForReadingIsStream = false;
|
| - startForURL(executionContext, blob.url());
|
| + startInternal(executionContext, 0, blobData);
|
| }
|
|
|
| void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& stream, unsigned readSize)
|
| @@ -136,7 +140,7 @@ void FileReaderLoader::start(ExecutionContext* executionContext, const Stream& s
|
| }
|
|
|
| m_urlForReadingIsStream = true;
|
| - startForURL(executionContext, stream.url());
|
| + startInternal(executionContext, &stream, 0);
|
| }
|
|
|
| void FileReaderLoader::cancel()
|
|
|