Chromium Code Reviews| Index: Source/core/fileapi/FileReaderLoader.cpp |
| diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp |
| index c6d340330c3ac48c5dd14152e37d2f54b3968995..0e6f2a7694f656134eac5c29da024de4a460843f 100644 |
| --- a/Source/core/fileapi/FileReaderLoader.cpp |
| +++ b/Source/core/fileapi/FileReaderLoader.cpp |
| @@ -37,6 +37,7 @@ |
| #include "core/fileapi/BlobRegistry.h" |
| #include "core/fileapi/BlobURL.h" |
| #include "core/fileapi/FileReaderLoaderClient.h" |
| +#include "core/fileapi/Stream.h" |
| #include "core/loader/TextResourceDecoder.h" |
| #include "core/loader/ThreadableLoader.h" |
| #include "core/platform/network/ResourceRequest.h" |
| @@ -76,7 +77,7 @@ FileReaderLoader::~FileReaderLoader() |
| BlobRegistry::unregisterBlobURL(m_urlForReading); |
| } |
| -void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blob* blob) |
| +void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url) |
| { |
| // The blob is read by routing through the request handling layer given a temporary public url. |
| m_urlForReading = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin()); |
| @@ -84,7 +85,7 @@ void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blo |
| failed(FileError::SECURITY_ERR); |
| return; |
| } |
| - BlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blob->url()); |
| + BlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url); |
| // Construct and load the request. |
| ResourceRequest request(m_urlForReading); |
| @@ -107,6 +108,16 @@ void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blo |
| ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options); |
| } |
| +void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blob* blob) |
| +{ |
| + startForURL(scriptExecutionContext, blob->url()); |
| +} |
| + |
| +void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Stream* stream) |
|
tkent
2013/07/12 09:03:49
nit: We assume |steram| is non-0. So we had bette
tyoshino (SeeGerritForStatus)
2013/07/12 11:15:17
Done
|
| +{ |
| + startForURL(scriptExecutionContext, stream->url()); |
| +} |
| + |
| void FileReaderLoader::cancel() |
| { |
| m_errorCode = FileError::ABORT_ERR; |