| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 m_lastProgressNotificationTimeMS(0) {} | 199 m_lastProgressNotificationTimeMS(0) {} |
| 200 | 200 |
| 201 FileReader::~FileReader() { | 201 FileReader::~FileReader() { |
| 202 terminate(); | 202 terminate(); |
| 203 } | 203 } |
| 204 | 204 |
| 205 const AtomicString& FileReader::interfaceName() const { | 205 const AtomicString& FileReader::interfaceName() const { |
| 206 return EventTargetNames::FileReader; | 206 return EventTargetNames::FileReader; |
| 207 } | 207 } |
| 208 | 208 |
| 209 void FileReader::contextDestroyed() { | 209 void FileReader::contextDestroyed(ExecutionContext* destroyedContext) { |
| 210 // The delayed abort task tidies up and advances to the DONE state. | 210 // The delayed abort task tidies up and advances to the DONE state. |
| 211 if (m_loadingState == LoadingStateAborted) | 211 if (m_loadingState == LoadingStateAborted) |
| 212 return; | 212 return; |
| 213 | 213 |
| 214 if (hasPendingActivity()) | 214 if (hasPendingActivity()) { |
| 215 ThrottlingController::finishReader( | 215 ThrottlingController::finishReader( |
| 216 getExecutionContext(), this, | 216 destroyedContext, this, |
| 217 ThrottlingController::removeReader(getExecutionContext(), this)); | 217 ThrottlingController::removeReader(destroyedContext, this)); |
| 218 } |
| 218 terminate(); | 219 terminate(); |
| 219 } | 220 } |
| 220 | 221 |
| 221 bool FileReader::hasPendingActivity() const { | 222 bool FileReader::hasPendingActivity() const { |
| 222 return m_state == kLoading || m_stillFiringEvents; | 223 return m_state == kLoading || m_stillFiringEvents; |
| 223 } | 224 } |
| 224 | 225 |
| 225 void FileReader::readAsArrayBuffer(Blob* blob, ExceptionState& exceptionState) { | 226 void FileReader::readAsArrayBuffer(Blob* blob, ExceptionState& exceptionState) { |
| 226 ASSERT(blob); | 227 ASSERT(blob); |
| 227 DVLOG(1) << "reading as array buffer: " << utf8BlobUUID(blob).data() << " " | 228 DVLOG(1) << "reading as array buffer: " << utf8BlobUUID(blob).data() << " " |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 ProgressEvent::create(type, false, m_loader->bytesLoaded(), 0)); | 468 ProgressEvent::create(type, false, m_loader->bytesLoaded(), 0)); |
| 468 } | 469 } |
| 469 | 470 |
| 470 DEFINE_TRACE(FileReader) { | 471 DEFINE_TRACE(FileReader) { |
| 471 visitor->trace(m_error); | 472 visitor->trace(m_error); |
| 472 EventTargetWithInlineData::trace(visitor); | 473 EventTargetWithInlineData::trace(visitor); |
| 473 ContextLifecycleObserver::trace(visitor); | 474 ContextLifecycleObserver::trace(visitor); |
| 474 } | 475 } |
| 475 | 476 |
| 476 } // namespace blink | 477 } // namespace blink |
| OLD | NEW |