[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 14:14:24 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f2a8dd1ee095cb4dac8299a4479792128afa77df
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 5 20:28:59 2010 +0000

    2010-10-05  Eric Uhrhane  <ericu at chromium.org>
    
            Reviewed by David Levin.
    
            Relax restrictions on FileWriter::didWrite calls
            https://bugs.webkit.org/show_bug.cgi?id=47139
    
            No new tests; they're still waiting on the first implementation.
    
            * fileapi/FileWriter.cpp:
            (WebCore::FileWriter::FileWriter):
            (WebCore::FileWriter::write):
            (WebCore::FileWriter::didWrite):
            * fileapi/FileWriter.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 742f369..51dfb61 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-05  Eric Uhrhane  <ericu at chromium.org>
+
+        Reviewed by David Levin.
+
+        Relax restrictions on FileWriter::didWrite calls
+        https://bugs.webkit.org/show_bug.cgi?id=47139
+
+        No new tests; they're still waiting on the first implementation.
+
+        * fileapi/FileWriter.cpp:
+        (WebCore::FileWriter::FileWriter):
+        (WebCore::FileWriter::write):
+        (WebCore::FileWriter::didWrite):
+        * fileapi/FileWriter.h:
+
 2010-10-05  Daniel Cheng  <dcheng at chromium.org>
 
         Reviewed by Tony Chang.
diff --git a/WebCore/fileapi/FileWriter.cpp b/WebCore/fileapi/FileWriter.cpp
index 8367bf9..2943150 100644
--- a/WebCore/fileapi/FileWriter.cpp
+++ b/WebCore/fileapi/FileWriter.cpp
@@ -46,6 +46,7 @@ FileWriter::FileWriter(ScriptExecutionContext* context)
     : ActiveDOMObject(context, this)
     , m_readyState(INIT)
     , m_position(0)
+    , m_startedWriting(false)
     , m_bytesWritten(0)
     , m_bytesToWrite(0)
     , m_truncateLength(-1)
@@ -92,8 +93,14 @@ void FileWriter::write(Blob* data, ExceptionCode& ec)
         m_error = FileError::create(ec);
         return;
     }
+    if (!data) {
+        ec = TYPE_MISMATCH_ERR;
+        m_error = FileError::create(ec);
+        return;
+    }
 
     m_readyState = WRITING;
+    m_startedWriting = false;
     m_bytesWritten = 0;
     m_bytesToWrite = data->size();
     m_writer->write(m_position, data);
@@ -149,13 +156,14 @@ void FileWriter::abort(ExceptionCode& ec)
 
 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)
+    if (!m_startedWriting) {
         fireEvent(eventNames().writestartEvent);
+        m_startedWriting = true;
+    }
     m_bytesWritten += bytes;
-    ASSERT((m_bytesWritten == m_bytesToWrite) == complete);
+    ASSERT((m_bytesWritten == m_bytesToWrite) || !complete);
     m_position += bytes;
     if (m_position > m_length)
         m_length = m_position;
diff --git a/WebCore/fileapi/FileWriter.h b/WebCore/fileapi/FileWriter.h
index 4bb91ef..b36d0e8 100644
--- a/WebCore/fileapi/FileWriter.h
+++ b/WebCore/fileapi/FileWriter.h
@@ -119,6 +119,7 @@ private:
     ReadyState m_readyState;
     long long m_position;
     long long m_length;
+    bool m_startedWriting;
     long long m_bytesWritten;
     long long m_bytesToWrite;
     long long m_truncateLength;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list