Index: Source/core/fileapi/FileReader.cpp |
diff --git a/Source/core/fileapi/FileReader.cpp b/Source/core/fileapi/FileReader.cpp |
index 7e7232e71e36e49b2ab577248c24ad8470085f5e..91c1c3bc9afda0d45f6eea5300f06ae16a203209 100644 |
--- a/Source/core/fileapi/FileReader.cpp |
+++ b/Source/core/fileapi/FileReader.cpp |
@@ -80,6 +80,9 @@ class FileReader::ThrottlingController FINAL : public NoBaseWillBeGarbageCollect |
public: |
static ThrottlingController* from(ExecutionContext* context) |
{ |
+ if (!context) |
+ return 0; |
+ |
if (context->isDocument()) { |
Document* document = toDocument(context); |
if (!document->frame()) |
@@ -285,6 +288,11 @@ void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type, Excep |
return; |
} |
+ if (!throttlingController()) { |
+ exceptionState.throwDOMException(NotSupportedError, "Reading from a Document-detached FileReader is not supported."); |
kinuko
2014/07/17 15:22:24
I don't have strong opinion, but AbortError might
|
+ return; |
+ } |
+ |
// "Snapshot" the Blob data rather than the Blob itself as ongoing |
// read operations should not be affected if close() is called on |
// the Blob being read. |