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

Side by Side Diff: third_party/WebKit/Source/modules/filesystem/FileWriter.cpp

Issue 2040563002: Remove FileError interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fe-dep
Patch Set: handleEvent -> invoke and other review nits Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 281 }
282 ASSERT(m_queuedOperation == OperationNone); 282 ASSERT(m_queuedOperation == OperationNone);
283 m_operationInProgress = operation; 283 m_operationInProgress = operation;
284 } 284 }
285 285
286 void FileWriter::signalCompletion(FileError::ErrorCode code) 286 void FileWriter::signalCompletion(FileError::ErrorCode code)
287 { 287 {
288 m_readyState = DONE; 288 m_readyState = DONE;
289 m_truncateLength = -1; 289 m_truncateLength = -1;
290 if (FileError::OK != code) { 290 if (FileError::OK != code) {
291 m_error = FileError::create(code); 291 m_error = FileError::createDOMException(code);
292 if (FileError::ABORT_ERR == code) 292 if (FileError::ABORT_ERR == code)
293 fireEvent(EventTypeNames::abort); 293 fireEvent(EventTypeNames::abort);
294 else 294 else
295 fireEvent(EventTypeNames::error); 295 fireEvent(EventTypeNames::error);
296 } else 296 } else
297 fireEvent(EventTypeNames::write); 297 fireEvent(EventTypeNames::write);
298 fireEvent(EventTypeNames::writeend); 298 fireEvent(EventTypeNames::writeend);
299 299
300 InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this); 300 InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this);
301 } 301 }
302 302
303 void FileWriter::fireEvent(const AtomicString& type) 303 void FileWriter::fireEvent(const AtomicString& type)
304 { 304 {
305 InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), this); 305 InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), this);
306 ++m_recursionDepth; 306 ++m_recursionDepth;
307 dispatchEvent(ProgressEvent::create(type, true, m_bytesWritten, m_bytesToWri te)); 307 dispatchEvent(ProgressEvent::create(type, true, m_bytesWritten, m_bytesToWri te));
308 --m_recursionDepth; 308 --m_recursionDepth;
309 ASSERT(m_recursionDepth >= 0); 309 ASSERT(m_recursionDepth >= 0);
310 } 310 }
311 311
312 void FileWriter::setError(FileError::ErrorCode errorCode, ExceptionState& except ionState) 312 void FileWriter::setError(FileError::ErrorCode errorCode, ExceptionState& except ionState)
313 { 313 {
314 ASSERT(errorCode); 314 ASSERT(errorCode);
315 FileError::throwDOMException(exceptionState, errorCode); 315 FileError::throwDOMException(exceptionState, errorCode);
316 m_error = FileError::create(errorCode); 316 m_error = FileError::createDOMException(errorCode);
317 } 317 }
318 318
319 DEFINE_TRACE(FileWriter) 319 DEFINE_TRACE(FileWriter)
320 { 320 {
321 visitor->trace(m_error); 321 visitor->trace(m_error);
322 visitor->trace(m_blobBeingWritten); 322 visitor->trace(m_blobBeingWritten);
323 EventTargetWithInlineData::trace(visitor); 323 EventTargetWithInlineData::trace(visitor);
324 FileWriterBase::trace(visitor); 324 FileWriterBase::trace(visitor);
325 ActiveDOMObject::trace(visitor); 325 ActiveDOMObject::trace(visitor);
326 } 326 }
327 327
328 } // namespace blink 328 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698