[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 12:19:26 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 467686d33f06fa7e3eca97ee23e792f3f3dbddb2
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 19 07:18:12 2010 +0000

    2010-08-19  Eric Uhrhane  <ericu at chromium.org>
    
            Reviewed by David Levin.
    
            Add idl and mock classes for FileWriter.
            https://bugs.webkit.org/show_bug.cgi?id=44075
    
            No new tests, since there's no new functionality.
    
            New do-nothing classes, but the real IDL:
            * FileWriter.idl:
            * FileWriter.h:
            * FileWriter.cpp:
    
            The build file changes to include the above:
            * CMakeLists.txt:
            * DerivedSources.cpp:
            * DerivedSources.make:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pri:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
    
            Added FileWriter event names and required EventTarget changes.
            * dom/EventNames.h:
            * dom/EventTarget.cpp:
            (WebCore::EventTarget::toFileWriter):
            * dom/EventTarget.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65656 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 2940015..3fe6c2c 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -198,6 +198,7 @@ SET(WebCore_IDL_FILES
     html/File.idl
     html/FileList.idl
     html/FileReader.idl
+    html/FileWriter.idl
     html/HTMLAllCollection.idl
     html/HTMLAnchorElement.idl
     html/HTMLAppletElement.idl
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6dedc3b..a0f21b9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-08-19  Eric Uhrhane  <ericu at chromium.org>
+
+        Reviewed by David Levin.
+
+        Add idl and mock classes for FileWriter.
+        https://bugs.webkit.org/show_bug.cgi?id=44075
+
+        No new tests, since there's no new functionality.
+
+        New do-nothing classes, but the real IDL:
+        * FileWriter.idl:
+        * FileWriter.h:
+        * FileWriter.cpp:
+
+        The build file changes to include the above:
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        Added FileWriter event names and required EventTarget changes.
+        * dom/EventNames.h:
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::toFileWriter):
+        * dom/EventTarget.h:
+
 2010-08-18  Andreas Kling  <andreas.kling at nokia.com>
 
         Rubber-stamped by Ariya Hidayat.
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 351db54..bbab64b 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -110,6 +110,7 @@
 #include "JSFileList.cpp"
 #include "JSFileReader.cpp"
 #include "JSFileSystemCallback.cpp"
+#include "JSFileWriter.cpp"
 #include "JSFlags.cpp"
 #include "JSGeolocation.cpp"
 #include "JSGeoposition.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 886c1f3..c0cde97 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -154,6 +154,7 @@ DOM_CLASSES = \
     FileError \
     FileList \
     FileReader \
+    FileWriter \
     FileSystemCallback \
     Flags \
     Geolocation \
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index c6d5838..99c0547 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -238,6 +238,8 @@ webcore_built_sources += \
 	DerivedSources/WebCore/JSFileList.h \
 	DerivedSources/WebCore/JSFileReader.cpp \
 	DerivedSources/WebCore/JSFileReader.h \
+	DerivedSources/WebCore/JSFileWriter.cpp \
+	DerivedSources/WebCore/JSFileWriter.h \
 	DerivedSources/WebCore/JSFloat32Array.cpp \
 	DerivedSources/WebCore/JSFloat32Array.h \
 	DerivedSources/WebCore/JSGeolocation.cpp \
@@ -1353,6 +1355,8 @@ webcore_sources += \
 	WebCore/html/FileList.h \
 	WebCore/html/FileReader.cpp \
 	WebCore/html/FileReader.h \
+	WebCore/html/FileWriter.cpp \
+	WebCore/html/FileWriter.h \
 	WebCore/html/FileStreamClient.h \
 	WebCore/html/FileStreamProxy.cpp \
 	WebCore/html/FileStreamProxy.h \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 32b2fe1..3dff25d 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -118,6 +118,7 @@
             'html/FileError.idl',
             'html/FileList.idl',
             'html/FileReader.idl',
+            'html/FileWriter.idl',
             'html/HTMLAllCollection.idl',
             'html/HTMLAnchorElement.idl',
             'html/HTMLAppletElement.idl',
@@ -1518,6 +1519,8 @@
             'html/FileList.h',
             'html/FileReader.cpp',
             'html/FileReader.h',
+            'html/FileWriter.cpp',
+            'html/FileWriter.h',
             'html/FileStreamClient.h',
             'html/FileStreamProxy.cpp',
             'html/FileStreamProxy.h',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index de9638f..3294ecd 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -179,6 +179,7 @@ IDL_BINDINGS += \
     html/FileError.idl \
     html/FileList.idl \
     html/FileReader.idl \
+    html/FileWriter.idl \
     html/HTMLAllCollection.idl \
     html/HTMLAudioElement.idl \
     html/HTMLAnchorElement.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 6c6e289..37d4bd7 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -638,6 +638,7 @@ SOURCES += \
     html/FileReader.cpp \
     html/FileStreamProxy.cpp \
     html/FileThread.cpp \
+    html/FileWriter.cpp \
     html/FormDataList.cpp \
     html/HTMLEntityParser.cpp \
     html/HTMLTokenizer.cpp \
@@ -1414,6 +1415,7 @@ HEADERS += \
     html/FileStreamProxy.h \
     html/FileThread.h \
     html/FileThreadTask.h \
+    html/FileWriter.h \
     html/FormDataList.h \
     html/HTMLAllCollection.h \
     html/HTMLAnchorElement.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index bebc3f8..18d4851 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -4981,6 +4981,62 @@
 				>
 			</File>
 			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileWriter.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Internal|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_All|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileWriter.h"
+				>
+			</File>
+			<File
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileSystemCallback.cpp"
 				>
 				<FileConfiguration
@@ -37149,6 +37205,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\html\FileWriter.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\html\FileWriter.h"
+				>
+			</File>
+			<File
 				RelativePath="..\html\FormDataList.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 8ce2a06..2435c61 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -896,6 +896,8 @@
 		4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 4614A1FD0B23A8D600446E1C /* copyCursor.png */; };
 		464EA2730B8A350B00A8E6E3 /* crossHairCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */; };
 		464EA2740B8A350B00A8E6E3 /* notAllowedCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */; };
+		46A26905121B6B4300C41F3A /* FileWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A26902121B6B4300C41F3A /* FileWriter.cpp */; };
+		46A26906121B6B4300C41F3A /* FileWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A26903121B6B4300C41F3A /* FileWriter.h */; };
 		46BD16E30B279473001F0839 /* noneCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46BD16E20B279473001F0839 /* noneCursor.png */; };
 		46D4F2490AF97E810035385A /* cellCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2460AF97E810035385A /* cellCursor.png */; };
 		46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2470AF97E810035385A /* contextMenuCursor.png */; };
@@ -6725,6 +6727,9 @@
 		4614A1FD0B23A8D600446E1C /* copyCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = copyCursor.png; sourceTree = "<group>"; };
 		464EA2710B8A350B00A8E6E3 /* crossHairCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = crossHairCursor.png; sourceTree = "<group>"; };
 		464EA2720B8A350B00A8E6E3 /* notAllowedCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = notAllowedCursor.png; sourceTree = "<group>"; };
+		46A26902121B6B4300C41F3A /* FileWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileWriter.cpp; sourceTree = "<group>"; };
+		46A26903121B6B4300C41F3A /* FileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileWriter.h; sourceTree = "<group>"; };
+		46A26904121B6B4300C41F3A /* FileWriter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileWriter.idl; sourceTree = "<group>"; };
 		46BD16E20B279473001F0839 /* noneCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noneCursor.png; sourceTree = "<group>"; };
 		46D4F2460AF97E810035385A /* cellCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cellCursor.png; sourceTree = "<group>"; };
 		46D4F2470AF97E810035385A /* contextMenuCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contextMenuCursor.png; sourceTree = "<group>"; };
@@ -14015,6 +14020,9 @@
 				8952535011641B3400CABF00 /* FileThread.cpp */,
 				8952535111641B3400CABF00 /* FileThread.h */,
 				895253DE116C4F0600CABF00 /* FileThreadTask.h */,
+				46A26902121B6B4300C41F3A /* FileWriter.cpp */,
+				46A26903121B6B4300C41F3A /* FileWriter.h */,
+				46A26904121B6B4300C41F3A /* FileWriter.idl */,
 				A8136D370973A8E700D74463 /* FormDataList.cpp */,
 				A8136D360973A8E700D74463 /* FormDataList.h */,
 				BC97E239109144950010D361 /* HTMLAllCollection.cpp */,
@@ -20320,6 +20328,7 @@
 				2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */,
 				2EDEF1F8121B0EFC00726DB2 /* BlobStorageData.h in Headers */,
 				2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */,
+				46A26906121B6B4300C41F3A /* FileWriter.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -22770,6 +22779,7 @@
 				2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
 				2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */,
 				2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */,
+				46A26905121B6B4300C41F3A /* FileWriter.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/dom/EventNames.h b/WebCore/dom/EventNames.h
index 5024bdd..ebed2e1 100644
--- a/WebCore/dom/EventNames.h
+++ b/WebCore/dom/EventNames.h
@@ -103,6 +103,9 @@ namespace WebCore {
     macro(textInput) \
     macro(unload) \
     macro(updateready) \
+    macro(write) \
+    macro(writeend) \
+    macro(writestart) \
     macro(zoom) \
     \
     macro(DOMActivate) \
diff --git a/WebCore/dom/EventTarget.cpp b/WebCore/dom/EventTarget.cpp
index 42a153a..7fa53f3 100644
--- a/WebCore/dom/EventTarget.cpp
+++ b/WebCore/dom/EventTarget.cpp
@@ -162,6 +162,12 @@ FileReader* EventTarget::toFileReader()
     return 0;
 }
 #endif
+#if ENABLE(FILE_WRITER)
+FileWriter* EventTarget::toFileWriter()
+{
+    return 0;
+}
+#endif
 
 #if ENABLE(INDEXED_DATABASE)
 IDBRequest* EventTarget::toIDBRequest()
diff --git a/WebCore/dom/EventTarget.h b/WebCore/dom/EventTarget.h
index b4aa542..bf6a9c2 100644
--- a/WebCore/dom/EventTarget.h
+++ b/WebCore/dom/EventTarget.h
@@ -48,6 +48,7 @@ namespace WebCore {
     class EventListener;
     class EventSource;
     class FileReader;
+    class FileWriter;
     class IDBRequest;
     class MessagePort;
     class Node;
@@ -122,6 +123,9 @@ namespace WebCore {
 #if ENABLE(BLOB)
         virtual FileReader* toFileReader();
 #endif
+#if ENABLE(FILE_WRITER)
+        virtual FileWriter* toFileWriter();
+#endif
 
 #if ENABLE(INDEXED_DATABASE)
         virtual IDBRequest* toIDBRequest();
diff --git a/WebCore/html/FileWriter.cpp b/WebCore/html/FileWriter.cpp
new file mode 100644
index 0000000..7d112e2
--- /dev/null
+++ b/WebCore/html/FileWriter.cpp
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2010 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILE_WRITER)
+
+#include "FileWriter.h"
+
+namespace WebCore {
+
+FileWriter::FileWriter(ScriptExecutionContext* context)
+    : ActiveDOMObject(context, this)
+{
+}
+
+FileWriter::~FileWriter()
+{
+}
+
+bool FileWriter::hasPendingActivity() const
+{
+    return false;
+}
+
+bool FileWriter::canSuspend() const
+{
+    // FIXME: It is not currently possible to suspend a FileWriter, so pages with FileWriter can not go into page cache.
+    return false;
+}
+
+void FileWriter::stop()
+{
+}
+
+void FileWriter::write(Blob*)
+{
+}
+
+void FileWriter::seek(long long)
+{
+}
+
+void FileWriter::truncate(long long)
+{
+}
+
+void FileWriter::abort()
+{
+}
+
+FileWriter::ReadyState FileWriter::readyState() const
+{
+    return EMPTY;
+}
+
+} // namespace WebCore
+ 
+#endif // ENABLE(FILE_WRITER)
diff --git a/WebCore/html/FileWriter.h b/WebCore/html/FileWriter.h
new file mode 100644
index 0000000..fd5babf
--- /dev/null
+++ b/WebCore/html/FileWriter.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2010 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FileWriter_h
+#define FileWriter_h
+
+#if ENABLE(FILE_WRITER)
+
+#include "ActiveDOMObject.h"
+#include "EventTarget.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Blob;
+class FileError;
+class ScriptExecutionContext;
+
+// FIXME: This is an empty, do-nothing placeholder for implementation yet to come.
+class FileWriter : public RefCounted<FileWriter>, public ActiveDOMObject, public EventTarget {
+public:
+    static PassRefPtr<FileWriter> create(ScriptExecutionContext* context)
+    {
+        return adoptRef(new FileWriter(context));
+    }
+
+    enum ReadyState {
+        EMPTY = 0,
+        WRITING = 1,
+        DONE = 2
+    };
+
+    void write(Blob*);
+    void seek(long long position);
+    void truncate(long long length);
+    void abort();
+
+    ReadyState readyState() const;
+    FileError* error() const { return m_error; };
+    long long position() const { return 0; };
+    long long length() const { return 0; };
+
+    // ActiveDOMObject
+    virtual bool canSuspend() const;
+    virtual void stop();
+    virtual bool hasPendingActivity() const;
+
+    // EventTarget
+    virtual FileWriter* toFileWriter() { return this; }
+    virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
+
+    using RefCounted<FileWriter>::ref;
+    using RefCounted<FileWriter>::deref;
+
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(writestart);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(progress);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(write);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(writeend);
+
+private:
+    FileWriter(ScriptExecutionContext*);
+
+    virtual ~FileWriter();
+
+    friend class RefCounted<FileWriter>;
+
+    // EventTarget
+    virtual void refEventTarget() { ref(); }
+    virtual void derefEventTarget() { deref(); }
+    virtual EventTargetData* eventTargetData() { return &m_eventTargetData; }
+    virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; }
+
+    RefPtr<FileError*> m_error;
+    EventTargetData m_eventTargetData;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_WRITER)
+
+#endif // FileWriter_h
diff --git a/WebCore/html/FileWriter.idl b/WebCore/html/FileWriter.idl
new file mode 100644
index 0000000..bb95ee1
--- /dev/null
+++ b/WebCore/html/FileWriter.idl
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Google Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module html {
+    interface [
+        Conditional=FILE_WRITER,
+        CallWith=ScriptExecutionContext,
+        EventTarget,
+        NoStaticTables
+    ] FileWriter {
+        // ready states
+        const unsigned short INIT = 0;
+        const unsigned short WRITING = 1;
+        const unsigned short DONE = 2;
+        readonly attribute unsigned short readyState;
+
+        // async write/modify methods
+        void write(in Blob data) raises (FileException);
+        void seek(in long long position) raises (FileException);
+        void truncate(in long long size) raises (FileException);
+
+        void abort() raises (FileException);
+
+        readonly attribute FileError error;
+        readonly attribute long long position;
+        readonly attribute long long length;
+
+                 attribute EventListener onwritestart;
+                 attribute EventListener onprogress;
+                 attribute EventListener onwrite;
+                 attribute EventListener onabort;
+                 attribute EventListener onerror;
+                 attribute EventListener onwriteend;
+    };
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list