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

jianli at chromium.org jianli at chromium.org
Wed Dec 22 12:49:39 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f3b91d692f389464a2171a0e2433a12b6b6ee1a1
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 31 07:06:30 2010 +0000

    Support FileReaderSync in workers.
    https://bugs.webkit.org/show_bug.cgi?id=44657
    
    Reviewed by David Levin.
    
    WebCore:
    
    Also add FileException interface and make Blob/File/FileError useable in
    workers.
    
    Tests: fast/files/workers/worker-read-blob-async.html
           fast/files/workers/worker-read-blob-sync.html
           fast/files/workers/worker-read-file-async.html
           fast/files/workers/worker-read-file-sync.html
    
    * DerivedSources.cpp:
    * DerivedSources.make:
    * WebCore.gypi:
    * WebCore.pro:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * fileapi/Blob.idl: Added NoStaticTables attribute.
    * fileapi/File.idl: Added NoStaticTables attribute.
    * fileapi/FileError.idl: Added NoStaticTables attribute.
    * fileapi/FileException.h: Added.
    * fileapi/FileException.idl: Added.
    * fileapi/FileReaderSync.cpp: Added.
    * fileapi/FileReaderSync.h: Added.
    * fileapi/FileReaderSync.idl: Added.
    * workers/WorkerContext.idl: Expose FileReaderSync and BlodBuilder in workers.
    
    LayoutTests:
    
    Added 4 test files to test FileReaderSync in workers.
    
    * fast/files/read-blob-async.html:
    * fast/files/read-file-async.html:
    * fast/files/resources/read-common.js:
    (readBlobAsBinaryString):
    (readBlobAsText):
    (readBlobAsDataURL):
    (_readBlobAsBinaryStringAsync):
    (_readBlobAsTextAsync):
    (_readBlobAsDataURLAsync):
    (_readBlobAsBinaryStringSync):
    (_readBlobAsTextSync):
    (_readBlobAsDataURLSync):
    (createReaderSync):
    * fast/files/resources/read-blob-test-cases.js:
    (runNextTest):
    * fast/files/resources/read-file-test-cases.js:
    (runNextTest):
    (testMultipleReads):
    * fast/files/resources/setup-for-read-common.js:
    (log):
    (startWorker.worker.onmessage):
    (startWorker.worker.onerror):
    (startWorker):
    * fast/files/workers/resources/worker-read-blob-async.js: Added.
    * fast/files/workers/resources/worker-read-blob-sync.js: Added.
    * fast/files/workers/resources/worker-read-common.js: Added.
    * fast/files/workers/resources/worker-read-file-async.js: Added.
    * fast/files/workers/resources/worker-read-file-sync.js: Added.
    * fast/files/workers/worker-read-blob-async-expected.txt: Added.
    * fast/files/workers/worker-read-blob-async.html: Added.
    * fast/files/workers/worker-read-blob-sync-expected.txt: Added.
    * fast/files/workers/worker-read-blob-sync.html: Added.
    * fast/files/workers/worker-read-file-async-expected.txt: Added.
    * fast/files/workers/worker-read-file-async.html: Added.
    * fast/files/workers/worker-read-file-sync-expected.txt: Added.
    * fast/files/workers/worker-read-file-sync.html: Added.
    * platform/chromium/test_expectations.txt:
    * platform/gtk/Skipped:
    * platform/mac-wk2/Skipped:
    * platform/qt/Skipped:
    * platform/win/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66461 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ce10d84..7f060b8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,54 @@
+2010-08-31  Jian Li  <jianli at chromium.org>
+
+        Reviewed by David Levin.
+
+        Support FileReaderSync in workers.
+        https://bugs.webkit.org/show_bug.cgi?id=44657
+
+        Added 4 test files to test FileReaderSync in workers.
+
+        * fast/files/read-blob-async.html:
+        * fast/files/read-file-async.html:
+        * fast/files/resources/read-common.js:
+        (readBlobAsBinaryString):
+        (readBlobAsText):
+        (readBlobAsDataURL):
+        (_readBlobAsBinaryStringAsync):
+        (_readBlobAsTextAsync):
+        (_readBlobAsDataURLAsync):
+        (_readBlobAsBinaryStringSync):
+        (_readBlobAsTextSync):
+        (_readBlobAsDataURLSync):
+        (createReaderSync):
+        * fast/files/resources/read-blob-test-cases.js:
+        (runNextTest):
+        * fast/files/resources/read-file-test-cases.js:
+        (runNextTest):
+        (testMultipleReads):
+        * fast/files/resources/setup-for-read-common.js:
+        (log):
+        (startWorker.worker.onmessage):
+        (startWorker.worker.onerror):
+        (startWorker):
+        * fast/files/workers/resources/worker-read-blob-async.js: Added.
+        * fast/files/workers/resources/worker-read-blob-sync.js: Added.
+        * fast/files/workers/resources/worker-read-common.js: Added.
+        * fast/files/workers/resources/worker-read-file-async.js: Added.
+        * fast/files/workers/resources/worker-read-file-sync.js: Added.
+        * fast/files/workers/worker-read-blob-async-expected.txt: Added.
+        * fast/files/workers/worker-read-blob-async.html: Added.
+        * fast/files/workers/worker-read-blob-sync-expected.txt: Added.
+        * fast/files/workers/worker-read-blob-sync.html: Added.
+        * fast/files/workers/worker-read-file-async-expected.txt: Added.
+        * fast/files/workers/worker-read-file-async.html: Added.
+        * fast/files/workers/worker-read-file-sync-expected.txt: Added.
+        * fast/files/workers/worker-read-file-sync.html: Added.
+        * platform/chromium/test_expectations.txt:
+        * platform/gtk/Skipped:
+        * platform/mac-wk2/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2010-08-30  Mihai Parparita  <mihaip at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/files/read-blob-async.html b/LayoutTests/fast/files/read-blob-async.html
index 8070123..6d2670a 100644
--- a/LayoutTests/fast/files/read-blob-async.html
+++ b/LayoutTests/fast/files/read-blob-async.html
@@ -16,6 +16,11 @@ var testFileInfoList = [
     { 'name': 'file3', 'path': 'resources/UTF8-3.txt' },
 ];
 
+function isReadAsAsync()
+{
+    return true;
+}
+
 function startTest(testFiles)
 {
     runNextTest(testFiles);
diff --git a/LayoutTests/fast/files/read-file-async.html b/LayoutTests/fast/files/read-file-async.html
index c614dfd..58a4a07 100644
--- a/LayoutTests/fast/files/read-file-async.html
+++ b/LayoutTests/fast/files/read-file-async.html
@@ -19,6 +19,11 @@ var testFileInfoList = [
     { 'name': 'binary-file', 'path': 'resources/binary-file' },
 ];
 
+function isReadAsAsync()
+{
+    return true;
+}
+
 function startTest(testFiles)
 {
     runNextTest(testFiles);
diff --git a/LayoutTests/fast/files/resources/read-blob-test-cases.js b/LayoutTests/fast/files/resources/read-blob-test-cases.js
index c14fa4e..7550c27 100644
--- a/LayoutTests/fast/files/resources/read-blob-test-cases.js
+++ b/LayoutTests/fast/files/resources/read-blob-test-cases.js
@@ -23,8 +23,6 @@ function runNextTest(testFiles)
         self[testCases[testIndex - 1]](testFiles);
     } else {
         log("DONE");
-        if (window && window.layoutTestController)
-            layoutTestController.notifyDone();
     }
 }
 
diff --git a/LayoutTests/fast/files/resources/read-common.js b/LayoutTests/fast/files/resources/read-common.js
index e5d27f3..03bcb6f 100644
--- a/LayoutTests/fast/files/resources/read-common.js
+++ b/LayoutTests/fast/files/resources/read-common.js
@@ -9,25 +9,92 @@ function buildBlob(items, builder)
     return builder.getBlob();
 }
 
+// Reads a blob either asynchronously or synchronously.
 function readBlobAsBinaryString(testFiles, blob)
 {
-    var reader = createReader(testFiles);
-    reader.readAsBinaryString(blob)
+    if (isReadAsAsync())
+        _readBlobAsBinaryStringAsync(testFiles, blob);
+    else
+        _readBlobAsBinaryStringSync(testFiles, blob);
 }
 
 function readBlobAsText(testFiles, blob, encoding)
 {
-    var reader = createReader(testFiles);
-    reader.readAsText(blob, encoding)
+    if (isReadAsAsync())
+        _readBlobAsTextAsync(testFiles, blob, encoding);
+    else
+        _readBlobAsTextSync(testFiles, blob, encoding);
 }
 
 function readBlobAsDataURL(testFiles, blob)
 {
-    var reader = createReader(testFiles);
+    if (isReadAsAsync())
+        _readBlobAsDataURLAsync(testFiles, blob);
+    else
+        _readBlobAsDataURLSync(testFiles, blob);
+}
+
+// Reads a blob asynchronously.
+function _readBlobAsBinaryStringAsync(testFiles, blob)
+{
+    var reader = createReaderAsync(testFiles);
+    reader.readAsBinaryString(blob)
+}
+
+function _readBlobAsTextAsync(testFiles, blob, encoding)
+{
+    var reader = createReaderAsync(testFiles);
+    reader.readAsText(blob, encoding)
+}
+
+function _readBlobAsDataURLAsync(testFiles, blob)
+{
+    var reader = createReaderAsync(testFiles);
     reader.readAsDataURL(blob)
 }
 
-function createReader(testFiles)
+// Reads a blob synchronously.
+function _readBlobAsBinaryStringSync(testFiles, blob)
+{
+    var reader = createReaderSync();
+    try {
+        var result = reader.readAsBinaryString(blob);
+        log(result);
+    } catch (error) {
+        log("Received exception " + error.code + ": " + error.name);
+    }
+
+    runNextTest(testFiles);
+}
+
+function _readBlobAsTextSync(testFiles, blob, encoding)
+{
+    var reader = createReaderSync();
+    try {
+        var result = reader.readAsText(blob, encoding);
+        log(result);
+    } catch (error) {
+        log("Received exception " + error.code + ": " + error.name);
+    }
+
+    runNextTest(testFiles);
+}
+
+function _readBlobAsDataURLSync(testFiles, blob)
+{
+    var reader = createReaderSync();
+    try {
+        var result = reader.readAsDataURL(blob);
+        log(result);
+    } catch (error) {
+        log("Received exception " + error.code + ": " + error.name);
+    }
+
+    runNextTest(testFiles);
+}
+
+// Creates a reader for asynchronous reading.
+function createReaderAsync(testFiles)
 {
     var reader = new FileReader();
 
@@ -41,6 +108,12 @@ function createReader(testFiles)
     return reader;
 }
 
+// Creates a reader for synchronous reading.
+function createReaderSync()
+{
+    return new FileReaderSync();
+}
+
 function logEvent(event)
 {
     log("Received " + event.type + " event");
diff --git a/LayoutTests/fast/files/resources/read-file-test-cases.js b/LayoutTests/fast/files/resources/read-file-test-cases.js
index 519db41..e8b2c9c 100644
--- a/LayoutTests/fast/files/resources/read-file-test-cases.js
+++ b/LayoutTests/fast/files/resources/read-file-test-cases.js
@@ -26,8 +26,6 @@ function runNextTest(testFiles)
         self[testCases[testIndex - 1]](testFiles);
     } else {
         log("DONE");
-        if (window && window.layoutTestController)
-            layoutTestController.notifyDone();
     }
 }
 
@@ -129,8 +127,14 @@ function testReadingUTF8EncodedFileAsDataURL(testFiles)
 
 function testMultipleReads(testFiles)
 {
+    // This test case is only available for async reading.
+    if (!isReadAsAsync()) {
+        runNextTest(testFiles);
+        return;
+    }
+
     log("Test calling multiple read methods and only last one is processed");
-    var reader = createReader();
+    var reader = createReaderAsync();
     reader.readAsBinaryString(testFiles['UTF8-file']);
     reader.readAsText(testFiles['UTF8-file']);
     reader.readAsDataURL(testFiles['UTF8-file']);
diff --git a/LayoutTests/fast/files/resources/setup-for-read-common.js b/LayoutTests/fast/files/resources/setup-for-read-common.js
index 6398a7c..9cbc2b4 100644
--- a/LayoutTests/fast/files/resources/setup-for-read-common.js
+++ b/LayoutTests/fast/files/resources/setup-for-read-common.js
@@ -1,6 +1,10 @@
 function log(message)
 {
     document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
+    if (message == "DONE") {
+        if (window && window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
 }
 
 function onInputFileChange(testFileInfoList)
@@ -20,3 +24,23 @@ function runTests(testFileInfoList)
     eventSender.mouseMoveTo(10, 10);
     eventSender.mouseUp();
 }
+
+function startWorker(testFiles, workerScriptURL)
+{
+    var worker = new Worker(workerScriptURL);
+    worker.onmessage = function(event)
+    {
+        log(event.data);
+        if (event.data == "DONE") {
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }
+    }
+    worker.onerror = function(event)
+    {
+        log("Received error from worker: " + event.message);
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+    worker.postMessage(testFiles);
+}
diff --git a/LayoutTests/fast/files/workers/resources/worker-read-blob-async.js b/LayoutTests/fast/files/workers/resources/worker-read-blob-async.js
new file mode 100644
index 0000000..4955192
--- /dev/null
+++ b/LayoutTests/fast/files/workers/resources/worker-read-blob-async.js
@@ -0,0 +1,7 @@
+importScripts("../../resources/read-common.js", "../../resources/read-blob-test-cases.js", "worker-read-common.js");
+
+function isReadAsAsync()
+{
+    return true;
+}
+
diff --git a/LayoutTests/fast/files/workers/resources/worker-read-blob-sync.js b/LayoutTests/fast/files/workers/resources/worker-read-blob-sync.js
new file mode 100644
index 0000000..1e9e6a5
--- /dev/null
+++ b/LayoutTests/fast/files/workers/resources/worker-read-blob-sync.js
@@ -0,0 +1,6 @@
+importScripts("../../resources/read-common.js", "../../resources/read-blob-test-cases.js", "worker-read-common.js");
+
+function isReadAsAsync()
+{
+    return false;
+}
diff --git a/LayoutTests/fast/files/workers/resources/worker-read-common.js b/LayoutTests/fast/files/workers/resources/worker-read-common.js
new file mode 100644
index 0000000..e708192
--- /dev/null
+++ b/LayoutTests/fast/files/workers/resources/worker-read-common.js
@@ -0,0 +1,11 @@
+function log(message)
+{
+    postMessage(message);
+}
+
+onmessage = function(event)
+{
+    var testFiles = event.data;
+    log("Received files in worker");
+    runNextTest(testFiles);
+}
diff --git a/LayoutTests/fast/files/workers/resources/worker-read-file-async.js b/LayoutTests/fast/files/workers/resources/worker-read-file-async.js
new file mode 100644
index 0000000..3271e08
--- /dev/null
+++ b/LayoutTests/fast/files/workers/resources/worker-read-file-async.js
@@ -0,0 +1,7 @@
+importScripts("../../resources/read-common.js", "../../resources/read-file-test-cases.js", "worker-read-common.js");
+
+function isReadAsAsync()
+{
+    return true;
+}
+
diff --git a/LayoutTests/fast/files/workers/resources/worker-read-file-sync.js b/LayoutTests/fast/files/workers/resources/worker-read-file-sync.js
new file mode 100644
index 0000000..f5f76eb
--- /dev/null
+++ b/LayoutTests/fast/files/workers/resources/worker-read-file-sync.js
@@ -0,0 +1,6 @@
+importScripts("../../resources/read-common.js", "../../resources/read-file-test-cases.js", "worker-read-common.js");
+
+function isReadAsAsync()
+{
+    return false;
+}
diff --git a/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt b/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt
new file mode 100644
index 0000000..6cfed90
--- /dev/null
+++ b/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt
@@ -0,0 +1,124 @@
+
+Received files in worker
+Test reading a blob containing non-existent file
+readyState: 0
+Received error event
+readyState: 2
+error code: 8
+Received loadend event
+Test reading a blob containing existent and non-existent file
+readyState: 0
+Received error event
+readyState: 2
+error code: 8
+Received loadend event
+Test reading a blob containing empty file
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 0
+result: 
+Received loadend event
+Test reading a blob containing empty text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 0
+result: 
+Received loadend event
+Test reading a blob containing empty files and empty texts
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 0
+result: 
+Received loadend event
+Test reading a blob containing single file
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a blob containing single text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: First
+Received loadend event
+Test reading a blob containing sliced file
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: onder
+Received loadend event
+Test reading a blob containing sliced text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 4
+result: irst
+Received loadend event
+Test reading a blob containing multiple files
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 19
+result: HelloWonderfulWorld
+Received loadend event
+Test reading a blob containing multiple texts
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 16
+result: FirstSecondThird
+Received loadend event
+Test reading a hybrid blob
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 35
+result: FirstHelloSecondWonderfulWorldThird
+Received loadend event
+Test reading a sliced hybrid blob
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 12
+result: lloSecondWon
+Received loadend event
+Test reading a triple-sliced hybrid blob
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 30
+result: ondWonderfulWorldThirdFooloSec
+Received loadend event
+DONE
+
diff --git a/LayoutTests/fast/files/workers/worker-read-blob-async.html b/LayoutTests/fast/files/workers/worker-read-blob-async.html
new file mode 100644
index 0000000..422cf60
--- /dev/null
+++ b/LayoutTests/fast/files/workers/worker-read-blob-async.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input type="file" name="file" id="file" onchange="onInputFileChange(testFileInfoList)" multiple>
+<pre id='console'></pre>
+
+<script src="../resources/setup-for-read-common.js"></script>
+<script>
+var testFileInfoList = [
+    { 'name': 'non-existent', 'path': '../resources/non-existent' },
+    { 'name': 'empty-file', 'path': '../resources/empty-file' },
+    { 'name': 'file1', 'path': '../resources/UTF8.txt' },
+    { 'name': 'file2', 'path': '../resources/UTF8-2.txt' },
+    { 'name': 'file3', 'path': '../resources/UTF8-3.txt' },
+];
+
+function startTest(testFiles)
+{
+    startWorker(testFiles, "resources/worker-read-blob-async.js");
+}
+
+if (window.eventSender) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    window.onload = function() { runTests(testFileInfoList); }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt b/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt
new file mode 100644
index 0000000..77f5414
--- /dev/null
+++ b/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt
@@ -0,0 +1,32 @@
+
+Received files in worker
+Test reading a blob containing non-existent file
+Received exception 8: NOT_FOUND_ERR
+Test reading a blob containing existent and non-existent file
+Received exception 8: NOT_FOUND_ERR
+Test reading a blob containing empty file
+
+Test reading a blob containing empty text
+
+Test reading a blob containing empty files and empty texts
+
+Test reading a blob containing single file
+Hello
+Test reading a blob containing single text
+First
+Test reading a blob containing sliced file
+onder
+Test reading a blob containing sliced text
+irst
+Test reading a blob containing multiple files
+HelloWonderfulWorld
+Test reading a blob containing multiple texts
+FirstSecondThird
+Test reading a hybrid blob
+FirstHelloSecondWonderfulWorldThird
+Test reading a sliced hybrid blob
+lloSecondWon
+Test reading a triple-sliced hybrid blob
+ondWonderfulWorldThirdFooloSec
+DONE
+
diff --git a/LayoutTests/fast/files/workers/worker-read-blob-sync.html b/LayoutTests/fast/files/workers/worker-read-blob-sync.html
new file mode 100644
index 0000000..1a9d803
--- /dev/null
+++ b/LayoutTests/fast/files/workers/worker-read-blob-sync.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input type="file" name="file" id="file" onchange="onInputFileChange(testFileInfoList)" multiple>
+<pre id='console'></pre>
+
+<script src="../resources/setup-for-read-common.js"></script>
+<script>
+var testFileInfoList = [
+    { 'name': 'non-existent', 'path': '../resources/non-existent' },
+    { 'name': 'empty-file', 'path': '../resources/empty-file' },
+    { 'name': 'file1', 'path': '../resources/UTF8.txt' },
+    { 'name': 'file2', 'path': '../resources/UTF8-2.txt' },
+    { 'name': 'file3', 'path': '../resources/UTF8-3.txt' },
+];
+
+function startTest(testFiles)
+{
+    startWorker(testFiles, "resources/worker-read-blob-sync.js");
+}
+
+if (window.eventSender) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    window.onload = function() { runTests(testFileInfoList); }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/files/workers/worker-read-file-async-expected.txt b/LayoutTests/fast/files/workers/worker-read-file-async-expected.txt
new file mode 100644
index 0000000..a497658
--- /dev/null
+++ b/LayoutTests/fast/files/workers/worker-read-file-async-expected.txt
@@ -0,0 +1,148 @@
+
+Received files in worker
+Test reading a non-existent file as binary string
+readyState: 0
+Received error event
+readyState: 2
+error code: 8
+Received loadend event
+Test reading a non-existent file as text
+readyState: 0
+Received error event
+readyState: 2
+error code: 8
+Received loadend event
+Test reading a non-existent file as data URL
+readyState: 0
+Received error event
+readyState: 2
+error code: 8
+Received loadend event
+Test reading an empty file as binary string
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 0
+result: 
+Received loadend event
+Test reading an empty file as text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 0
+result: 
+Received loadend event
+Test reading an empty file as data URL
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: data:
+Received loadend event
+Test reading a UTF-8 file as binary string
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a binary file as binary string
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 9
+result: 0x0 0x1 0x2 0x80 0x81 0x82 0xfd 0xfe 0xff
+Received loadend event
+Test reading a UTF-8 file as text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a UTF-16BE BOM file as text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a UTF-16LE BOM file as text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a UTF-8 BOM file as text
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a UTF-16BE file as text with UTF-16BE encoding
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a UTF-16BE BOM file as text with UTF8 encoding
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a UTF-16BE BOM file as text with invalid encoding
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 5
+result: Hello
+Received loadend event
+Test reading a UTF-8 file as data URL
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 31
+result: data:text/plain;base64,SGVsbG8=
+Received loadend event
+Test calling multiple read methods and only last one is processed
+readyState: 0
+Received loadstart event
+readyState: 1
+Received load event
+readyState: 2
+result size: 31
+result: data:text/plain;base64,SGVsbG8=
+Received loadend event
+DONE
+
diff --git a/LayoutTests/fast/files/workers/worker-read-file-async.html b/LayoutTests/fast/files/workers/worker-read-file-async.html
new file mode 100644
index 0000000..12ed94b
--- /dev/null
+++ b/LayoutTests/fast/files/workers/worker-read-file-async.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input type="file" name="file" id="file" onchange="onInputFileChange(testFileInfoList)" multiple>
+<pre id='console'></pre>
+
+<script src="../resources/setup-for-read-common.js"></script>
+<script>
+var testFileInfoList = [
+    { 'name': 'non-existent', 'path': '../resources/non-existent' },
+    { 'name': 'empty-file', 'path': '../resources/empty-file' },
+    { 'name': 'UTF8-file', 'path': '../resources/UTF8.txt' },
+    { 'name': 'UTF16BE-BOM-file', 'path': '../resources/UTF16BE-BOM.txt' },
+    { 'name': 'UTF16LE-BOM-file', 'path': '../resources/UTF16LE-BOM.txt' },
+    { 'name': 'UTF8-BOM-file', 'path': '../resources/UTF8-BOM.txt' },
+    { 'name': 'UTF16BE-file', 'path': '../resources/UTF16BE.txt' },
+    { 'name': 'binary-file', 'path': '../resources/binary-file' },
+];
+
+function startTest(testFiles)
+{
+    startWorker(testFiles, "resources/worker-read-file-async.js");
+}
+
+if (window.eventSender) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    window.onload = function() { runTests(testFileInfoList); }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/files/workers/worker-read-file-sync.html b/LayoutTests/fast/files/workers/worker-read-file-sync.html
new file mode 100644
index 0000000..7d59fe9
--- /dev/null
+++ b/LayoutTests/fast/files/workers/worker-read-file-sync.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<input type="file" name="file" id="file" onchange="onInputFileChange(testFileInfoList)" multiple>
+<pre id='console'></pre>
+
+<script src="../resources/setup-for-read-common.js"></script>
+<script>
+var testFileInfoList = [
+    { 'name': 'non-existent', 'path': '../resources/non-existent' },
+    { 'name': 'empty-file', 'path': '../resources/empty-file' },
+    { 'name': 'UTF8-file', 'path': '../resources/UTF8.txt' },
+    { 'name': 'UTF16BE-BOM-file', 'path': '../resources/UTF16BE-BOM.txt' },
+    { 'name': 'UTF16LE-BOM-file', 'path': '../resources/UTF16LE-BOM.txt' },
+    { 'name': 'UTF8-BOM-file', 'path': '../resources/UTF8-BOM.txt' },
+    { 'name': 'UTF16BE-file', 'path': '../resources/UTF16BE.txt' },
+    { 'name': 'binary-file', 'path': '../resources/binary-file' },
+];
+
+function startTest(testFiles)
+{
+    startWorker(testFiles, "resources/worker-read-file-sync.js");
+}
+
+if (window.eventSender) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+    window.onload = function() { runTests(testFileInfoList); }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index b07826f..28aac93 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -162,6 +162,7 @@ WONTFIX SKIP : fast/regex/test1.html = PASS
 
 // We use worker_uitests to run workers tests. Don't run them in test_shell.
 WONTFIX SKIP : fast/workers = PASS TIMEOUT FAIL
+WONTFIX SKIP : fast/files/workers = PASS TIMEOUT FAIL
 WONTFIX SKIP : http/tests/workers = PASS TIMEOUT FAIL
 WONTFIX SKIP : http/tests/xmlhttprequest/workers = PASS TIMEOUT FAIL
 WONTFIX SKIP : http/tests/eventsource/workers = PASS TIMEOUT FAIL
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index f25dddc..ace3844 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -3148,6 +3148,7 @@ http/tests/local/formdata/send-form-data-with-sliced-file.html
 http/tests/local/formdata/upload-events.html
 fast/files/read-blob-async.html
 fast/files/read-file-async.html
+fast/files/workers
 http/tests/media/video-play-stall-seek.html
 http/tests/media/video-play-stall.html
 http/tests/media/video-seekable-stall.html
diff --git a/LayoutTests/platform/mac-wk2/Skipped b/LayoutTests/platform/mac-wk2/Skipped
index 732b33a..465be8d 100644
--- a/LayoutTests/platform/mac-wk2/Skipped
+++ b/LayoutTests/platform/mac-wk2/Skipped
@@ -366,6 +366,7 @@ fast/events/window-events-capture.html
 fast/events/zoom-dblclick.html
 fast/files/read-blob-async.html
 fast/files/read-file-async.html
+fast/files/workers
 fast/forms/25153.html
 fast/forms/access-key.html
 fast/forms/button-enter-click.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index c058372..614c590 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -783,6 +783,7 @@ http/tests/security/isolatedWorld/world-reuse.html
 fast/dom/Window/window-postmessage-clone-frames.html
 fast/files/read-blob-async.html
 fast/files/read-file-async.html
+fast/files/workers
 
 # Missing layoutTestController.setAlwaysAcceptCookies()
 http/tests/plugins/third-party-cookie-accept-policy.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index da9a748..8af9e31 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -197,6 +197,7 @@ fast/events/drag-file-crash.html
 fast/dom/Window/window-postmessage-clone.html
 fast/files/read-blob-async.html
 fast/files/read-file-async.html
+fast/files/workers
 
 # Need to add functionality to DumpRenderTree to test IDN <rdar://problem/5301954>
 fast/encoding/idn-security.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4c14741..45b7355 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-08-31  Jian Li  <jianli at chromium.org>
+
+        Reviewed by David Levin.
+
+        Support FileReaderSync in workers.
+        https://bugs.webkit.org/show_bug.cgi?id=44657
+
+        Also add FileException interface and make Blob/File/FileError useable in
+        workers.
+
+        Tests: fast/files/workers/worker-read-blob-async.html
+               fast/files/workers/worker-read-blob-sync.html
+               fast/files/workers/worker-read-file-async.html
+               fast/files/workers/worker-read-file-sync.html
+
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * fileapi/Blob.idl: Added NoStaticTables attribute.
+        * fileapi/File.idl: Added NoStaticTables attribute.
+        * fileapi/FileError.idl: Added NoStaticTables attribute.
+        * fileapi/FileException.h: Added.
+        * fileapi/FileException.idl: Added.
+        * fileapi/FileReaderSync.cpp: Added.
+        * fileapi/FileReaderSync.h: Added.
+        * fileapi/FileReaderSync.idl: Added.
+        * workers/WorkerContext.idl: Expose FileReaderSync and BlodBuilder in workers.
+
 2010-08-30  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index bbab64b..81f4070 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -107,8 +107,10 @@
 #include "JSFile.cpp"
 #include "JSFileEntry.cpp"
 #include "JSFileError.cpp"
+#include "JSFileException.cpp"
 #include "JSFileList.cpp"
 #include "JSFileReader.cpp"
+#include "JSFileReaderSync.cpp"
 #include "JSFileSystemCallback.cpp"
 #include "JSFileWriter.cpp"
 #include "JSFlags.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index e3381de..6fd1cde 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -152,9 +152,11 @@ DOM_CLASSES = \
     EventTarget \
     File \
     FileEntry \
+    FileException \
     FileError \
     FileList \
     FileReader \
+    FileReaderSync \
     FileWriter \
     FileSystemCallback \
     Flags \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 4784689..20437fd 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -89,8 +89,10 @@
             'fileapi/BlobBuilder.idl',
             'fileapi/File.idl',
             'fileapi/FileError.idl',
+            'fileapi/FileException.idl',
             'fileapi/FileList.idl',
             'fileapi/FileReader.idl',
+            'fileapi/FileReaderSync.idl',
             'fileapi/FileWriter.idl',
             'html/DOMFormData.idl',
             'html/DataGridColumn.idl',
@@ -1429,10 +1431,13 @@
             'fileapi/File.cpp',
             'fileapi/File.h',
             'fileapi/FileError.h',
+            'fileapi/FileException.h',
             'fileapi/FileList.cpp',
             'fileapi/FileList.h',
             'fileapi/FileReader.cpp',
             'fileapi/FileReader.h',
+            'fileapi/FileReaderSync.cpp',
+            'fileapi/FileReaderSync.h',
             'fileapi/FileStreamProxy.cpp',
             'fileapi/FileStreamProxy.h',
             'fileapi/FileThread.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index f14bdf5..e7db38e 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -626,6 +626,7 @@ SOURCES += \
     fileapi/File.cpp \
     fileapi/FileList.cpp \
     fileapi/FileReader.cpp \
+    fileapi/FileReaderSync.cpp \
     fileapi/FileStreamProxy.cpp \
     fileapi/FileThread.cpp \
     fileapi/FileWriter.cpp \
@@ -1405,8 +1406,10 @@ HEADERS += \
     fileapi/BlobURL.h \
     fileapi/File.h \
     fileapi/FileError.h \
+    fileapi/FileException.h \
     fileapi/FileList.h \
     fileapi/FileReader.h \
+    fileapi/FileReaderSync.h \
     fileapi/FileStreamProxy.h \
     fileapi/FileThread.h \
     fileapi/FileThreadTask.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 65aebb6..57e81d3 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -4877,6 +4877,14 @@
 				>
 			</File>
 			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileException.cpp"
+				>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileException.h"
+				>
+			</File>
+			<File
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileList.cpp"
 				>
 				<FileConfiguration
@@ -4989,6 +4997,14 @@
 				>
 			</File>
 			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileReaderSync.cpp"
+				>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileReaderSync.h"
+				>
+			</File>
+			<File
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileSystemCallback.cpp"
 				>
 				<FileConfiguration
@@ -37109,6 +37125,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\fileapi\FileException.h"
+				>
+			</File>
+			<File
 				RelativePath="..\fileapi\FileList.cpp"
 				>
 			</File>
@@ -37125,6 +37145,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\fileapi\FileReaderSync.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\fileapi\FileReaderSync.h"
+				>
+			</File>
+			<File
 				RelativePath="..\fileapi\FileStreamProxy.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index f741dbd..7691fff 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -717,6 +717,13 @@
 		2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */; };
 		2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */; };
 		2EDEF1F8121B0EFC00726DB2 /* BlobStorageData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */; };
+		2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */; };
+		2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369B122C94B4002F7D4E /* FileReaderSync.h */; };
+		2EDF369F122C94C8002F7D4E /* FileException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369E122C94C8002F7D4E /* FileException.h */; };
+		2EDF37C4122C95CA002F7D4E /* JSFileException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF37C3122C95CA002F7D4E /* JSFileException.h */; };
+		2EDF37C6122C95DF002F7D4E /* JSFileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDF37C5122C95DF002F7D4E /* JSFileException.cpp */; };
+		2EDF37C9122C95F2002F7D4E /* JSFileReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDF37C7122C95F2002F7D4E /* JSFileReaderSync.cpp */; };
+		2EDF37CA122C95F2002F7D4E /* JSFileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF37C8122C95F2002F7D4E /* JSFileReaderSync.h */; };
 		2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */; };
 		2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFE9121C9F4200C27627 /* FileStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2EF1BFF7121CB0BD00C27627 /* AsyncFileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFF6121CB0BD00C27627 /* AsyncFileStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -6553,6 +6560,13 @@
 		2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobRegistryImpl.cpp; sourceTree = "<group>"; };
 		2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobRegistryImpl.h; sourceTree = "<group>"; };
 		2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobStorageData.h; sourceTree = "<group>"; };
+		2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileReaderSync.cpp; path = fileapi/FileReaderSync.cpp; sourceTree = "<group>"; };
+		2EDF369B122C94B4002F7D4E /* FileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileReaderSync.h; path = fileapi/FileReaderSync.h; sourceTree = "<group>"; };
+		2EDF369E122C94C8002F7D4E /* FileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileException.h; path = fileapi/FileException.h; sourceTree = "<group>"; };
+		2EDF37C3122C95CA002F7D4E /* JSFileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileException.h; sourceTree = "<group>"; };
+		2EDF37C5122C95DF002F7D4E /* JSFileException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileException.cpp; sourceTree = "<group>"; };
+		2EDF37C7122C95F2002F7D4E /* JSFileReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReaderSync.cpp; sourceTree = "<group>"; };
+		2EDF37C8122C95F2002F7D4E /* JSFileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReaderSync.h; sourceTree = "<group>"; };
 		2EF1BFE8121C9F4200C27627 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStream.cpp; sourceTree = "<group>"; };
 		2EF1BFE9121C9F4200C27627 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStream.h; sourceTree = "<group>"; };
 		2EF1BFF6121CB0BD00C27627 /* AsyncFileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFileStream.h; sourceTree = "<group>"; };
@@ -14336,10 +14350,13 @@
 				976D6C61122B8A3D001FD1F7 /* File.cpp */,
 				976D6C62122B8A3D001FD1F7 /* File.h */,
 				976D6C64122B8A3D001FD1F7 /* FileError.h */,
+				2EDF369E122C94C8002F7D4E /* FileException.h */,
 				976D6C66122B8A3D001FD1F7 /* FileList.cpp */,
 				976D6C67122B8A3D001FD1F7 /* FileList.h */,
 				976D6C69122B8A3D001FD1F7 /* FileReader.cpp */,
 				976D6C6A122B8A3D001FD1F7 /* FileReader.h */,
+				2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */,
+				2EDF369B122C94B4002F7D4E /* FileReaderSync.h */,
 				976D6C6C122B8A3D001FD1F7 /* FileStreamProxy.cpp */,
 				976D6C6D122B8A3D001FD1F7 /* FileStreamProxy.h */,
 				976D6C6E122B8A3D001FD1F7 /* FileThread.cpp */,
@@ -14462,10 +14479,14 @@
 				BC00F0110E0A189500FD04E3 /* JSFile.h */,
 				2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */,
 				2E3BC0C9117D3E0800B9409A /* JSFileError.h */,
+				2EDF37C5122C95DF002F7D4E /* JSFileException.cpp */,
+				2EDF37C3122C95CA002F7D4E /* JSFileException.h */,
 				BC00F0120E0A189500FD04E3 /* JSFileList.cpp */,
 				BC00F0130E0A189500FD04E3 /* JSFileList.h */,
 				2E94F439119207DA00B7F75D /* JSFileReader.cpp */,
 				2E94F43A119207DA00B7F75D /* JSFileReader.h */,
+				2EDF37C7122C95F2002F7D4E /* JSFileReaderSync.cpp */,
+				2EDF37C8122C95F2002F7D4E /* JSFileReaderSync.h */,
 				46DA844B1224A0710060D006 /* JSFileWriter.cpp */,
 				46DA844C1224A0710060D006 /* JSFileWriter.h */,
 				49EECEF4105070C400099FAB /* JSFloat32Array.cpp */,
@@ -20425,6 +20446,10 @@
 				976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */,
 				976D6C93122B8A3D001FD1F7 /* FileWriterClient.h in Headers */,
 				976D6C95122B8A3D001FD1F7 /* ThreadableBlobRegistry.h in Headers */,
+				2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */,
+				2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
+				2EDF37C4122C95CA002F7D4E /* JSFileException.h in Headers */,
+				2EDF37CA122C95F2002F7D4E /* JSFileReaderSync.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -22885,6 +22910,9 @@
 				976D6C8D122B8A3D001FD1F7 /* FileThread.cpp in Sources */,
 				976D6C90122B8A3D001FD1F7 /* FileWriter.cpp in Sources */,
 				976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */,
+				2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */,
+				2EDF37C6122C95DF002F7D4E /* JSFileException.cpp in Sources */,
+				2EDF37C9122C95F2002F7D4E /* JSFileReaderSync.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/fileapi/Blob.idl b/WebCore/fileapi/Blob.idl
index e063b6d..b220233 100644
--- a/WebCore/fileapi/Blob.idl
+++ b/WebCore/fileapi/Blob.idl
@@ -30,7 +30,9 @@
 
 module html {
 
-    interface Blob {
+    interface [
+        NoStaticTables
+    ] Blob {
         readonly attribute unsigned long long size;
         readonly attribute DOMString type;
 
diff --git a/WebCore/fileapi/File.idl b/WebCore/fileapi/File.idl
index 5626c8e..1937901 100644
--- a/WebCore/fileapi/File.idl
+++ b/WebCore/fileapi/File.idl
@@ -27,7 +27,8 @@ module html {
 
     interface [
         GenerateNativeConverter,
-        GenerateToJS
+        GenerateToJS,
+        NoStaticTables
     ] File : Blob {
         readonly attribute DOMString name;
 #if defined(ENABLE_DIRECTORY_UPLOAD) && ENABLE_DIRECTORY_UPLOAD
diff --git a/WebCore/fileapi/FileError.idl b/WebCore/fileapi/FileError.idl
index 3423e72..b73670b 100644
--- a/WebCore/fileapi/FileError.idl
+++ b/WebCore/fileapi/FileError.idl
@@ -31,7 +31,8 @@
 module html {
     interface [
         Conditional=BLOB|FILE_WRITER,
-        DontCheckEnums
+        DontCheckEnums,
+        NoStaticTables
     ] FileError {
 #if !defined(LANGUAGE_OBJECTIVE_C)
         const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
diff --git a/WebCore/fileapi/FileException.h b/WebCore/fileapi/FileException.h
new file mode 100644
index 0000000..4419eb7
--- /dev/null
+++ b/WebCore/fileapi/FileException.h
@@ -0,0 +1,66 @@
+/*
+ * 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 FileException_h
+#define FileException_h
+
+#if ENABLE(BLOB) || ENABLE(FILE_WRITER)
+
+#include "ExceptionBase.h"
+
+namespace WebCore {
+
+class FileException : public ExceptionBase {
+public:
+    static PassRefPtr<FileException> create(const ExceptionCodeDescription& description)
+    {
+        return adoptRef(new FileException(description));
+    }
+
+    static const int FileExceptionOffset = 100;
+    static const int FileExceptionMax = 199;
+
+    enum EventExceptionCode {
+        UNSPECIFIED_EVENT_TYPE_ERR = FileExceptionOffset
+    };
+
+private:
+    FileException(const ExceptionCodeDescription& description)
+        : ExceptionBase(description)
+    {
+    }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER)
+
+#endif // FileException_h
+
diff --git a/WebCore/fileapi/FileException.idl b/WebCore/fileapi/FileException.idl
new file mode 100644
index 0000000..4a5f424
--- /dev/null
+++ b/WebCore/fileapi/FileException.idl
@@ -0,0 +1,55 @@
+/*
+ * 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=BLOB|FILE_WRITER,
+        DontCheckEnums,
+        NoStaticTables
+    ] FileException {
+
+        readonly attribute unsigned short   code;
+        readonly attribute DOMString        name;
+        readonly attribute DOMString        message;
+
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
+        // Override in a Mozilla compatible format
+        [DontEnum] DOMString toString();
+#endif
+
+        // FileExceptionCode
+        const unsigned short NOT_FOUND_ERR = 8;
+        const unsigned short SECURITY_ERR = 18;
+        const unsigned short ABORT_ERR = 20;
+
+        const unsigned short NOT_READABLE_ERR = 24;
+        const unsigned short ENCODING_ERR = 26;
+    };
+}
diff --git a/WebCore/fileapi/FileList.idl b/WebCore/fileapi/FileList.idl
index 6baf3e1..0d0b046 100644
--- a/WebCore/fileapi/FileList.idl
+++ b/WebCore/fileapi/FileList.idl
@@ -26,7 +26,8 @@
 module html {
 
     interface [
-        HasIndexGetter
+        HasIndexGetter,
+        NoStaticTables
     ] FileList {
         readonly attribute unsigned long length;
         File item(in [IsIndex] unsigned long index);
diff --git a/WebCore/fileapi/FileReaderSync.cpp b/WebCore/fileapi/FileReaderSync.cpp
new file mode 100644
index 0000000..a907044
--- /dev/null
+++ b/WebCore/fileapi/FileReaderSync.cpp
@@ -0,0 +1,193 @@
+/*
+ * 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(BLOB)
+
+#include "FileReaderSync.h"
+
+#include "Base64.h"
+#include "Blob.h"
+#include "FileReader.h"
+#include "ResourceRequest.h"
+#include "ScriptExecutionContext.h"
+#include "TextEncoding.h"
+#include "TextResourceDecoder.h"
+#include "ThreadableLoader.h"
+
+namespace WebCore {
+
+class FileReaderSyncLoader : public ThreadableLoaderClient {
+public:
+    // If the output result is provided, use it. Otherwise, save it as the raw data.
+    FileReaderSyncLoader(ScriptString* result);
+
+    // Returns the http status code.
+    void start(ScriptExecutionContext*, const ResourceRequest&, ExceptionCode&);
+
+    // ThreadableLoaderClient
+    virtual void didReceiveResponse(const ResourceResponse&);
+    virtual void didReceiveData(const char*, int);
+    virtual void didFinishLoading(unsigned long identifier);
+    virtual void didFail(const ResourceError&);
+
+    const Vector<char>& rawData() const { return m_rawData; }
+
+private:
+    // The output result. The caller provides this in order to load the binary data directly.
+    ScriptString* m_result;
+
+    // The raw data. The caller does not provide the above output result and we need to save it here.
+    Vector<char> m_rawData;
+
+    int m_httpStatusCode;    
+};
+
+FileReaderSyncLoader::FileReaderSyncLoader(ScriptString* result)
+    : m_result(result)
+    , m_httpStatusCode(0)
+{
+}
+
+void FileReaderSyncLoader::start(ScriptExecutionContext* scriptExecutionContext, const ResourceRequest& request, ExceptionCode& ec)
+{
+    ThreadableLoaderOptions options;
+    options.sendLoadCallbacks = true;
+    options.sniffContent = false;
+    options.forcePreflight = false;
+    options.allowCredentials = true;
+    options.crossOriginRequestPolicy = DenyCrossOriginRequests;
+
+    ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options);
+
+    ec = (m_httpStatusCode == 200) ? 0 : FileReader::httpStatusCodeToExceptionCode(m_httpStatusCode);
+}
+
+void FileReaderSyncLoader::didReceiveResponse(const ResourceResponse& response)
+{
+    m_httpStatusCode = response.httpStatusCode();
+}
+
+void FileReaderSyncLoader::didReceiveData(const char* data, int lengthReceived)
+{
+    if (m_result)
+        *m_result += String(data, static_cast<unsigned>(lengthReceived));
+    else
+        m_rawData.append(data, static_cast<unsigned>(lengthReceived));
+}
+
+void FileReaderSyncLoader::didFinishLoading(unsigned long)
+{
+}
+
+void FileReaderSyncLoader::didFail(const ResourceError&)
+{
+    // Treat as internal error.
+    m_httpStatusCode = 500;
+}
+
+FileReaderSync::FileReaderSync()
+    : m_result("")
+{
+}
+
+const ScriptString& FileReaderSync::readAsBinaryString(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
+{
+    if (!blob)
+        return m_result;
+
+    read(scriptExecutionContext, blob, ReadAsBinaryString, ec);
+    return m_result;
+}
+
+const ScriptString& FileReaderSync::readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, const String& encoding, ExceptionCode& ec)
+{
+    if (!blob)
+        return m_result;
+
+    m_encoding = encoding;
+    read(scriptExecutionContext, blob, ReadAsText, ec);
+    return m_result;
+}
+
+const ScriptString& FileReaderSync::readAsDataURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
+{
+    if (!blob)
+        return m_result;
+
+    read(scriptExecutionContext, blob, ReadAsDataURL, ec);
+    return m_result;
+}
+
+void FileReaderSync::read(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ReadType readType, ExceptionCode& ec)
+{
+    // The blob is read by routing through the request handling layer given the blob url.
+    ResourceRequest request(blob->url());
+    request.setHTTPMethod("GET");
+
+    FileReaderSyncLoader loader((readType == ReadAsBinaryString) ? &m_result : 0);
+    loader.start(scriptExecutionContext, request, ec);
+    if (ec)
+        return;
+
+    switch (readType) {
+    case ReadAsBinaryString:
+        // Nothing to do since we need no conversion.
+        return;
+    case ReadAsText:
+        convertToText(loader.rawData().data(), loader.rawData().size(), m_result);
+        return;
+    case ReadAsDataURL:
+        FileReader::convertToDataURL(loader.rawData(), blob->type(), m_result);
+        return;
+    }
+
+    ASSERT_NOT_REACHED();
+}
+
+void FileReaderSync::convertToText(const char* data, int size, ScriptString& result)
+{
+    if (!size)
+        return;
+
+    // Decode the data.
+    // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
+    // requirement in order to be consistent with how WebKit decodes the web content: always have the BOM override the
+    // provided encoding.     
+    // FIXME: consider supporting incremental decoding to improve the perf.
+    RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plain", m_encoding.isEmpty() ? UTF8Encoding() : TextEncoding(m_encoding));
+    result = decoder->decode(data, size);
+    result += decoder->flush();
+}
+
+} // namespace WebCore
+ 
+#endif // ENABLE(BLOB)
diff --git a/WebCore/fileapi/FileReaderSync.h b/WebCore/fileapi/FileReaderSync.h
new file mode 100644
index 0000000..a517cab
--- /dev/null
+++ b/WebCore/fileapi/FileReaderSync.h
@@ -0,0 +1,90 @@
+/*
+ * 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 FileReaderSync_h
+#define FileReaderSync_h
+
+#if ENABLE(BLOB)
+
+#include "ExceptionCode.h"
+#include "ScriptString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Blob;
+class ScriptExecutionContext;
+
+class FileReaderSync : public RefCounted<FileReaderSync> {
+public:
+    static PassRefPtr<FileReaderSync> create()
+    {
+        return adoptRef(new FileReaderSync());
+    }
+
+    virtual ~FileReaderSync() { }
+
+    const ScriptString& readAsBinaryString(ScriptExecutionContext*, Blob*, ExceptionCode&);
+    const ScriptString& readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec)
+    {
+        return readAsText(scriptExecutionContext, blob, "", ec);
+    }
+    const ScriptString& readAsText(ScriptExecutionContext*, Blob*, const String& encoding, ExceptionCode&);
+    const ScriptString& readAsDataURL(ScriptExecutionContext*, Blob*, ExceptionCode&);
+
+private:
+    enum ReadType {
+        ReadAsBinaryString,
+        ReadAsText,
+        ReadAsDataURL
+    };
+
+    FileReaderSync();
+    
+    void read(ScriptExecutionContext*, Blob*, ReadType, ExceptionCode&);
+    void convertToText(const char* data, int size, ScriptString& result);
+
+    // Like XMLHttpRequest.m_responseText, we keep this as a ScriptString, not a WTF::String.
+    // That's because these strings can easily get huge (they are filled from the file) and
+    // because JS can easily observe many intermediate states, so it's very useful to be
+    // able to share the buffer with JavaScript versions of the whole or partial string.
+    // In contrast, this string doesn't interact much with the rest of the engine so it's not that
+    // big a cost that it isn't a String.
+    ScriptString m_result;
+
+    String m_encoding;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(BLOB)
+
+#endif // FileReaderSync_h
diff --git a/WebCore/fileapi/FileReaderSync.idl b/WebCore/fileapi/FileReaderSync.idl
new file mode 100644
index 0000000..72818b1
--- /dev/null
+++ b/WebCore/fileapi/FileReaderSync.idl
@@ -0,0 +1,44 @@
+/*
+ * 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=BLOB,
+        CanBeConstructed,
+        NoStaticTables
+    ] FileReaderSync {
+        [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsBinaryString(in Blob blob)
+            raises(FileException);
+        [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsText(in Blob blob, in [Optional] DOMString encoding)
+            raises(FileException);
+        [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsDataURL(in Blob blob)
+            raises(FileException);
+    };
+}
diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
index 27b4b14..81a681a 100644
--- a/WebCore/workers/WorkerContext.idl
+++ b/WebCore/workers/WorkerContext.idl
@@ -96,6 +96,12 @@ module threads {
         attribute [JSCCustomGetter,EnabledAtRuntime] WebSocketConstructor WebSocket; // Usable with the new operator
 #endif
 #endif
+
+#if defined(ENABLE_BLOB) && ENABLE_BLOB
+        attribute BlobBuilderConstructor BlobBuilder;
+        attribute FileReaderConstructor FileReader;
+        attribute FileReaderSyncConstructor FileReaderSync;
+#endif
     };
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list