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

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

Issue 383103002: 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 aae5e2e70d43c168c5b32e4b192f2bd13ea39935..016d535ad088d3cc28d21b89374c23805022bc30 100644
--- a/Source/modules/filesystem/FileWriter.cpp
+++ b/Source/modules/filesystem/FileWriter.cpp
@@ -87,6 +87,11 @@ void FileWriter::stop()
m_readyState = DONE;
}
+bool FileWriter::hasPendingActivity() const
+{
+ return m_operationInProgress != OperationNone || m_queuedOperation != OperationNone || m_readyState != DONE;
tzik 2014/07/11 06:55:47 s/m_readyState != DONE/m_readyState == WRITING/?
kouhei (in TOK) 2014/07/11 07:01:51 Done.
+}
+
void FileWriter::write(Blob* data, ExceptionState& exceptionState)
{
ASSERT(writer());
@@ -204,7 +209,6 @@ void FileWriter::didWrite(long long bytes, bool complete)
if (complete) {
if (numAborts == m_numAborts)
signalCompletion(FileError::OK);
- unsetPendingActivity(this);
}
}
@@ -221,7 +225,6 @@ void FileWriter::didTruncate()
setPosition(length());
m_operationInProgress = OperationNone;
signalCompletion(FileError::OK);
- unsetPendingActivity(this);
}
void FileWriter::didFail(blink::WebFileError code)
@@ -237,7 +240,6 @@ void FileWriter::didFail(blink::WebFileError code)
m_blobBeingWritten.clear();
m_operationInProgress = OperationNone;
signalCompletion(static_cast<FileError::ErrorCode>(code));
- unsetPendingActivity(this);
}
void FileWriter::completeAbort()
@@ -247,7 +249,6 @@ void FileWriter::completeAbort()
Operation operation = m_queuedOperation;
m_queuedOperation = OperationNone;
doOperation(operation);
- unsetPendingActivity(this);
}
void FileWriter::doOperation(Operation operation)
@@ -258,14 +259,12 @@ void FileWriter::doOperation(Operation operation)
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