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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 getExecutionContext()->postTask( | 337 getExecutionContext()->postTask( |
338 BLINK_FROM_HERE, createSameThreadTask(&delayedAbort, wrapPersistent(this
))); | 338 BLINK_FROM_HERE, createSameThreadTask(&delayedAbort, wrapPersistent(this
))); |
339 } | 339 } |
340 | 340 |
341 void FileReader::doAbort() | 341 void FileReader::doAbort() |
342 { | 342 { |
343 ASSERT(m_state != DONE); | 343 ASSERT(m_state != DONE); |
344 | 344 |
345 terminate(); | 345 terminate(); |
346 | 346 |
347 m_error = FileError::create(FileError::ABORT_ERR); | 347 m_error = FileError::createDOMException(FileError::ABORT_ERR); |
348 | 348 |
349 // Unregister the reader. | 349 // Unregister the reader. |
350 ThrottlingController::FinishReaderType finalStep = ThrottlingController::rem
oveReader(getExecutionContext(), this); | 350 ThrottlingController::FinishReaderType finalStep = ThrottlingController::rem
oveReader(getExecutionContext(), this); |
351 | 351 |
352 fireEvent(EventTypeNames::error); | 352 fireEvent(EventTypeNames::error); |
353 fireEvent(EventTypeNames::abort); | 353 fireEvent(EventTypeNames::abort); |
354 fireEvent(EventTypeNames::loadend); | 354 fireEvent(EventTypeNames::loadend); |
355 | 355 |
356 // All possible events have fired and we're done, no more pending activity. | 356 // All possible events have fired and we're done, no more pending activity. |
357 ThrottlingController::finishReader(getExecutionContext(), this, finalStep); | 357 ThrottlingController::finishReader(getExecutionContext(), this, finalStep); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 void FileReader::didFail(FileError::ErrorCode errorCode) | 424 void FileReader::didFail(FileError::ErrorCode errorCode) |
425 { | 425 { |
426 if (m_loadingState == LoadingStateAborted) | 426 if (m_loadingState == LoadingStateAborted) |
427 return; | 427 return; |
428 ASSERT(m_loadingState == LoadingStateLoading); | 428 ASSERT(m_loadingState == LoadingStateLoading); |
429 m_loadingState = LoadingStateNone; | 429 m_loadingState = LoadingStateNone; |
430 | 430 |
431 ASSERT(m_state != DONE); | 431 ASSERT(m_state != DONE); |
432 m_state = DONE; | 432 m_state = DONE; |
433 | 433 |
434 m_error = FileError::create(static_cast<FileError::ErrorCode>(errorCode)); | 434 m_error = FileError::createDOMException(static_cast<FileError::ErrorCode>(er
rorCode)); |
435 | 435 |
436 // Unregister the reader. | 436 // Unregister the reader. |
437 ThrottlingController::FinishReaderType finalStep = ThrottlingController::rem
oveReader(getExecutionContext(), this); | 437 ThrottlingController::FinishReaderType finalStep = ThrottlingController::rem
oveReader(getExecutionContext(), this); |
438 | 438 |
439 fireEvent(EventTypeNames::error); | 439 fireEvent(EventTypeNames::error); |
440 fireEvent(EventTypeNames::loadend); | 440 fireEvent(EventTypeNames::loadend); |
441 | 441 |
442 // All possible events have fired and we're done, no more pending activity. | 442 // All possible events have fired and we're done, no more pending activity. |
443 ThrottlingController::finishReader(getExecutionContext(), this, finalStep); | 443 ThrottlingController::finishReader(getExecutionContext(), this, finalStep); |
444 } | 444 } |
(...skipping 13 matching lines...) Expand all Loading... |
458 } | 458 } |
459 | 459 |
460 DEFINE_TRACE(FileReader) | 460 DEFINE_TRACE(FileReader) |
461 { | 461 { |
462 visitor->trace(m_error); | 462 visitor->trace(m_error); |
463 EventTargetWithInlineData::trace(visitor); | 463 EventTargetWithInlineData::trace(visitor); |
464 ActiveDOMObject::trace(visitor); | 464 ActiveDOMObject::trace(visitor); |
465 } | 465 } |
466 | 466 |
467 } // namespace blink | 467 } // namespace blink |
OLD | NEW |