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

Unified Diff: Source/core/fileapi/FileReaderLoader.cpp

Issue 18991017: Add Stream support to FileReaderLoader. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tkent's comment Created 7 years, 5 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 | « Source/core/fileapi/FileReaderLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fileapi/FileReaderLoader.cpp
diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp
index c6d340330c3ac48c5dd14152e37d2f54b3968995..bbe6380cdc85b211781576da82952cecfb43b14d 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, const Stream& stream)
+{
+ startForURL(scriptExecutionContext, stream.url());
+}
+
void FileReaderLoader::cancel()
{
m_errorCode = FileError::ABORT_ERR;
« no previous file with comments | « Source/core/fileapi/FileReaderLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698