2010-04-01 Kinuko Yasuda <kinuko@chromium.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Apr 2010 05:22:59 +0000 (05:22 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Apr 2010 05:22:59 +0000 (05:22 +0000)
        Reviewed by Dmitry Titov.

        Add FileThread for async file operation support in FileReader and FileWriter
        https://bugs.webkit.org/show_bug.cgi?id=36896

        Add EANBEL_FILE_READER and ENABLE_FILE_WRITER flags.

        * configure.ac:
2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>

        Reviewed by Dmitry Titov.

        Add FileThread for async file operation support in FileReader and FileWriter
        https://bugs.webkit.org/show_bug.cgi?id=36896

        Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.

        * Configurations/FeatureDefines.xcconfig:
2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>

        Reviewed by Dmitry Titov.

        Add FileThread for async file operation support in FileReader and FileWriter
        https://bugs.webkit.org/show_bug.cgi?id=36896

        Add FileThread for async file operation support for FileReader and
        FileWriter.  The patch also adds ENABLE_FILE_READER or
        ENABLE_FILE_WRITER build flags/defines.  Both flags are disabled
        by default.

        No new tests, will add ones when after adding modules which use the thread.

        * Configurations/FeatureDefines.xcconfig:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
        (WebCore::ScriptExecutionContext::fileThread):
        * dom/ScriptExecutionContext.h:
        * html/FileThread.cpp: Added.
        (WebCore::FileThread::FileThread):
        (WebCore::FileThread::~FileThread):
        (WebCore::FileThread::start):
        (WebCore::FileThread::stop):
        (WebCore::FileThread::postTask):
        (WebCore::SameFilePredicate::SameFilePredicate):
        (WebCore::SameFilePredicate::operator()):
        (WebCore::FileThread::removeTask):
        (WebCore::FileThread::fileThreadStart):
        (WebCore::FileThread::runLoop):
        * html/FileThread.h: Added.
        (WebCore::FileThread::create):
        (WebCore::FileThread::Task::Task):
        (WebCore::FileThread::Task::~Task):
        (WebCore::FileThread::Task::fileHandle):
        * platform/Logging.cpp:
        (WebCore::):
        (WebCore::getChannelFromName):
        * platform/Logging.h:
2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>

        Reviewed by Dmitry Titov.

        Add FileThread for async file operation support in FileReader and FileWriter
        https://bugs.webkit.org/show_bug.cgi?id=36896

        Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.

        * features.gypi:
2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>

        Reviewed by Dmitry Titov.

        Add FileThread for async file operation support in FileReader and FileWriter
        https://bugs.webkit.org/show_bug.cgi?id=36896

        Add FILE_READER or FILE_WRITER feature defines.

        * Configurations/FeatureDefines.xcconfig:
2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>

        Reviewed by Dmitry Titov.

        Add FileThread for async file operation support in FileReader and FileWriter
        https://bugs.webkit.org/show_bug.cgi?id=36896

        Adds ENABLE_FILE_READER and ENABLE_FILE_WRITER feature flags
        for FileReader and FileWriter support.

        * win/tools/vsprops/FeatureDefines.vsprops:
        * win/tools/vsprops/FeatureDefinesCairo.vsprops:
2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>

        Reviewed by Dmitry Titov.

        Add FileThread for async file operation support in FileReader and FileWriter
        https://bugs.webkit.org/show_bug.cgi?id=36896

        Add options to enable FILE_READER and FILE_WRITER support.

        * Scripts/build-webkit:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@56968 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
ChangeLog
JavaScriptCore/ChangeLog
JavaScriptCore/Configurations/FeatureDefines.xcconfig
WebCore/ChangeLog
WebCore/Configurations/FeatureDefines.xcconfig
WebCore/GNUmakefile.am
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/dom/ScriptExecutionContext.cpp
WebCore/dom/ScriptExecutionContext.h
WebCore/html/FileThread.cpp [new file with mode: 0644]
WebCore/html/FileThread.h [new file with mode: 0644]
WebCore/platform/Logging.cpp
WebCore/platform/Logging.h
WebKit/chromium/ChangeLog
WebKit/chromium/features.gypi
WebKit/mac/ChangeLog
WebKit/mac/Configurations/FeatureDefines.xcconfig
WebKitLibraries/ChangeLog
WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
WebKitTools/ChangeLog
WebKitTools/Scripts/build-webkit
configure.ac

index 5828c2d..493e608 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add EANBEL_FILE_READER and ENABLE_FILE_WRITER flags.
+
+        * configure.ac:
+
 2010-04-01  Ojan Vafai  <ojan@chromium.org>
 
         Reviewed by Adam Barth.
index 524c5b3..295b08b 100644 (file)
@@ -1,3 +1,14 @@
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2010-03-31  Gavin Barraclough  <barraclough@apple.com>
 
         Reviewed by NOBODY (windows build fix pt II).
index 95642c0..92ca4ab 100644 (file)
@@ -50,6 +50,8 @@ ENABLE_DATALIST = ENABLE_DATALIST;
 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
 ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
 ENABLE_FILTERS = ENABLE_FILTERS;
+ENABLE_FILE_READER = ;
+ENABLE_FILE_WRITER = ;
 ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
 ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
 ENABLE_INDEXED_DATABASE = ;
@@ -75,4 +77,4 @@ ENABLE_XHTMLMP = ;
 ENABLE_XPATH = ENABLE_XPATH;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
index 88445bb..47bf431 100644 (file)
@@ -1,3 +1,48 @@
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add FileThread for async file operation support for FileReader and
+        FileWriter.  The patch also adds ENABLE_FILE_READER or
+        ENABLE_FILE_WRITER build flags/defines.  Both flags are disabled
+        by default.
+
+        No new tests, will add ones when after adding modules which use the thread.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
+        (WebCore::ScriptExecutionContext::fileThread):
+        * dom/ScriptExecutionContext.h:
+        * html/FileThread.cpp: Added.
+        (WebCore::FileThread::FileThread):
+        (WebCore::FileThread::~FileThread):
+        (WebCore::FileThread::start):
+        (WebCore::FileThread::stop):
+        (WebCore::FileThread::postTask):
+        (WebCore::SameFilePredicate::SameFilePredicate):
+        (WebCore::SameFilePredicate::operator()):
+        (WebCore::FileThread::removeTask):
+        (WebCore::FileThread::fileThreadStart):
+        (WebCore::FileThread::runLoop):
+        * html/FileThread.h: Added.
+        (WebCore::FileThread::create):
+        (WebCore::FileThread::Task::Task):
+        (WebCore::FileThread::Task::~Task):
+        (WebCore::FileThread::Task::fileHandle):
+        * platform/Logging.cpp:
+        (WebCore::):
+        (WebCore::getChannelFromName):
+        * platform/Logging.h:
+
 2010-04-01  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed. Rollout of http://trac.webkit.org/changeset/56930
index 95642c0..92ca4ab 100644 (file)
@@ -50,6 +50,8 @@ ENABLE_DATALIST = ENABLE_DATALIST;
 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
 ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
 ENABLE_FILTERS = ENABLE_FILTERS;
+ENABLE_FILE_READER = ;
+ENABLE_FILE_WRITER = ;
 ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
 ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
 ENABLE_INDEXED_DATABASE = ;
@@ -75,4 +77,4 @@ ENABLE_XHTMLMP = ;
 ENABLE_XPATH = ENABLE_XPATH;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
index b771862..d72b232 100644 (file)
@@ -1021,6 +1021,8 @@ webcore_sources += \
        WebCore/html/File.h \
        WebCore/html/FileList.cpp \
        WebCore/html/FileList.h \
+       WebCore/html/FileThread.cpp \
+       WebCore/html/FileThread.h \
        WebCore/html/FormDataList.cpp \
        WebCore/html/FormDataList.h \
        WebCore/html/HTMLAllCollection.cpp \
@@ -3558,6 +3560,21 @@ FEATURE_DEFINES += ENABLE_BLOB_SLICE=1
 webcore_cppflags += -DENABLE_BLOB_SLICE=1
 endif  # END ENABLE_BLOB_SLICE
 
+# ---
+# FileReader support
+# ---
+if ENABLE_FILE_READER
+FEATURE_DEFINES += ENABLE_FILE_READER=1
+webcore_cppflags += -DENABLE_FILE_READER=1
+endif  # END ENABLE_FILE_READER
+
+# ---
+# FileWriter support
+# ---
+if ENABLE_FILE_WRITER
+FEATURE_DEFINES += ENABLE_FILE_WRITER=1
+webcore_cppflags += -DENABLE_FILE_WRITER=1
+endif  # END ENABLE_FILE_WRITER
 
 DerivedSources/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl
        if sort $(WEBCORE_CSS_PROPERTY_NAMES) | uniq -d | grep -E '^[^#]'; then echo 'Duplicate value!'; exit 1; fi
index 214c7f0..9a5b7a7 100644 (file)
             'html/File.h',
             'html/FileList.cpp',
             'html/FileList.h',
+            'html/FileThread.cpp',
+            'html/FileThread.h',
             'html/FormDataList.cpp',
             'html/FormDataList.h',
             'html/HTMLAllCollection.cpp',
index fcf0a48..eaf97a9 100644 (file)
@@ -612,6 +612,7 @@ SOURCES += \
     html/DOMFormData.cpp \
     html/File.cpp \
     html/FileList.cpp \
+    html/FileThread.cpp \
     html/FormDataList.cpp \
     html/HTMLAllCollection.cpp \
     html/HTMLAnchorElement.cpp \
@@ -1318,6 +1319,7 @@ HEADERS += \
     html/DOMFormData.h \
     html/File.h \
     html/FileList.h \
+    html/FileThread.h \
     html/FormDataList.h \
     html/HTMLAllCollection.h \
     html/HTMLAnchorElement.h \
index 7f89868..8b5ee9b 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\html\FileThread.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\html\FileThread.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\html\FormDataList.cpp"\r
                                >\r
                        </File>\r
index 44910fc..35335ab 100644 (file)
                85F74E0A0AA8DF8C000DC284 /* DOMCSSUnknownRule.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85032DD50AA8C9BE007D3B7D /* DOMCSSUnknownRule.h */; };
                85FF315A0AAFBFCB00374F38 /* DOMKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */; };
                85FF315B0AAFBFCB00374F38 /* DOMKeyboardEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */; };
+               8952535211641B3400CABF00 /* FileThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8952535011641B3400CABF00 /* FileThread.cpp */; };
+               8952535311641B3400CABF00 /* FileThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 8952535111641B3400CABF00 /* FileThread.h */; };
                9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; };
                9302B0BF0D79F82C00C7EE83 /* PageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9305B24D098F1B6B00C28855 /* Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9305B24C098F1B6B00C28855 /* Timer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                85F56A790A98CE3700ADB60A /* DOMProcessingInstruction.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMProcessingInstruction.mm; sourceTree = "<group>"; };
                85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMKeyboardEvent.h; sourceTree = "<group>"; };
                85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMKeyboardEvent.mm; sourceTree = "<group>"; };
+               8952535011641B3400CABF00 /* FileThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileThread.cpp; sourceTree = "<group>"; };
+               8952535111641B3400CABF00 /* FileThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileThread.h; sourceTree = "<group>"; };
                9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
                9302B0BE0D79F82C00C7EE83 /* PageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroup.h; sourceTree = "<group>"; };
                9305B24C098F1B6B00C28855 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = "<group>"; };
                93EEC1EC09C2877700C515D1 /* html */ = {
                        isa = PBXGroup;
                        children = (
+                               8952535011641B3400CABF00 /* FileThread.cpp */,
+                               8952535111641B3400CABF00 /* FileThread.h */,
                                A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */,
                                A43BF5971149290A00C643CA /* HTMLProgressElement.h */,
                                49484FAE102CF01E00187DD3 /* canvas */,
                                E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */,
                                8499A515115FB33000F566E3 /* RenderSVGResourceMarker.h in Headers */,
                                2E3BBF081162DA1100B9409A /* UUID.h in Headers */,
+                               8952535311641B3400CABF00 /* FileThread.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                E4778B7F115A581A00B5D372 /* JSCustomEvent.cpp in Sources */,
                                8499A514115FB33000F566E3 /* RenderSVGResourceMarker.cpp in Sources */,
                                2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */,
+                               8952535211641B3400CABF00 /* FileThread.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index c2fe120..226aad8 100644 (file)
@@ -31,6 +31,9 @@
 #include "Database.h"
 #include "DatabaseTask.h"
 #include "DatabaseThread.h"
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+#include "FileThread.h"
+#endif
 #include "MessagePort.h"
 #include "SecurityOrigin.h"
 #include "WorkerContext.h"
@@ -83,6 +86,12 @@ ScriptExecutionContext::~ScriptExecutionContext()
         m_databaseThread = 0;
     }
 #endif
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+    if (m_fileThread) {
+        m_fileThread->stop();
+        m_fileThread = 0;
+    }
+#endif
 }
 
 #if ENABLE(DATABASE)
@@ -261,6 +270,18 @@ DOMTimer* ScriptExecutionContext::findTimeout(int timeoutId)
     return m_timeouts.get(timeoutId);
 }
 
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+FileThread* ScriptExecutionContext::fileThread()
+{
+    if (!m_fileThread) {
+        m_fileThread = FileThread::create();
+        if (!m_fileThread->start())
+            m_fileThread = 0;
+    }
+    return m_fileThread.get();
+}
+#endif
+
 ScriptExecutionContext::Task::~Task()
 {
 }
index f1c79cf..bd16db2 100644 (file)
@@ -45,6 +45,9 @@ namespace WebCore {
     class DatabaseThread;
 #endif
     class DOMTimer;
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+    class FileThread;
+#endif
     class MessagePort;
     class SecurityOrigin;
     class ScriptString;
@@ -136,6 +139,11 @@ namespace WebCore {
         JSC::JSGlobalData* globalData();
 #endif
 
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+        FileThread* fileThread();
+        void stopFileThread();
+#endif
+
     protected:
         // Explicitly override the security origin for this script context.
         // Note: It is dangerous to change the security origin of a script context
@@ -163,6 +171,10 @@ namespace WebCore {
         typedef HashSet<Database* > DatabaseSet;
         OwnPtr<DatabaseSet> m_openDatabaseSet;
 #endif
+
+#if ENABLE(FILE_READER) || ENABLE(FILE_WRITER)
+        RefPtr<FileThread> m_fileThread;
+#endif
     };
 
 } // namespace WebCore
diff --git a/WebCore/html/FileThread.cpp b/WebCore/html/FileThread.cpp
new file mode 100644 (file)
index 0000000..90b66e8
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * 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) || ENABLE(FILE_READER)
+
+#include "FileThread.h"
+
+#include "AutodrainedPool.h"
+#include "Logging.h"
+
+namespace WebCore {
+
+FileThread::FileThread()
+    : m_threadID(0)
+{
+    m_selfRef = this;
+}
+
+FileThread::~FileThread()
+{
+    ASSERT(m_queue.killed());
+}
+
+bool FileThread::start()
+{
+    MutexLocker lock(m_threadCreationMutex);
+    if (m_threadID)
+        return true;
+    m_threadID = createThread(FileThread::fileThreadStart, this, "WebCore: File");
+    return m_threadID;
+}
+
+void FileThread::stop()
+{
+    return m_queue.kill();
+}
+
+void FileThread::postTask(PassOwnPtr<Task> task)
+{
+    m_queue.append(task);
+}
+
+class SameFilePredicate {
+public:
+    SameFilePredicate(const PlatformFileHandle handle) : m_handle(handle) { }
+    bool operator()(FileThread::Task* task) const { return task->fileHandle() == m_handle; }
+private:
+    PlatformFileHandle m_handle;
+};
+
+void FileThread::removeTask(PlatformFileHandle handle)
+{
+    SameFilePredicate predicate(handle);
+    m_queue.removeIf(predicate);
+}
+
+void* FileThread::fileThreadStart(void* arg)
+{
+    FileThread* fileThread = static_cast<FileThread*>(arg);
+    return fileThread->runLoop();
+}
+
+void* FileThread::runLoop()
+{
+    {
+        // Wait for FileThread::start() to complete to have m_threadID
+        // established before starting the main loop.
+        MutexLocker lock(m_threadCreationMutex);
+        LOG(FileAPI, "Started FileThread %p", this);
+    }
+
+    AutodrainedPool pool;
+    while (OwnPtr<Task> task = m_queue.waitForMessage()) {
+        task->performTask();
+        pool.cycle();
+    }
+
+    LOG(FileAPI, "About to detach thread %i and clear the ref to FileThread %p, which currently has %i ref(s)", m_threadID, this, refCount());
+
+    detachThread(m_threadID);
+
+    // Clear the self refptr, possibly resulting in deletion
+    m_selfRef = 0;
+
+    return 0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_WRITER) || ENABLE(FILE_READER)
diff --git a/WebCore/html/FileThread.h b/WebCore/html/FileThread.h
new file mode 100644 (file)
index 0000000..ea93cc3
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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 FileThread_h
+#define FileThread_h
+
+#if ENABLE(FILE_WRITER) || ENABLE(FILE_READER)
+
+#include "FileSystem.h"
+#include <wtf/MessageQueue.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+class FileThread : public ThreadSafeShared<FileThread> {
+public:
+    static PassRefPtr<FileThread> create() { return adoptRef(new FileThread()); }
+    ~FileThread();
+
+    bool start();
+    void stop();
+
+    class Task : public Noncopyable {
+    public:
+        virtual ~Task() { }
+        virtual void performTask() = 0;
+        PlatformFileHandle fileHandle() const { return m_handle; }
+    protected:
+        Task(PlatformFileHandle handle) : m_handle(handle) { }
+        const PlatformFileHandle m_handle;
+    };
+
+    void postTask(PassOwnPtr<Task> task);
+    void removeTask(PlatformFileHandle);
+
+private:
+    FileThread();
+
+    static void* fileThreadStart(void*);
+    void* runLoop();
+
+    ThreadIdentifier m_threadID;
+    RefPtr<FileThread> m_selfRef;
+    MessageQueue<Task> m_queue;
+
+    Mutex m_threadCreationMutex;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_WRITER) || ENABLE(FILE_READER)
+
+#endif // FileThread_h
index 92e11e3..7fb15b1 100644 (file)
@@ -20,7 +20,7 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -60,6 +60,7 @@ WTFLogChannel LogMedia =             { 0x01000000, "WebCoreLogLevel", WTFLogChan
 WTFLogChannel LogPlugins =           { 0x02000000, "WebCoreLogLevel", WTFLogChannelOff };
 WTFLogChannel LogArchives =          { 0x04000000, "WebCoreLogLevel", WTFLogChannelOff };
 WTFLogChannel LogProgress =          { 0x08000000, "WebCoreLogLevel", WTFLogChannelOff };
+WTFLogChannel LogFileAPI =           { 0x10000000, "WebCoreLogLevel", WTFLogChannelOff };
 
 WTFLogChannel* getChannelFromName(const String& channelName)
 {
@@ -113,7 +114,7 @@ WTFLogChannel* getChannelFromName(const String& channelName)
 
     if (equalIgnoringCase(channelName, String("Progress")))
         return &LogProgress;
-        
+
     if (equalIgnoringCase(channelName, String("SpellingAndGrammar")))
         return &LogSpellingAndGrammar;
 
@@ -129,6 +130,9 @@ WTFLogChannel* getChannelFromName(const String& channelName)
     if (equalIgnoringCase(channelName, String("Threading")))
         return &LogThreading;
 
+    if (equalIgnoringCase(channelName, String("FileAPI")))
+        return &LogFileAPI;
+
     return 0;
 }
 
index c0c41c1..45b6d23 100644 (file)
@@ -58,6 +58,7 @@ namespace WebCore {
     extern WTFLogChannel LogPlugins;
     extern WTFLogChannel LogArchives;
     extern WTFLogChannel LogProgress;
+    extern WTFLogChannel LogFileAPI;
 
     void InitializeLoggingChannelsIfNecessary();
     WTFLogChannel* getChannelFromName(const String& channelName);
index 52eb3d6..194a205 100644 (file)
@@ -1,3 +1,14 @@
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add ENABLE_FILE_READER and ENABLE_FILE_WRITER flags.
+
+        * features.gypi:
+
 2010-04-01  Finnur Thorarinsson  <finnur.webkit@gmail.com>
 
         Reviewed by Eric Seidel.
index 252a176..7146685 100644 (file)
@@ -47,6 +47,8 @@
         'ENABLE_OFFLINE_WEB_APPLICATIONS=1',
         'ENABLE_DASHBOARD_SUPPORT=0',
         'ENABLE_DOM_STORAGE=1',
+        'ENABLE_FILE_READER=0',
+        'ENABLE_FILE_WRITER=0',
         'ENABLE_GEOLOCATION=1',
         'ENABLE_JAVASCRIPT_DEBUGGER=1',
         'ENABLE_JSC_MULTIPLE_THREADS=0',
index f7f5e19..45c5a2d 100644 (file)
@@ -1,3 +1,14 @@
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add FILE_READER or FILE_WRITER feature defines.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2010-04-01  Ada Chan  <adachan@apple.com>
 
         Reviewed by Darin Adler.
index 95642c0..92ca4ab 100644 (file)
@@ -50,6 +50,8 @@ ENABLE_DATALIST = ENABLE_DATALIST;
 ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
 ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
 ENABLE_FILTERS = ENABLE_FILTERS;
+ENABLE_FILE_READER = ;
+ENABLE_FILE_WRITER = ;
 ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
 ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
 ENABLE_INDEXED_DATABASE = ;
@@ -75,4 +77,4 @@ ENABLE_XHTMLMP = ;
 ENABLE_XPATH = ENABLE_XPATH;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
index 270e8a3..bd0ab54 100644 (file)
@@ -1,3 +1,16 @@
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Adds ENABLE_FILE_READER and ENABLE_FILE_WRITER feature flags
+        for FileReader and FileWriter support.
+
+        * win/tools/vsprops/FeatureDefines.vsprops:
+        * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
 2010-03-25  Mark Rowe  <mrowe@apple.com>
 
         Rubber-stamped by Dan Bernstein.
index 45dacbc..2184f46 100644 (file)
@@ -9,7 +9,7 @@
        >
   <Tool
                Name="VCCLCompilerTool"
-               PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+               PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
        />
   <UserMacro
                Name="ENABLE_3D_CANVAS"
                PerformEnvironmentSet="true"
        />
   <UserMacro
+               Name="ENABLE_FILE_READER"
+               Value=""
+               PerformEnvironmentSet="true"
+       />
+  <UserMacro
+               Name="ENABLE_FILE_WRITER"
+               Value=""
+               PerformEnvironmentSet="true"
+       />
+  <UserMacro
                Name="ENABLE_GEOLOCATION"
                Value="ENABLE_GEOLOCATION"
                PerformEnvironmentSet="true"
index e737ffa..14644d4 100644 (file)
@@ -9,7 +9,7 @@
        >
   <Tool
                Name="VCCLCompilerTool"
-               PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+               PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
        />
   <UserMacro
                Name="ENABLE_3D_CANVAS"
                PerformEnvironmentSet="true"
        />
   <UserMacro
+               Name="ENABLE_FILE_READER"
+               Value=""
+               PerformEnvironmentSet="true"
+       />
+  <UserMacro
+               Name="ENABLE_FILE_WRITER"
+               Value=""
+               PerformEnvironmentSet="true"
+       />
+  <UserMacro
                Name="ENABLE_GEOLOCATION"
                Value=""
                PerformEnvironmentSet="true"
index a9f0d4b..ab37c5e 100644 (file)
@@ -1,3 +1,14 @@
+2010-04-01  Kinuko Yasuda  <kinuko@chromium.org>
+
+        Reviewed by Dmitry Titov.
+
+        Add FileThread for async file operation support in FileReader and FileWriter
+        https://bugs.webkit.org/show_bug.cgi?id=36896
+
+        Add options to enable FILE_READER and FILE_WRITER support.
+
+        * Scripts/build-webkit:
+
 2010-04-01  Kent Tamura  <tkent@chromium.org>
 
         Unreviewed. Add missing license header.
index f866188..234096c 100755 (executable)
@@ -56,7 +56,8 @@ my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $cl
     $javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $systemMallocSupport, $sandboxSupport, $sharedWorkersSupport,
     $svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport,
     $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport,
-    $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport, $blobSliceSupport, $tiledBackingStoreSupport);
+    $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport, $blobSliceSupport, $tiledBackingStoreSupport,
+    $fileReaderSupport, $fileWriterSupport);
 
 my @features = (
     { option => "3d-canvas", desc => "Toggle 3D canvas support",
@@ -175,6 +176,12 @@ my @features = (
 
     { option => "xslt", desc => "Toggle XSLT support",
       define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
+
+    { option => "file-reader", desc => "Toggle FileReader support",
+      define => "ENABLE_FILE_READER", default => 0, value => \$fileReaderSupport },
+
+    { option => "file-writer", desc => "Toggle FileWriter support",
+      define => "ENABLE_FILE_WRITER", default => 0, value => \$fileWriterSupport },
 );
 
 # Update defaults from Qt's project file
index 5bc1781..22bd545 100644 (file)
@@ -569,6 +569,22 @@ AC_ARG_ENABLE(fast_mobile_scrolling,
               [],[enable_fast_mobile_scrolling="no"])
 AC_MSG_RESULT([$enable_fast_mobile_scrolling])
 
+# check whether to enable FileReader support
+AC_MSG_CHECKING([whether to enable FileReader support])
+AC_ARG_ENABLE(file_reader,
+              AC_HELP_STRING([--enable-file-reader],
+                             [enable support for FileReader [default=no]]),
+              [],[enable_file_reader="no"])
+AC_MSG_RESULT([$enable_file_reader])
+
+# check whether to enable FileWriter support
+AC_MSG_CHECKING([whether to enable FileWriter support])
+AC_ARG_ENABLE(file_writer,
+              AC_HELP_STRING([--enable-file-writer],
+                             [enable support for FileWriter [default=no]]),
+              [],[enable_file_writer="no"])
+AC_MSG_RESULT([$enable_file_writer])
+
 # check whether to enable code coverage
 AC_MSG_CHECKING([whether to enable code coverage support])
 AC_ARG_ENABLE(coverage,
@@ -807,6 +823,8 @@ AM_CONDITIONAL([ENABLE_XHTMLMP],[test "$enable_xhtmlmp" = "yes"])
 AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
 AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"])
+AM_CONDITIONAL([ENABLE_FILE_READER],[test "$enable_file_reader" = "yes"])
+AM_CONDITIONAL([ENABLE_FILE_WRITER],[test "$enable_file_writer" = "yes"])
 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
 AM_CONDITIONAL([ENABLE_MATHML], [test "$enable_mathml" = "yes"])
 AM_CONDITIONAL([ENABLE_RUBY],[test "$enable_ruby" = "yes"])
@@ -860,6 +878,8 @@ Features:
  Fast Mobile Scrolling                                    : $enable_fast_mobile_scrolling
  JIT compilation                                          : $enable_jit
  Filters support                                          : $enable_filters
+ FileReader support                                       : $enable_file_reader
+ FileWriter support                                       : $enable_file_writer
  Geolocation support                                      : $enable_geolocation
  JavaScript debugger/profiler support                     : $enable_javascript_debugger
  MathML support                                           : $enable_mathml