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

Unified Diff: Source/modules/filesystem/FileWriter.cpp

Issue 383993008: Revert of FileWriter should not use deprecated {,un}setPendingActivity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/filesystem/FileWriter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/filesystem/FileWriter.cpp
diff --git a/Source/modules/filesystem/FileWriter.cpp b/Source/modules/filesystem/FileWriter.cpp
index d6ba4024e032b43870b3d31edeffd9769821c06a..aae5e2e70d43c168c5b32e4b192f2bd13ea39935 100644
--- a/Source/modules/filesystem/FileWriter.cpp
+++ b/Source/modules/filesystem/FileWriter.cpp
@@ -87,11 +87,6 @@
m_readyState = DONE;
}
-bool FileWriter::hasPendingActivity() const
-{
- return m_operationInProgress != OperationNone || m_queuedOperation != OperationNone || m_readyState != WRITING;
-}
-
void FileWriter::write(Blob* data, ExceptionState& exceptionState)
{
ASSERT(writer());
@@ -209,6 +204,7 @@
if (complete) {
if (numAborts == m_numAborts)
signalCompletion(FileError::OK);
+ unsetPendingActivity(this);
}
}
@@ -225,6 +221,7 @@
setPosition(length());
m_operationInProgress = OperationNone;
signalCompletion(FileError::OK);
+ unsetPendingActivity(this);
}
void FileWriter::didFail(blink::WebFileError code)
@@ -240,6 +237,7 @@
m_blobBeingWritten.clear();
m_operationInProgress = OperationNone;
signalCompletion(static_cast<FileError::ErrorCode>(code));
+ unsetPendingActivity(this);
}
void FileWriter::completeAbort()
@@ -249,6 +247,7 @@
Operation operation = m_queuedOperation;
m_queuedOperation = OperationNone;
doOperation(operation);
+ unsetPendingActivity(this);
}
void FileWriter::doOperation(Operation operation)
@@ -259,12 +258,14 @@
ASSERT(m_truncateLength == -1);
ASSERT(m_blobBeingWritten.get());
ASSERT(m_readyState == WRITING);
+ setPendingActivity(this);
writer()->write(position(), m_blobBeingWritten->uuid());
break;
case OperationTruncate:
ASSERT(m_operationInProgress == OperationNone);
ASSERT(m_truncateLength >= 0);
ASSERT(m_readyState == WRITING);
+ setPendingActivity(this);
writer()->truncate(m_truncateLength);
break;
case OperationNone:
« no previous file with comments | « Source/modules/filesystem/FileWriter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698