| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 230 |
| 231 void FileWriter::completeAbort() { | 231 void FileWriter::completeAbort() { |
| 232 ASSERT(m_operationInProgress == OperationAbort); | 232 ASSERT(m_operationInProgress == OperationAbort); |
| 233 m_operationInProgress = OperationNone; | 233 m_operationInProgress = OperationNone; |
| 234 Operation operation = m_queuedOperation; | 234 Operation operation = m_queuedOperation; |
| 235 m_queuedOperation = OperationNone; | 235 m_queuedOperation = OperationNone; |
| 236 doOperation(operation); | 236 doOperation(operation); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void FileWriter::doOperation(Operation operation) { | 239 void FileWriter::doOperation(Operation operation) { |
| 240 InspectorInstrumentation::asyncTaskScheduled(getExecutionContext(), | 240 probe::asyncTaskScheduled(getExecutionContext(), "FileWriter", this); |
| 241 "FileWriter", this); | |
| 242 switch (operation) { | 241 switch (operation) { |
| 243 case OperationWrite: | 242 case OperationWrite: |
| 244 DCHECK_EQ(OperationNone, m_operationInProgress); | 243 DCHECK_EQ(OperationNone, m_operationInProgress); |
| 245 DCHECK_EQ(-1, m_truncateLength); | 244 DCHECK_EQ(-1, m_truncateLength); |
| 246 DCHECK(m_blobBeingWritten.get()); | 245 DCHECK(m_blobBeingWritten.get()); |
| 247 DCHECK_EQ(kWriting, m_readyState); | 246 DCHECK_EQ(kWriting, m_readyState); |
| 248 writer()->write(position(), m_blobBeingWritten->uuid()); | 247 writer()->write(position(), m_blobBeingWritten->uuid()); |
| 249 break; | 248 break; |
| 250 case OperationTruncate: | 249 case OperationTruncate: |
| 251 DCHECK_EQ(OperationNone, m_operationInProgress); | 250 DCHECK_EQ(OperationNone, m_operationInProgress); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 280 if (FileError::kOK != code) { | 279 if (FileError::kOK != code) { |
| 281 m_error = FileError::createDOMException(code); | 280 m_error = FileError::createDOMException(code); |
| 282 if (FileError::kAbortErr == code) | 281 if (FileError::kAbortErr == code) |
| 283 fireEvent(EventTypeNames::abort); | 282 fireEvent(EventTypeNames::abort); |
| 284 else | 283 else |
| 285 fireEvent(EventTypeNames::error); | 284 fireEvent(EventTypeNames::error); |
| 286 } else | 285 } else |
| 287 fireEvent(EventTypeNames::write); | 286 fireEvent(EventTypeNames::write); |
| 288 fireEvent(EventTypeNames::writeend); | 287 fireEvent(EventTypeNames::writeend); |
| 289 | 288 |
| 290 InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this); | 289 probe::asyncTaskCanceled(getExecutionContext(), this); |
| 291 } | 290 } |
| 292 | 291 |
| 293 void FileWriter::fireEvent(const AtomicString& type) { | 292 void FileWriter::fireEvent(const AtomicString& type) { |
| 294 InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), this); | 293 probe::AsyncTask asyncTask(getExecutionContext(), this); |
| 295 ++m_recursionDepth; | 294 ++m_recursionDepth; |
| 296 dispatchEvent( | 295 dispatchEvent( |
| 297 ProgressEvent::create(type, true, m_bytesWritten, m_bytesToWrite)); | 296 ProgressEvent::create(type, true, m_bytesWritten, m_bytesToWrite)); |
| 298 --m_recursionDepth; | 297 --m_recursionDepth; |
| 299 ASSERT(m_recursionDepth >= 0); | 298 ASSERT(m_recursionDepth >= 0); |
| 300 } | 299 } |
| 301 | 300 |
| 302 void FileWriter::setError(FileError::ErrorCode errorCode, | 301 void FileWriter::setError(FileError::ErrorCode errorCode, |
| 303 ExceptionState& exceptionState) { | 302 ExceptionState& exceptionState) { |
| 304 ASSERT(errorCode); | 303 ASSERT(errorCode); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 318 | 317 |
| 319 DEFINE_TRACE(FileWriter) { | 318 DEFINE_TRACE(FileWriter) { |
| 320 visitor->trace(m_error); | 319 visitor->trace(m_error); |
| 321 visitor->trace(m_blobBeingWritten); | 320 visitor->trace(m_blobBeingWritten); |
| 322 EventTargetWithInlineData::trace(visitor); | 321 EventTargetWithInlineData::trace(visitor); |
| 323 FileWriterBase::trace(visitor); | 322 FileWriterBase::trace(visitor); |
| 324 ContextLifecycleObserver::trace(visitor); | 323 ContextLifecycleObserver::trace(visitor); |
| 325 } | 324 } |
| 326 | 325 |
| 327 } // namespace blink | 326 } // namespace blink |
| OLD | NEW |