Unreviewed, rolling out r103624.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2011 15:35:12 +0000 (15:35 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2011 15:35:12 +0000 (15:35 +0000)
http://trac.webkit.org/changeset/103624
https://bugs.webkit.org/show_bug.cgi?id=68916

Broke Snow Leopard builders

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.pri:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDirectoryEntryCustom.cpp:
(WebCore::JSDirectoryEntry::getFile):
(WebCore::JSDirectoryEntry::getDirectory):
* bindings/js/JSDirectoryEntrySyncCustom.cpp:
(WebCore::getFlags):
* bindings/v8/custom/V8DirectoryEntryCustom.cpp:
(WebCore::V8DirectoryEntry::getDirectoryCallback):
(WebCore::V8DirectoryEntry::getFileCallback):
* bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp:
(WebCore::getFlags):
* fileapi/WebKitFlags.idl: Added.
* page/DOMWindow.idl:
* workers/WorkerContext.idl:

LayoutTests:

* fast/filesystem/flags-passing-expected.txt:
* fast/filesystem/script-tests/flags-passing.js:
(runNextTest):
(runObjectTest):
(runObjectTestWithExclusive):

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

17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/filesystem/flags-passing-expected.txt
LayoutTests/fast/filesystem/script-tests/flags-passing.js
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp
Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
Source/WebCore/fileapi/WebKitFlags.idl [new file with mode: 0644]
Source/WebCore/page/DOMWindow.idl
Source/WebCore/workers/WorkerContext.idl

index ae5a70bd5d2386c39deb33be27c169fc8ad0c80f..7adc83ff7dfe34ccc08c21231ee68b57aad68fdb 100644 (file)
@@ -1,3 +1,17 @@
+2011-12-23  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed, rolling out r103624.
+        http://trac.webkit.org/changeset/103624
+        https://bugs.webkit.org/show_bug.cgi?id=68916
+
+        Broke Snow Leopard builders
+
+        * fast/filesystem/flags-passing-expected.txt:
+        * fast/filesystem/script-tests/flags-passing.js:
+        (runNextTest):
+        (runObjectTest):
+        (runObjectTestWithExclusive):
+
 2011-12-23  Eric Uhrhane  <ericu@chromium.org>
 
        [fileapi] WebKitFlags should not be constructable per Directories & System spec
index 5c87552030ac9973cc802beccac4555ed2b0277d..11e20397bb4ffb1bbca090d609eabb1540a6b3b4 100644 (file)
@@ -1,14 +1,16 @@
-Passing Flags parameter tests. This test checks if passing Flags parameters to DirectoryEntry.getFile does not crash and works as expected.
+Passing Flags parameter tests. This test checks if passing Flags parameters (in Object format or in JSON format) to DirectoryEntry.getFile does not crash and works as expected.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+* Passing a WebKitFlags object.
+* Recycling the same WebKitFlags object.
+* Passing a WebKitFlags object (with exclusive=true).
 * Passing JSON Flags object.
 * Passing JSON Flags object (with exclusive=true).
 * Passing null as a WebKitFlags parameter.
-* Passing a number as a WebKitFlags parameter.
 Finished running tests.
-PASS expectedCallbacksCount is 1
+PASS expectedCallbacksCount is 3
 PASS unexpectedCallbacksCount is 0
 PASS successfullyParsed is true
 
index 2e5fbeea26d236f96a12a405a33af6a461de8d95..d2d06b202cff212e39eedbc27e497f756122b817 100644 (file)
@@ -1,4 +1,4 @@
-description("Passing Flags parameter tests. This test checks if passing Flags parameters to DirectoryEntry.getFile does not crash and works as expected.");
+description("Passing Flags parameter tests. This test checks if passing Flags parameters (in Object format or in JSON format) to DirectoryEntry.getFile does not crash and works as expected.");
 
 var testFileName = '/non_existent_file';
 var fileSystem = null;
@@ -9,18 +9,18 @@ var unexpected = function(e) { unexpectedCallbacksCount++; };
 
 var testsList = [
     'runObjectTest',
+    'runObjectTestWithExclusive',
     'cleanupAndRunNext',
     'runJSONTest',
     'runJSONTestWithExclusive',
-    'runNullTest',
-    'runNonObjectTest'
+    'runNullTest'
 ];
 var testCounter = 0;
 
 function runNextTest(v) {
     if (testCounter == testsList.length) {
         debug("Finished running tests.");
-        shouldBe('expectedCallbacksCount', '1');
+        shouldBe('expectedCallbacksCount', '3');
         shouldBe('unexpectedCallbacksCount', '0');
         finishJSTest();
     } else
@@ -40,18 +40,29 @@ function runNullTest(v) {
     fileSystem.root.getFile(testFileName, null, runNextTest, errorCallback);
 }
 
-function runNonObjectTest(v) {
-    debug("* Passing a number as a WebKitFlags parameter.");
+function runObjectTest(v) {
+    debug("* Passing a WebKitFlags object.");
+    var flags = new WebKitFlags();
+    flags.create = false;
 
-    // This should be ok and we treat it as {false, false} Flags.
-    fileSystem.root.getFile(testFileName, 7, runNextTest, errorCallback);
+    fileSystem.root.getFile(testFileName, flags, unexpected, expected);
+
+    debug("* Recycling the same WebKitFlags object.");
+
+    fileSystem.root.getFile(testFileName, flags, unexpected, expected);
+
+    flags.create = true;
+    fileSystem.root.getFile(testFileName, flags, runNextTest, errorCallback);
 }
 
-function runObjectTest(v) {
-    // WebKitFlags no longer has a visible constructor.
-    if (window.WebKitFlags)
-        throw "There should be no constructor for WebKitFlags!";
-    runNextTest();
+function runObjectTestWithExclusive(v) {
+    debug("* Passing a WebKitFlags object (with exclusive=true).");
+    var flags = new WebKitFlags;
+    flags.create = true;
+    flags.exclusive = true;
+
+    // This should fail.
+    fileSystem.root.getFile(testFileName, flags, errorCallback, runNextTest);
 }
 
 function runJSONTest(v) {
index 5aa975c0c9e1e759e4f04b41aeee9435901679da..0efcc45fcc4a79e392caf0eac4009d740d26dd04 100644 (file)
@@ -1599,6 +1599,7 @@ if (ENABLE_FILE_SYSTEM)
         fileapi/FileWriterCallback.idl
         fileapi/FileWriter.idl
         fileapi/FileWriterSync.idl
+        fileapi/WebKitFlags.idl
         fileapi/Metadata.idl
         fileapi/MetadataCallback.idl
     )
index 5ad3e219aa57129487d5a2954f1c6f9bd3be59ad..87823ab2737731f19b5fc8dca6a07823692dea22 100644 (file)
@@ -1,3 +1,31 @@
+2011-12-23  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed, rolling out r103624.
+        http://trac.webkit.org/changeset/103624
+        https://bugs.webkit.org/show_bug.cgi?id=68916
+
+        Broke Snow Leopard builders
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.pri:
+        * GNUmakefile.list.am:
+        * WebCore.gypi:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDirectoryEntryCustom.cpp:
+        (WebCore::JSDirectoryEntry::getFile):
+        (WebCore::JSDirectoryEntry::getDirectory):
+        * bindings/js/JSDirectoryEntrySyncCustom.cpp:
+        (WebCore::getFlags):
+        * bindings/v8/custom/V8DirectoryEntryCustom.cpp:
+        (WebCore::V8DirectoryEntry::getDirectoryCallback):
+        (WebCore::V8DirectoryEntry::getFileCallback):
+        * bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp:
+        (WebCore::getFlags):
+        * fileapi/WebKitFlags.idl: Added.
+        * page/DOMWindow.idl:
+        * workers/WorkerContext.idl:
+
 2011-12-23  Eric Uhrhane  <ericu@chromium.org>
 
        [fileapi] WebKitFlags should not be constructable per Directories & System spec
index d85dcc5030ef2fe10bcb53f5911a580d409cf1c3..22cbeee8c3313de811b4720dcb397ea1d96fce5c 100644 (file)
 #include "JSFileWriter.cpp"
 #include "JSFileWriterCallback.cpp"
 #include "JSFileWriterSync.cpp"
+#include "JSWebKitFlags.cpp"
 #include "JSFloat32Array.cpp"
 #include "JSFloat64Array.cpp"
 #include "JSGeolocation.cpp"
index 472a9ed307cb221cdb42178e2ccc5baee50c4cfd..c446722d55de25cf97360c9e1217c1e2c097caf9 100644 (file)
@@ -205,6 +205,7 @@ IDL_BINDINGS += \
     fileapi/FileWriter.idl \
     fileapi/FileWriterCallback.idl \
     fileapi/OperationNotAllowedException.idl \
+    fileapi/WebKitFlags.idl \
     fileapi/Metadata.idl \
     fileapi/MetadataCallback.idl \
     fileapi/WebKitBlobBuilder.idl \
index bdf7229a8b89d3a39347b16c7ca47389aecef50e..b7fdc658b25c99fdc1862a05c571ca36d3350ef4 100644 (file)
@@ -4386,6 +4386,8 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSFileWriterCallback.h \
        DerivedSources/WebCore/JSFileWriterSync.cpp \
        DerivedSources/WebCore/JSFileWriterSync.h \
+       DerivedSources/WebCore/JSWebKitFlags.cpp \
+       DerivedSources/WebCore/JSWebKitFlags.h \
        DerivedSources/WebCore/JSMetadata.cpp \
        DerivedSources/WebCore/JSMetadata.h \
        DerivedSources/WebCore/JSMetadataCallback.cpp \
index 0d933282dfff6dcf39679730a01e9016a5603c1c..76c89cde52bb561452318403d829b5b2491ed7f3 100644 (file)
             'fileapi/FileWriterCallback.idl',
             'fileapi/FileWriterSync.idl',
             'fileapi/OperationNotAllowedException.idl',
+            'fileapi/WebKitFlags.idl',
             'fileapi/Metadata.idl',
             'fileapi/MetadataCallback.idl',
             'fileapi/WebKitBlobBuilder.idl',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSFileWriterCallback.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSFileWriterSync.cpp',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSFileWriterSync.h',
+            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitFlags.cpp',
+            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebKitFlags.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSFloat32Array.cpp',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSFloat32Array.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSGeolocation.cpp',
index b53358b31c4db3f54eb8b74ed8611ec6bd6114dd..8b84ea26bf7b24e34978b0070cc2a517e65d25cb 100644 (file)
                898785B1122CA2A7003AABDA /* JSFileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987859B122CA2A7003AABDA /* JSFileEntry.h */; };
                898785B2122CA2A7003AABDA /* JSFileSystemCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987859C122CA2A7003AABDA /* JSFileSystemCallback.cpp */; };
                898785B3122CA2A7003AABDA /* JSFileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987859D122CA2A7003AABDA /* JSFileSystemCallback.h */; };
+               898785B4122CA2A7003AABDA /* JSWebKitFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987859E122CA2A7003AABDA /* JSWebKitFlags.cpp */; };
+               898785B5122CA2A7003AABDA /* JSWebKitFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987859F122CA2A7003AABDA /* JSWebKitFlags.h */; };
                898785B6122CA2A7003AABDA /* JSMetadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785A0122CA2A7003AABDA /* JSMetadata.cpp */; };
                898785B7122CA2A7003AABDA /* JSMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785A1122CA2A7003AABDA /* JSMetadata.h */; };
                898785B8122CA2A7003AABDA /* JSMetadataCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785A2122CA2A7003AABDA /* JSMetadataCallback.cpp */; };
                8987859B122CA2A7003AABDA /* JSFileEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileEntry.h; sourceTree = "<group>"; };
                8987859C122CA2A7003AABDA /* JSFileSystemCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileSystemCallback.cpp; sourceTree = "<group>"; };
                8987859D122CA2A7003AABDA /* JSFileSystemCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemCallback.h; sourceTree = "<group>"; };
+               8987859E122CA2A7003AABDA /* JSWebKitFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitFlags.cpp; sourceTree = "<group>"; };
+               8987859F122CA2A7003AABDA /* JSWebKitFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitFlags.h; sourceTree = "<group>"; };
                898785A0122CA2A7003AABDA /* JSMetadata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMetadata.cpp; sourceTree = "<group>"; };
                898785A1122CA2A7003AABDA /* JSMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMetadata.h; sourceTree = "<group>"; };
                898785A2122CA2A7003AABDA /* JSMetadataCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMetadataCallback.cpp; sourceTree = "<group>"; };
                                2E24476713959173004B6C19 /* JSOperationNotAllowedException.h */,
                                89CD029111C85B870070B791 /* JSWebKitBlobBuilder.cpp */,
                                89CD029211C85B870070B791 /* JSWebKitBlobBuilder.h */,
+                               8987859E122CA2A7003AABDA /* JSWebKitFlags.cpp */,
+                               8987859F122CA2A7003AABDA /* JSWebKitFlags.h */,
                        );
                        name = FileAPI;
                        sourceTree = "<group>";
                                316FE0740E6CCBEE00BF6088 /* JSWebKitCSSKeyframesRule.h in Headers */,
                                498391400F1E767500C23782 /* JSWebKitCSSMatrix.h in Headers */,
                                31611E5B0E1C4DE000F6A579 /* JSWebKitCSSTransformValue.h in Headers */,
+                               898785B5122CA2A7003AABDA /* JSWebKitFlags.h in Headers */,
                                C6F0902D14327D4F00685849 /* JSWebKitMutationObserver.h in Headers */,
                                494BD79E0F55C94C00747828 /* JSWebKitPoint.h in Headers */,
                                31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */,
                                E1AD14B5129734CA00ACA989 /* JSWebKitCSSKeyframesRuleCustom.cpp in Sources */,
                                4983913F0F1E767500C23782 /* JSWebKitCSSMatrix.cpp in Sources */,
                                31611E5A0E1C4DE000F6A579 /* JSWebKitCSSTransformValue.cpp in Sources */,
+                               898785B4122CA2A7003AABDA /* JSWebKitFlags.cpp in Sources */,
                                C6F0902C14327D4F00685849 /* JSWebKitMutationObserver.cpp in Sources */,
                                C6F0917F143A2BB900685849 /* JSWebKitMutationObserverCustom.cpp in Sources */,
                                494BD79D0F55C94C00747828 /* JSWebKitPoint.cpp in Sources */,
index 31232d3ccd19d10ba7c32dca7b1a4ff17587adb2..6e9376e4394a498cf7e38a142997e41f0088d30a 100644 (file)
@@ -38,6 +38,7 @@
 #include "JSDOMBinding.h"
 #include "JSEntryCallback.h"
 #include "JSErrorCallback.h"
+#include "JSWebKitFlags.h"
 #include <wtf/Assertions.h>
 
 using namespace JSC;
@@ -61,14 +62,15 @@ JSValue JSDirectoryEntry::getFile(ExecState* exec)
     }
 
     RefPtr<WebKitFlags> flags;
-    if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject()) {
+    if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSWebKitFlags::s_info)) {
         JSObject* object = exec->argument(1).getObject();
         flags = WebKitFlags::create();
         JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
         flags->setCreate(jsCreate.toBoolean(exec));
         JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
         flags->setExclusive(jsExclusive.toBoolean(exec));
-    }
+    } else
+        flags = toWebKitFlags(exec->argument(1));
     if (exec->hadException())
         return jsUndefined();
     RefPtr<EntryCallback> successCallback;
@@ -109,14 +111,15 @@ JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
     }
 
     RefPtr<WebKitFlags> flags;
-    if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject()) {
+    if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSWebKitFlags::s_info)) {
         JSObject* object = exec->argument(1).getObject();
         flags = WebKitFlags::create();
         JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
         flags->setCreate(jsCreate.toBoolean(exec));
         JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
         flags->setExclusive(jsExclusive.toBoolean(exec));
-    }
+    } else
+        flags = toWebKitFlags(exec->argument(1));
     if (exec->hadException())
         return jsUndefined();
     RefPtr<EntryCallback> successCallback;
index 487d084a87dc72ace38ecadcccddb16d63c0639d..21006ab3ce344428a24cc47cabd8023ffbf4188b 100644 (file)
@@ -38,6 +38,7 @@
 #include "JSEntryCallback.h"
 #include "JSErrorCallback.h"
 #include "JSFileEntrySync.h"
+#include "JSWebKitFlags.h"
 #include <wtf/Assertions.h>
 
 using namespace JSC;
@@ -48,6 +49,8 @@ static PassRefPtr<WebKitFlags> getFlags(ExecState* exec, const JSValue& argument
 {
     if (argument.isNull() || argument.isUndefined() || !argument.isObject())
         return 0;
+    if (argument.inherits(&JSWebKitFlags::s_info))
+        return toFlags(argument);
 
     RefPtr<WebKitFlags> flags;
     JSObject* object = argument.getObject();
index a8062fb7778fec5594115d2faf6bfccc31e5d1e5..4a774868e47fc631cecdac22d215820f9f01e6fd 100644 (file)
@@ -39,6 +39,7 @@
 #include "V8BindingMacros.h"
 #include "V8EntryCallback.h"
 #include "V8ErrorCallback.h"
+#include "V8WebKitFlags.h"
 #include "V8Proxy.h"
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -59,7 +60,7 @@ v8::Handle<v8::Value> V8DirectoryEntry::getDirectoryCallback(const v8::Arguments
         return v8::Handle<v8::Value>();
     }
     RefPtr<WebKitFlags> flags;
-    if (!isUndefinedOrNull(args[1]) && args[1]->IsObject()) {
+    if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8WebKitFlags::HasInstance(args[1])) {
         EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
         flags = WebKitFlags::create();
         v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
@@ -72,6 +73,9 @@ v8::Handle<v8::Value> V8DirectoryEntry::getDirectoryCallback(const v8::Arguments
             EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
             flags->setExclusive(isExclusive);
         }
+    } else {
+        EXCEPTION_BLOCK(WebKitFlags*, tmp_flags, V8WebKitFlags::HasInstance(args[1]) ? V8WebKitFlags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+        flags = tmp_flags;
     }
     RefPtr<EntryCallback> successCallback;
     if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
@@ -103,7 +107,7 @@ v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& arg
         return v8::Handle<v8::Value>();
     }
     RefPtr<WebKitFlags> flags;
-    if (!isUndefinedOrNull(args[1]) && args[1]->IsObject()) {
+    if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8WebKitFlags::HasInstance(args[1])) {
         EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
         flags = WebKitFlags::create();
         v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
@@ -116,6 +120,9 @@ v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& arg
             EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
             flags->setExclusive(isExclusive);
         }
+    } else {
+       EXCEPTION_BLOCK(WebKitFlags*, tmp_flags, V8WebKitFlags::HasInstance(args[1]) ? V8WebKitFlags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+       flags = tmp_flags;
     }
     RefPtr<EntryCallback> successCallback;
     if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
index 897848b596bcf9d14e4f598ba9d49f5ae42a328c..cd38ca45b0dee1d5a7d5cf1bb56c70b0c046dbc4 100644 (file)
@@ -40,6 +40,7 @@
 #include "V8EntryCallback.h"
 #include "V8ErrorCallback.h"
 #include "V8FileEntrySync.h"
+#include "V8WebKitFlags.h"
 #include "V8Proxy.h"
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -66,6 +67,8 @@ static PassRefPtr<WebKitFlags> getFlags(const v8::Local<v8::Value>& arg, Excepti
     ec = 0;
     if (isUndefinedOrNull(arg) || !arg->IsObject())
         return 0;
+    if (V8WebKitFlags::HasInstance(arg))
+        return V8WebKitFlags::toNative(v8::Handle<v8::Object>::Cast(arg));
 
     v8::Handle<v8::Object> object;
     {
diff --git a/Source/WebCore/fileapi/WebKitFlags.idl b/Source/WebCore/fileapi/WebKitFlags.idl
new file mode 100644 (file)
index 0000000..3d10327
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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 storage {
+    interface [
+        Conditional=FILE_SYSTEM,
+        Constructor,
+        NoStaticTables
+    ] WebKitFlags {
+        attribute boolean create;
+        attribute boolean exclusive;
+    };
+}
index ea6b936c29833d5fdb45bdf3c86188c513f4ae5a..2ec8d6a5b05e56da01ec3d04774ac2a63d3f9361 100644 (file)
@@ -195,6 +195,8 @@ module window {
         const unsigned short PERSISTENT = 1;
         [EnabledAtRuntime=FileSystem] void webkitRequestFileSystem(in unsigned short type, in long long size, in [Callback] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
         [EnabledAtRuntime=FileSystem] void webkitResolveLocalFileSystemURL(in DOMString url, in [Callback, Optional] EntryCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
+
+        attribute [EnabledAtRuntime=FileSystem] WebKitFlagsConstructor WebKitFlags;
 #endif
 
 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
index b94727502b31b7ced249a90d5d3ace8aedf76e02..736bbc133f7f2330f70ab073a88803e075ae0ad2 100644 (file)
@@ -111,6 +111,7 @@ module threads {
         [EnabledAtRuntime=FileSystem] void webkitResolveLocalFileSystemURL(in DOMString url, in [Callback, Optional] EntryCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
         [EnabledAtRuntime=FileSystem] EntrySync webkitResolveLocalFileSystemSyncURL(in DOMString url) raises (FileException);
 
+                 attribute [EnabledAtRuntime=FileSystem] WebKitFlagsConstructor WebKitFlags;
                  attribute [EnabledAtRuntime=FileSystem] FileErrorConstructor FileError;
                  attribute [EnabledAtRuntime=FileSystem] FileExceptionConstructor FileException;
 #endif