Index: Source/core/fileapi/FileReader.cpp |
diff --git a/Source/core/fileapi/FileReader.cpp b/Source/core/fileapi/FileReader.cpp |
index d55d1b99a2861ac67792fc9f9090a62f60f3c354..e3db51ff240dbf58eb272fed69d4894c92e17ac5 100644 |
--- a/Source/core/fileapi/FileReader.cpp |
+++ b/Source/core/fileapi/FileReader.cpp |
@@ -32,6 +32,7 @@ |
#include "core/fileapi/FileReader.h" |
#include "bindings/core/v8/ExceptionState.h" |
+#include "bindings/core/v8/UnionTypesCore.h" |
#include "core/dom/CrossThreadTask.h" |
#include "core/dom/DOMArrayBuffer.h" |
#include "core/dom/Document.h" |
@@ -364,6 +365,17 @@ void FileReader::doAbort() |
ThrottlingController::finishReader(executionContext(), this, finalStep); |
} |
+void FileReader::result(StringOrArrayBuffer& resultAttribute) const |
+{ |
+ if (!m_loader || m_error) |
+ return; |
+ |
+ if (m_readType == FileReaderLoader::ReadAsArrayBuffer) |
+ resultAttribute.setArrayBuffer(m_loader->arrayBufferResult()); |
+ else |
+ resultAttribute.setString(m_loader->stringResult()); |
+} |
+ |
void FileReader::terminate() |
{ |
if (m_loader) { |
@@ -456,20 +468,6 @@ void FileReader::fireEvent(const AtomicString& type) |
InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); |
} |
-PassRefPtr<DOMArrayBuffer> FileReader::arrayBufferResult() const |
-{ |
- if (!m_loader || m_error) |
- return nullptr; |
- return m_loader->arrayBufferResult(); |
-} |
- |
-String FileReader::stringResult() |
-{ |
- if (!m_loader || m_error) |
- return String(); |
- return m_loader->stringResult(); |
-} |
- |
void FileReader::trace(Visitor* visitor) |
{ |
visitor->trace(m_error); |