| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // All possible events have fired and we're done, no more pending activity. | 364 // All possible events have fired and we're done, no more pending activity. |
| 365 ThrottlingController::finishReader(executionContext(), this, finalStep); | 365 ThrottlingController::finishReader(executionContext(), this, finalStep); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void FileReader::result(StringOrArrayBuffer& resultAttribute) const | 368 void FileReader::result(StringOrArrayBuffer& resultAttribute) const |
| 369 { | 369 { |
| 370 if (!m_loader || m_error) | 370 if (!m_loader || m_error) |
| 371 return; | 371 return; |
| 372 | 372 |
| 373 if (m_readType == FileReaderLoader::ReadAsArrayBuffer) | 373 if (m_readType == FileReaderLoader::ReadAsArrayBuffer) |
| 374 resultAttribute.setArrayBuffer(m_loader->arrayBufferResult()); | 374 resultAttribute.setArrayBuffer(m_loader->arrayBufferResultOrNull()); |
| 375 else | 375 else |
| 376 resultAttribute.setString(m_loader->stringResult()); | 376 resultAttribute.setString(m_loader->stringResult()); |
| 377 } | 377 } |
| 378 | 378 |
| 379 void FileReader::terminate() | 379 void FileReader::terminate() |
| 380 { | 380 { |
| 381 if (m_loader) { | 381 if (m_loader) { |
| 382 m_loader->cancel(); | 382 m_loader->cancel(); |
| 383 m_loader = nullptr; | 383 m_loader = nullptr; |
| 384 } | 384 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 } | 469 } |
| 470 | 470 |
| 471 DEFINE_TRACE(FileReader) | 471 DEFINE_TRACE(FileReader) |
| 472 { | 472 { |
| 473 visitor->trace(m_error); | 473 visitor->trace(m_error); |
| 474 RefCountedGarbageCollectedEventTargetWithInlineData<FileReader>::trace(visit
or); | 474 RefCountedGarbageCollectedEventTargetWithInlineData<FileReader>::trace(visit
or); |
| 475 ActiveDOMObject::trace(visitor); | 475 ActiveDOMObject::trace(visitor); |
| 476 } | 476 } |
| 477 | 477 |
| 478 } // namespace blink | 478 } // namespace blink |
| OLD | NEW |