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

kinuko at chromium.org kinuko at chromium.org
Wed Dec 22 13:26:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit dc8cf8910505af41ef5f98c7e249c04c71ee7855
Author: kinuko at chromium.org <kinuko at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 15 06:41:41 2010 +0000

    2010-09-14  Kinuko Yasuda  <kinuko at chromium.org>
    
            Reviewed by Dumitru Daniliuc.
    
            Add custom binding code for DirectoryEntry to allow JSON parameters for Flags
            https://bugs.webkit.org/show_bug.cgi?id=45724
    
            No new tests; tests will be added later.
    
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSDirectoryEntryCustom.cpp: Added.
            (WebCore::JSDirectoryEntry::getFile):
            (WebCore::JSDirectoryEntry::getDirectory):
            * bindings/v8/custom/V8DirectoryEntryCustom.cpp: Added.
            (WebCore::V8DirectoryEntry::getDirectoryCallback):
            (WebCore::V8DirectoryEntry::getFileCallback):
            * fileapi/DirectoryEntry.h:
            * fileapi/DirectoryEntry.idl:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67538 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index e437d14..0de8e37 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1569,6 +1569,7 @@ ENDIF ()
 
 if (ENABLE_FILE_SYSTEM)
     LIST(APPEND WebCore_SOURCES
+        bindings/js/JSDirectoryEntryCustom.cpp
         bindings/js/JSEntryCustom.cpp
         fileapi/DirectoryEntry.cpp
         fileapi/DirectoryReader.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dd8be26..2c23f1b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-14  Kinuko Yasuda  <kinuko at chromium.org>
+
+        Reviewed by Dumitru Daniliuc.
+
+        Add custom binding code for DirectoryEntry to allow JSON parameters for Flags
+        https://bugs.webkit.org/show_bug.cgi?id=45724
+
+        No new tests; tests will be added later.
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDirectoryEntryCustom.cpp: Added.
+        (WebCore::JSDirectoryEntry::getFile):
+        (WebCore::JSDirectoryEntry::getDirectory):
+        * bindings/v8/custom/V8DirectoryEntryCustom.cpp: Added.
+        (WebCore::V8DirectoryEntry::getDirectoryCallback):
+        (WebCore::V8DirectoryEntry::getFileCallback):
+        * fileapi/DirectoryEntry.h:
+        * fileapi/DirectoryEntry.idl:
+
 2010-09-14  Jia Pu  <jpu at apple.com>
         
         Reviewed by Dan Bernstein.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index ab68527..a372277 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -678,6 +678,7 @@ webcore_sources += \
 	WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp \
 	WebCore/bindings/js/JSDeviceMotionEventCustom.cpp \
 	WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
+	WebCore/bindings/js/JSDirectoryEntryCustom.cpp \
 	WebCore/bindings/js/JSDocumentCustom.cpp \
 	WebCore/bindings/js/JSDOMApplicationCacheCustom.cpp \
 	WebCore/bindings/js/JSDOMBinding.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index da7c510..d394ab6 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -564,6 +564,7 @@
             'bindings/js/JSDebugWrapperSet.h',
             'bindings/js/JSDeviceMotionEventCustom.cpp',
             'bindings/js/JSDeviceOrientationEventCustom.cpp',
+            'bindings/js/JSDirectoryEntryCustom.cpp',
             'bindings/js/JSDocumentCustom.cpp',
             'bindings/js/JSDOMApplicationCacheCustom.cpp',
             'bindings/js/JSDOMBinding.cpp',
@@ -760,6 +761,7 @@
             'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
             'bindings/v8/custom/V8DeviceMotionEventCustom.cpp',
             'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
+            'bindings/v8/custom/V8DirectoryEntryCustom.cpp',
             'bindings/v8/custom/V8DocumentLocationCustom.cpp',
             'bindings/v8/custom/V8DOMFormDataCustom.cpp',
             'bindings/v8/custom/V8DOMStringMapCustom.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 726b600..c384f33 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2939,6 +2939,7 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
         platform/AsyncFileSystemCallbacks.h
 
     SOURCES += \
+        bindings/js/JSDirectoryEntryCustom.cpp \
         bindings/js/JSEntryCustom.cpp \
         fileapi/DirectoryEntry.cpp \
         fileapi/DirectoryReader.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 94fc70d..5b7da6e 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -46780,6 +46780,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\bindings\js\JSDirectoryEntryCustom.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\bindings\js\JSImageConstructor.cpp"
 					>
 					<FileConfiguration
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 5a5ac13..5b0ae85 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2384,6 +2384,7 @@
 		893C47B81238A099002B3D86 /* JSFileCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47B61238A099002B3D86 /* JSFileCallback.h */; };
 		893C47BB1238A0A9002B3D86 /* JSFileWriterCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47B91238A0A9002B3D86 /* JSFileWriterCallback.cpp */; };
 		893C47BC1238A0A9002B3D86 /* JSFileWriterCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47BA1238A0A9002B3D86 /* JSFileWriterCallback.h */; };
+		893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */; };
 		893C47CC123EEBA2002B3D86 /* JSEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */; };
 		89878552122CA064003AABDA /* DirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878539122CA064003AABDA /* DirectoryEntry.cpp */; };
 		89878553122CA064003AABDA /* DirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987853A122CA064003AABDA /* DirectoryEntry.h */; };
@@ -8289,6 +8290,7 @@
 		893C47B61238A099002B3D86 /* JSFileCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileCallback.h; sourceTree = "<group>"; };
 		893C47B91238A0A9002B3D86 /* JSFileWriterCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileWriterCallback.cpp; sourceTree = "<group>"; };
 		893C47BA1238A0A9002B3D86 /* JSFileWriterCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileWriterCallback.h; sourceTree = "<group>"; };
+		893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntryCustom.cpp; sourceTree = "<group>"; };
 		893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryCustom.cpp; sourceTree = "<group>"; };
 		89878539122CA064003AABDA /* DirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DirectoryEntry.cpp; path = fileapi/DirectoryEntry.cpp; sourceTree = "<group>"; };
 		8987853A122CA064003AABDA /* DirectoryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryEntry.h; path = fileapi/DirectoryEntry.h; sourceTree = "<group>"; };
@@ -16366,6 +16368,7 @@
 				33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
 				31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */,
 				590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
+				893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */,
 				49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
 				1AC226160DB69F740089B669 /* JSDOMApplicationCacheCustom.cpp */,
 				2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */,
@@ -23034,6 +23037,7 @@
 				893C47B71238A099002B3D86 /* JSFileCallback.cpp in Sources */,
 				893C47BB1238A0A9002B3D86 /* JSFileWriterCallback.cpp in Sources */,
 				93E2A306123E9DC0009FE12A /* HTMLParserIdioms.cpp in Sources */,
+				893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */,
 				893C47CC123EEBA2002B3D86 /* JSEntryCustom.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
diff --git a/WebCore/bindings/js/JSDirectoryEntryCustom.cpp b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
new file mode 100644
index 0000000..35a6c32
--- /dev/null
+++ b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "JSDirectoryEntry.h"
+
+#include "JSDOMBinding.h"
+#include "JSEntryCallback.h"
+#include "JSErrorCallback.h"
+#include "JSFlags.h"
+#include <wtf/Assertions.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSDirectoryEntry::getFile(ExecState* exec)
+{
+    DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
+    const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+    if (exec->hadException())
+        return jsUndefined();
+
+    int argsCount = exec->argumentCount();
+    if (argsCount <= 1) {
+        imp->getFile(path);
+        return jsUndefined();
+    }
+
+    RefPtr<Flags> flags;
+    if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSFlags::s_info)) {
+        JSObject* object = exec->argument(1).getObject();
+        flags = Flags::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 = adoptRef(toFlags(exec->argument(1)));
+    if (exec->hadException())
+        return jsUndefined();
+    RefPtr<EntryCallback> successCallback;
+    if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
+        if (!exec->argument(2).isObject()) {
+            setDOMException(exec, TYPE_MISMATCH_ERR);
+            return jsUndefined();
+        }
+        successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
+    }
+    RefPtr<ErrorCallback> errorCallback;
+    if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
+        if (!exec->argument(3).isObject()) {
+            setDOMException(exec, TYPE_MISMATCH_ERR);
+            return jsUndefined();
+        }
+        errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
+    }
+
+    imp->getFile(path, flags, successCallback, errorCallback);
+    return jsUndefined();
+}
+
+JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
+{
+    DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
+    const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+    if (exec->hadException())
+        return jsUndefined();
+
+    int argsCount = exec->argumentCount();
+    if (argsCount <= 1) {
+        imp->getDirectory(path);
+        return jsUndefined();
+    }
+
+    RefPtr<Flags> flags;
+    if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSFlags::s_info)) {
+        JSObject* object = exec->argument(1).getObject();
+        flags = Flags::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 = adoptRef(toFlags(exec->argument(1)));
+    if (exec->hadException())
+        return jsUndefined();
+    RefPtr<EntryCallback> successCallback;
+    if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
+        if (!exec->argument(2).isObject()) {
+            setDOMException(exec, TYPE_MISMATCH_ERR);
+            return jsUndefined();
+        }
+        successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
+    }
+    RefPtr<ErrorCallback> errorCallback;
+    if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
+        if (!exec->argument(3).isObject()) {
+            setDOMException(exec, TYPE_MISMATCH_ERR);
+            return jsUndefined();
+        }
+        errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
+    }
+
+    imp->getDirectory(path, flags, successCallback, errorCallback);
+    return jsUndefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
new file mode 100644
index 0000000..286b154
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
@@ -0,0 +1,139 @@
+/*
+ * 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"
+#include "V8DirectoryEntry.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "DirectoryEntry.h"
+#include "ExceptionCode.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8EntryCallback.h"
+#include "V8ErrorCallback.h"
+#include "V8Flags.h"
+#include "V8Proxy.h"
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DirectoryEntry::getDirectoryCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.DirectoryEntry.getDirectory");
+    DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
+    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
+    if (args.Length() <= 1) {
+        imp->getDirectory(path);
+        return v8::Handle<v8::Value>();
+    }
+    RefPtr<Flags> flags;
+    if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8Flags::HasInstance(args[1])) {
+        EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
+        flags = Flags::create();
+        v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
+        if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
+            EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
+            flags->setCreate(isCreate);
+        }
+        v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
+        if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
+            EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
+            flags->setExclusive(isExclusive);
+        }
+    } else {
+       EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+       flags = adoptRef(tmp_flags);
+    }
+    RefPtr<EntryCallback> successCallback;
+    if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
+        if (!args[2]->IsObject())
+            return throwError(TYPE_MISMATCH_ERR);
+        successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
+    }
+    RefPtr<ErrorCallback> errorCallback;
+    if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
+        if (!args[3]->IsObject())
+            return throwError(TYPE_MISMATCH_ERR);
+        errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
+    }
+    imp->getDirectory(path, flags, successCallback, errorCallback);
+    return v8::Handle<v8::Value>();
+}
+
+v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.DirectoryEntry.getFile");
+    DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
+    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
+    if (args.Length() <= 1) {
+        imp->getFile(path);
+        return v8::Handle<v8::Value>();
+    }
+    RefPtr<Flags> flags;
+    if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8Flags::HasInstance(args[1])) {
+        EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
+        flags = Flags::create();
+        v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
+        if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
+            EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
+            flags->setCreate(isCreate);
+        }
+        v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
+        if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
+            EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
+            flags->setExclusive(isExclusive);
+        }
+    } else {
+       EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+       flags = adoptRef(tmp_flags);
+    }
+    RefPtr<EntryCallback> successCallback;
+    if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
+        if (!args[2]->IsObject())
+            return throwError(TYPE_MISMATCH_ERR);
+        successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
+    }
+    RefPtr<ErrorCallback> errorCallback;
+    if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
+        if (!args[3]->IsObject())
+            return throwError(TYPE_MISMATCH_ERR);
+        errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
+    }
+    imp->getFile(path, flags, successCallback, errorCallback);
+    return v8::Handle<v8::Value>();
+}
+
+
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/fileapi/DirectoryEntry.idl b/WebCore/fileapi/DirectoryEntry.idl
index 4569d54..7a0efdd 100644
--- a/WebCore/fileapi/DirectoryEntry.idl
+++ b/WebCore/fileapi/DirectoryEntry.idl
@@ -35,7 +35,7 @@ module storage {
         GenerateToJS
     ] DirectoryEntry : Entry {
         DirectoryReader createReader();
-        void getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
-        void getDirectory(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+        [Custom] void getFile(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+        [Custom] void getDirectory(in [ConvertUndefinedOrNullToNullString] DOMString path, in [Optional] Flags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
     };
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list