[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 13:50:42 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c49d75c86b68633a61fe2c85e0f8d2628db41e11
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 28 04:28:00 2010 +0000

    2010-09-27  Eric Uhrhane  <ericu at chromium.org>
    
            Reviewed by David Levin.
    
            Fix event sequencing in FileWriter
            https://bugs.webkit.org/show_bug.cgi?id=46544
    
            Only set readyState to DONE when we're about to send the last progress
            event associated with an operation.  Make sure all progress events come
            from backend calls, and aren't ever fired synchronously in response to
            user JS method calls.
    
            No new tests, as none of this is fully implemented yet.
    
            * fileapi/FileWriter.cpp:
            (WebCore::FileWriter::write):
            (WebCore::FileWriter::truncate):
            (WebCore::FileWriter::abort):
            (WebCore::FileWriter::didWrite):
            (WebCore::FileWriter::didTruncate):
            (WebCore::FileWriter::didFail):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68483 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 545147f..551ff17 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-27  Eric Uhrhane  <ericu at chromium.org>
+
+        Reviewed by David Levin.
+
+        Fix event sequencing in FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=46544
+
+        Only set readyState to DONE when we're about to send the last progress
+        event associated with an operation.  Make sure all progress events come
+        from backend calls, and aren't ever fired synchronously in response to
+        user JS method calls.
+
+        No new tests, as none of this is fully implemented yet.
+
+        * fileapi/FileWriter.cpp:
+        (WebCore::FileWriter::write):
+        (WebCore::FileWriter::truncate):
+        (WebCore::FileWriter::abort):
+        (WebCore::FileWriter::didWrite):
+        (WebCore::FileWriter::didTruncate):
+        (WebCore::FileWriter::didFail):
+
 2010-09-27  Chris Rogers  <crogers at google.com>
 
         Reviewed by James Robinson.
diff --git a/WebCore/fileapi/FileWriter.cpp b/WebCore/fileapi/FileWriter.cpp
index 7008cb1..8367bf9 100644
--- a/WebCore/fileapi/FileWriter.cpp
+++ b/WebCore/fileapi/FileWriter.cpp
@@ -96,7 +96,6 @@ void FileWriter::write(Blob* data, ExceptionCode& ec)
     m_readyState = WRITING;
     m_bytesWritten = 0;
     m_bytesToWrite = data->size();
-    fireEvent(eventNames().writestartEvent);
     m_writer->write(m_position, data);
 }
 
@@ -132,7 +131,6 @@ void FileWriter::truncate(long long position, ExceptionCode& ec)
     m_bytesWritten = 0;
     m_bytesToWrite = 0;
     m_truncateLength = position;
-    fireEvent(eventNames().writestartEvent);
     m_writer->truncate(position);
 }
 
@@ -144,11 +142,8 @@ void FileWriter::abort(ExceptionCode& ec)
         m_error = FileError::create(ec);
         return;
     }
+    
     m_error = FileError::create(ABORT_ERR);
-    m_readyState = DONE;
-    fireEvent(eventNames().errorEvent);
-    fireEvent(eventNames().abortEvent);
-    fireEvent(eventNames().writeendEvent);
     m_writer->abort();
 }
 
@@ -157,35 +152,41 @@ void FileWriter::didWrite(long long bytes, bool complete)
     ASSERT(bytes > 0);
     ASSERT(bytes + m_bytesWritten > 0);
     ASSERT(bytes + m_bytesWritten <= m_bytesToWrite);
+    if (!m_bytesWritten)
+        fireEvent(eventNames().writestartEvent);
     m_bytesWritten += bytes;
     ASSERT((m_bytesWritten == m_bytesToWrite) == complete);
     m_position += bytes;
     if (m_position > m_length)
         m_length = m_position;
-    if (complete)
-        m_readyState = DONE;
     fireEvent(eventNames().writeEvent);
-    if (complete)
+    if (complete) {
+        m_readyState = DONE;
         fireEvent(eventNames().writeendEvent);
+    }
 }
 
 void FileWriter::didTruncate()
 {
     ASSERT(m_truncateLength >= 0);
+    fireEvent(eventNames().writestartEvent);
     m_length = m_truncateLength;
     if (m_position > m_length)
         m_position = m_length;
-    m_readyState = DONE;
     m_truncateLength = -1;
     fireEvent(eventNames().writeEvent);
+    m_readyState = DONE;
     fireEvent(eventNames().writeendEvent);
 }
 
 void FileWriter::didFail(ExceptionCode ec)
 {
     m_error = FileError::create(ec);
-    m_readyState = DONE;
     fireEvent(eventNames().errorEvent);
+    if (ABORT_ERR == ec)
+        fireEvent(eventNames().abortEvent);
+    fireEvent(eventNames().errorEvent);
+    m_readyState = DONE;
     fireEvent(eventNames().writeendEvent);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list