Title: [103625] trunk
Revision
103625
Author
loi...@chromium.org
Date
2011-12-23 07:35:12 -0800 (Fri, 23 Dec 2011)

Log Message

Unreviewed, rolling out r103624.
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):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (103624 => 103625)


--- trunk/LayoutTests/ChangeLog	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/LayoutTests/ChangeLog	2011-12-23 15:35:12 UTC (rev 103625)
@@ -1,3 +1,17 @@
+2011-12-23  Ilya Tikhonovsky  <loi...@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  <er...@chromium.org>
 
        [fileapi] WebKitFlags should not be constructable per Directories & System spec

Modified: trunk/LayoutTests/fast/filesystem/flags-passing-expected.txt (103624 => 103625)


--- trunk/LayoutTests/fast/filesystem/flags-passing-expected.txt	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/LayoutTests/fast/filesystem/flags-passing-expected.txt	2011-12-23 15:35:12 UTC (rev 103625)
@@ -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
 

Modified: trunk/LayoutTests/fast/filesystem/script-tests/flags-passing.js (103624 => 103625)


--- trunk/LayoutTests/fast/filesystem/script-tests/flags-passing.js	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/LayoutTests/fast/filesystem/script-tests/flags-passing.js	2011-12-23 15:35:12 UTC (rev 103625)
@@ -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 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 @@
     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) {

Modified: trunk/Source/WebCore/CMakeLists.txt (103624 => 103625)


--- trunk/Source/WebCore/CMakeLists.txt	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/CMakeLists.txt	2011-12-23 15:35:12 UTC (rev 103625)
@@ -1599,6 +1599,7 @@
         fileapi/FileWriterCallback.idl
         fileapi/FileWriter.idl
         fileapi/FileWriterSync.idl
+        fileapi/WebKitFlags.idl
         fileapi/Metadata.idl
         fileapi/MetadataCallback.idl
     )

Modified: trunk/Source/WebCore/ChangeLog (103624 => 103625)


--- trunk/Source/WebCore/ChangeLog	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/ChangeLog	2011-12-23 15:35:12 UTC (rev 103625)
@@ -1,3 +1,31 @@
+2011-12-23  Ilya Tikhonovsky  <loi...@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  <er...@chromium.org>
 
        [fileapi] WebKitFlags should not be constructable per Directories & System spec

Modified: trunk/Source/WebCore/DerivedSources.cpp (103624 => 103625)


--- trunk/Source/WebCore/DerivedSources.cpp	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/DerivedSources.cpp	2011-12-23 15:35:12 UTC (rev 103625)
@@ -127,6 +127,7 @@
 #include "JSFileWriter.cpp"
 #include "JSFileWriterCallback.cpp"
 #include "JSFileWriterSync.cpp"
+#include "JSWebKitFlags.cpp"
 #include "JSFloat32Array.cpp"
 #include "JSFloat64Array.cpp"
 #include "JSGeolocation.cpp"

Modified: trunk/Source/WebCore/DerivedSources.pri (103624 => 103625)


--- trunk/Source/WebCore/DerivedSources.pri	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/DerivedSources.pri	2011-12-23 15:35:12 UTC (rev 103625)
@@ -205,6 +205,7 @@
     fileapi/FileWriter.idl \
     fileapi/FileWriterCallback.idl \
     fileapi/OperationNotAllowedException.idl \
+    fileapi/WebKitFlags.idl \
     fileapi/Metadata.idl \
     fileapi/MetadataCallback.idl \
     fileapi/WebKitBlobBuilder.idl \

Modified: trunk/Source/WebCore/GNUmakefile.list.am (103624 => 103625)


--- trunk/Source/WebCore/GNUmakefile.list.am	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2011-12-23 15:35:12 UTC (rev 103625)
@@ -4386,6 +4386,8 @@
 	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 \

Modified: trunk/Source/WebCore/WebCore.gypi (103624 => 103625)


--- trunk/Source/WebCore/WebCore.gypi	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/WebCore.gypi	2011-12-23 15:35:12 UTC (rev 103625)
@@ -1268,6 +1268,7 @@
             'fileapi/FileWriterCallback.idl',
             'fileapi/FileWriterSync.idl',
             'fileapi/OperationNotAllowedException.idl',
+            'fileapi/WebKitFlags.idl',
             'fileapi/Metadata.idl',
             'fileapi/MetadataCallback.idl',
             'fileapi/WebKitBlobBuilder.idl',
@@ -7435,6 +7436,8 @@
             '<(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',

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (103624 => 103625)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-12-23 15:35:12 UTC (rev 103625)
@@ -2931,6 +2931,8 @@
 		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 */; };
@@ -10188,6 +10190,8 @@
 		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>"; };
@@ -17025,6 +17029,8 @@
 				2E24476713959173004B6C19 /* JSOperationNotAllowedException.h */,
 				89CD029111C85B870070B791 /* JSWebKitBlobBuilder.cpp */,
 				89CD029211C85B870070B791 /* JSWebKitBlobBuilder.h */,
+				8987859E122CA2A7003AABDA /* JSWebKitFlags.cpp */,
+				8987859F122CA2A7003AABDA /* JSWebKitFlags.h */,
 			);
 			name = FileAPI;
 			sourceTree = "<group>";
@@ -23774,6 +23780,7 @@
 				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 */,
@@ -26879,6 +26886,7 @@
 				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 */,

Modified: trunk/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp (103624 => 103625)


--- trunk/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp	2011-12-23 15:35:12 UTC (rev 103625)
@@ -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 @@
     }
 
     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 @@
     }
 
     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;

Modified: trunk/Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp (103624 => 103625)


--- trunk/Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp	2011-12-23 15:35:12 UTC (rev 103625)
@@ -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 @@
 {
     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();

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp (103624 => 103625)


--- trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp	2011-12-23 15:35:12 UTC (rev 103625)
@@ -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 @@
         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 @@
             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 @@
         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 @@
             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()) {

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp (103624 => 103625)


--- trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp	2011-12-23 15:35:12 UTC (rev 103625)
@@ -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 @@
     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;
     {

Added: trunk/Source/WebCore/fileapi/WebKitFlags.idl (0 => 103625)


--- trunk/Source/WebCore/fileapi/WebKitFlags.idl	                        (rev 0)
+++ trunk/Source/WebCore/fileapi/WebKitFlags.idl	2011-12-23 15:35:12 UTC (rev 103625)
@@ -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;
+    };
+}
Property changes on: trunk/Source/WebCore/fileapi/WebKitFlags.idl
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/page/DOMWindow.idl (103624 => 103625)


--- trunk/Source/WebCore/page/DOMWindow.idl	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2011-12-23 15:35:12 UTC (rev 103625)
@@ -195,6 +195,8 @@
         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

Modified: trunk/Source/WebCore/workers/WorkerContext.idl (103624 => 103625)


--- trunk/Source/WebCore/workers/WorkerContext.idl	2011-12-23 13:23:18 UTC (rev 103624)
+++ trunk/Source/WebCore/workers/WorkerContext.idl	2011-12-23 15:35:12 UTC (rev 103625)
@@ -111,6 +111,7 @@
         [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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to