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

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

Issue 474353004: FileReader: switch to using TypeChecking=Interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
Index: Source/core/fileapi/FileReader.cpp
diff --git a/Source/core/fileapi/FileReader.cpp b/Source/core/fileapi/FileReader.cpp
index 36361c26914f2c8b0ec7203419fd548a6c00028d..218e28e8a1e5bdb822a3bc4e468269256d8ab944 100644
--- a/Source/core/fileapi/FileReader.cpp
+++ b/Source/core/fileapi/FileReader.cpp
@@ -255,11 +255,7 @@ bool FileReader::hasPendingActivity() const
void FileReader::readAsArrayBuffer(Blob* blob, ExceptionState& exceptionState)
{
- if (!blob) {
- exceptionState.throwTypeError("The argument is not a Blob.");
- return;
- }
-
+ ASSERT(blob);
WTF_LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
readInternal(blob, FileReaderLoader::ReadAsArrayBuffer, exceptionState);
@@ -267,11 +263,7 @@ void FileReader::readAsArrayBuffer(Blob* blob, ExceptionState& exceptionState)
void FileReader::readAsBinaryString(Blob* blob, ExceptionState& exceptionState)
{
- if (!blob) {
- exceptionState.throwTypeError("The argument is not a Blob.");
- return;
- }
-
+ ASSERT(blob);
WTF_LOG(FileAPI, "FileReader: reading as binary: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
readInternal(blob, FileReaderLoader::ReadAsBinaryString, exceptionState);
@@ -279,11 +271,7 @@ void FileReader::readAsBinaryString(Blob* blob, ExceptionState& exceptionState)
void FileReader::readAsText(Blob* blob, const String& encoding, ExceptionState& exceptionState)
{
- if (!blob) {
- exceptionState.throwTypeError("The argument is not a Blob.");
- return;
- }
-
+ ASSERT(blob);
WTF_LOG(FileAPI, "FileReader: reading as text: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
m_encoding = encoding;
@@ -297,11 +285,7 @@ void FileReader::readAsText(Blob* blob, ExceptionState& exceptionState)
void FileReader::readAsDataURL(Blob* blob, ExceptionState& exceptionState)
{
- if (!blob) {
- exceptionState.throwTypeError("The argument is not a Blob.");
- return;
- }
-
+ ASSERT(blob);
WTF_LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
readInternal(blob, FileReaderLoader::ReadAsDataURL, exceptionState);
« no previous file with comments | « LayoutTests/fast/files/file-reader-methods-illegal-arguments-expected.txt ('k') | Source/core/fileapi/FileReader.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698