Permalink
Browse files

DirectoryEntry should use Dictionary rather than custom bindings code

https://bugs.webkit.org/show_bug.cgi?id=94207

Reviewed by Eric Seidel.

Source/WebCore:

Since this code was written, we added native support for WebIDL
Dictionary objects. This patch moves DirectoryEntry to use this
automatic facility instead of custom code.

I've also renamed and simplified WebKitFlags. This is possible because
this object was no longer exposed via IDL (even before to this patch).

* GNUmakefile.list.am:
* Modules/filesystem/DOMFileSystemBase.cpp:
(WebCore::DOMFileSystemBase::getFile):
(WebCore::DOMFileSystemBase::getDirectory):
* Modules/filesystem/DOMFileSystemBase.h:
(DOMFileSystemBase):
* Modules/filesystem/DirectoryEntry.cpp:
(WebCore::DirectoryEntry::getFile):
(WebCore::DirectoryEntry::getDirectory):
* Modules/filesystem/DirectoryEntry.h:
(DirectoryEntry):
* Modules/filesystem/DirectoryEntry.idl:
* Modules/filesystem/DirectoryEntrySync.cpp:
(WebCore::DirectoryEntrySync::getFile):
(WebCore::DirectoryEntrySync::getDirectory):
* Modules/filesystem/DirectoryEntrySync.h:
(DirectoryEntrySync):
* Modules/filesystem/DirectoryEntrySync.idl:
* Modules/filesystem/FileSystemCallbacks.cpp:
(WebCore):
(WebCore::ResolveURICallbacks::didOpenFileSystem):
* Modules/filesystem/FileSystemFlags.h: Renamed from Source/WebCore/Modules/filesystem/WebKitFlags.h.
(WebCore):
(WebCore::FileSystemFlags::FileSystemFlags):
(FileSystemFlags):
* Modules/filesystem/WorkerContextFileSystem.cpp:
(WebCore::WorkerContextFileSystem::webkitResolveLocalFileSystemSyncURL):
* Target.pri:
* UseJSC.cmake:
* UseV8.cmake:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDirectoryEntryCustom.cpp: Removed.
* bindings/js/JSDirectoryEntrySyncCustom.cpp: Removed.
* bindings/v8/custom/V8DirectoryEntryCustom.cpp: Removed.
* bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp: Removed.

LayoutTests:

This patch changes our behavior slightly in that passing a non-object
as a flags Dictionary throws an exception rather than being treated as
an empty dictionary. This new behavior matches the WebIDL spec and
hopefully won't cause compat problems.

* fast/filesystem/flags-passing-expected.txt:
* fast/filesystem/script-tests/flags-passing.js:
(runNullTest):
(runNonObjectTest):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
1 parent 8af2f61 commit 609e1d515cd595e3ff6f232584f42ba3abfe9ba0 Adam Barth committed Aug 16, 2012
Showing with 137 additions and 606 deletions.
  1. +17 −0 LayoutTests/ChangeLog
  2. +3 −2 LayoutTests/fast/filesystem/flags-passing-expected.txt
  3. +10 −5 LayoutTests/fast/filesystem/script-tests/flags-passing.js
  4. +52 −0 Source/WebCore/ChangeLog
  5. +1 −3 Source/WebCore/GNUmakefile.list.am
  6. +6 −6 Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
  7. +3 −3 Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
  8. +4 −2 Source/WebCore/Modules/filesystem/DirectoryEntry.cpp
  9. +3 −3 Source/WebCore/Modules/filesystem/DirectoryEntry.h
  10. +2 −2 Source/WebCore/Modules/filesystem/DirectoryEntry.idl
  11. +4 −2 Source/WebCore/Modules/filesystem/DirectoryEntrySync.cpp
  12. +3 −3 Source/WebCore/Modules/filesystem/DirectoryEntrySync.h
  13. +2 −2 Source/WebCore/Modules/filesystem/DirectoryEntrySync.idl
  14. +2 −2 Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
  15. +13 −23 Source/WebCore/Modules/filesystem/{WebKitFlags.h → FileSystemFlags.h}
  16. +2 −2 Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
  17. +1 −3 Source/WebCore/Target.pri
  18. +0 −2 Source/WebCore/UseJSC.cmake
  19. +0 −2 Source/WebCore/UseV8.cmake
  20. +1 −5 Source/WebCore/WebCore.gypi
  21. +4 −12 Source/WebCore/WebCore.vcproj/WebCore.vcproj
  22. +4 −12 Source/WebCore/WebCore.xcodeproj/project.pbxproj
  23. +0 −146 Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
  24. +0 −98 Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp
  25. +0 −139 Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
  26. +0 −127 Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
View
17 LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ DirectoryEntry should use Dictionary rather than custom bindings code
+ https://bugs.webkit.org/show_bug.cgi?id=94207
+
+ Reviewed by Eric Seidel.
+
+ This patch changes our behavior slightly in that passing a non-object
+ as a flags Dictionary throws an exception rather than being treated as
+ an empty dictionary. This new behavior matches the WebIDL spec and
+ hopefully won't cause compat problems.
+
+ * fast/filesystem/flags-passing-expected.txt:
+ * fast/filesystem/script-tests/flags-passing.js:
+ (runNullTest):
+ (runNonObjectTest):
+
2012-08-16 Brady Eidson <beidson@apple.com>
http/tests/security/contentSecurityPolicy/shared-worker-connect-src-blocked.html fails (results weren't updated in r125772)
View
5 LayoutTests/fast/filesystem/flags-passing-expected.txt
@@ -5,8 +5,9 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
* Passing JSON Flags object.
* Passing JSON Flags object (with exclusive=true).
-* Passing null as a WebKitFlags parameter.
-* Passing a number as a WebKitFlags parameter.
+* Passing null as a flags parameter.
+* Passing a number as a flags parameter.
+Caught exception: TypeError: Not an object.
Finished running tests.
PASS expectedCallbacksCount is 1
PASS unexpectedCallbacksCount is 0
View
15 LayoutTests/fast/filesystem/script-tests/flags-passing.js
@@ -34,17 +34,22 @@ function errorCallback(error) {
// Test body functions ----------------------------------------------------
function runNullTest(v) {
- debug("* Passing null as a WebKitFlags parameter.");
+ debug("* Passing null as a flags parameter.");
// This should be ok and we treat it as {false, false} Flags.
fileSystem.root.getFile(testFileName, null, runNextTest, errorCallback);
}
function runNonObjectTest(v) {
- debug("* Passing a number as a WebKitFlags parameter.");
-
- // This should be ok and we treat it as {false, false} Flags.
- fileSystem.root.getFile(testFileName, 7, runNextTest, errorCallback);
+ debug("* Passing a number as a flags parameter.");
+
+ try {
+ // This should be not be ok because 7 is not an object.
+ fileSystem.root.getFile(testFileName, 7, errorCallback, errorCallback);
+ } catch (ex) {
+ debug("Caught exception: " + ex);
+ runNextTest();
+ }
}
function runObjectTest(v) {
View
52 Source/WebCore/ChangeLog
@@ -1,3 +1,55 @@
+2012-08-16 Adam Barth <abarth@webkit.org>
+
+ DirectoryEntry should use Dictionary rather than custom bindings code
+ https://bugs.webkit.org/show_bug.cgi?id=94207
+
+ Reviewed by Eric Seidel.
+
+ Since this code was written, we added native support for WebIDL
+ Dictionary objects. This patch moves DirectoryEntry to use this
+ automatic facility instead of custom code.
+
+ I've also renamed and simplified WebKitFlags. This is possible because
+ this object was no longer exposed via IDL (even before to this patch).
+
+ * GNUmakefile.list.am:
+ * Modules/filesystem/DOMFileSystemBase.cpp:
+ (WebCore::DOMFileSystemBase::getFile):
+ (WebCore::DOMFileSystemBase::getDirectory):
+ * Modules/filesystem/DOMFileSystemBase.h:
+ (DOMFileSystemBase):
+ * Modules/filesystem/DirectoryEntry.cpp:
+ (WebCore::DirectoryEntry::getFile):
+ (WebCore::DirectoryEntry::getDirectory):
+ * Modules/filesystem/DirectoryEntry.h:
+ (DirectoryEntry):
+ * Modules/filesystem/DirectoryEntry.idl:
+ * Modules/filesystem/DirectoryEntrySync.cpp:
+ (WebCore::DirectoryEntrySync::getFile):
+ (WebCore::DirectoryEntrySync::getDirectory):
+ * Modules/filesystem/DirectoryEntrySync.h:
+ (DirectoryEntrySync):
+ * Modules/filesystem/DirectoryEntrySync.idl:
+ * Modules/filesystem/FileSystemCallbacks.cpp:
+ (WebCore):
+ (WebCore::ResolveURICallbacks::didOpenFileSystem):
+ * Modules/filesystem/FileSystemFlags.h: Renamed from Source/WebCore/Modules/filesystem/WebKitFlags.h.
+ (WebCore):
+ (WebCore::FileSystemFlags::FileSystemFlags):
+ (FileSystemFlags):
+ * Modules/filesystem/WorkerContextFileSystem.cpp:
+ (WebCore::WorkerContextFileSystem::webkitResolveLocalFileSystemSyncURL):
+ * Target.pri:
+ * UseJSC.cmake:
+ * UseV8.cmake:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDirectoryEntryCustom.cpp: Removed.
+ * bindings/js/JSDirectoryEntrySyncCustom.cpp: Removed.
+ * bindings/v8/custom/V8DirectoryEntryCustom.cpp: Removed.
+ * bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp: Removed.
+
2012-08-15 Antti Koivisto <antti@apple.com>
Remove StyleSheetContents::m_finalURL
View
4 Source/WebCore/GNUmakefile.list.am
@@ -1751,6 +1751,7 @@ webcore_modules_sources += \
Source/WebCore/Modules/filesystem/FileSystemCallback.h \
Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp \
Source/WebCore/Modules/filesystem/FileSystemCallbacks.h \
+ Source/WebCore/Modules/filesystem/FileSystemFlags.h \
Source/WebCore/Modules/filesystem/FileSystemType.h \
Source/WebCore/Modules/filesystem/FileWriter.cpp \
Source/WebCore/Modules/filesystem/FileWriter.h \
@@ -1764,7 +1765,6 @@ webcore_modules_sources += \
Source/WebCore/Modules/filesystem/LocalFileSystem.h \
Source/WebCore/Modules/filesystem/MetadataCallback.h \
Source/WebCore/Modules/filesystem/Metadata.h \
- Source/WebCore/Modules/filesystem/WebKitFlags.h \
Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp \
Source/WebCore/Modules/filesystem/WorkerContextFileSystem.h \
Source/WebCore/Modules/gamepad/Gamepad.cpp \
@@ -2224,8 +2224,6 @@ webcore_sources += \
Source/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp \
Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp \
Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
- Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp \
- Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp \
Source/WebCore/bindings/js/JSDocumentCustom.cpp \
Source/WebCore/bindings/js/JSElementCustom.cpp \
Source/WebCore/bindings/js/JSEntryCustom.cpp \
View
12 Source/WebCore/Modules/filesystem/DOMFileSystemBase.cpp
@@ -222,29 +222,29 @@ bool DOMFileSystemBase::getParent(const EntryBase* entry, PassRefPtr<EntryCallba
return true;
}
-bool DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+bool DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
String absolutePath;
if (!pathToAbsolutePath(m_type, entry, path, absolutePath))
return false;
OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, false);
- if (flags && flags->isCreate())
- m_asyncFileSystem->createFile(createFileSystemURL(absolutePath), flags->isExclusive(), callbacks.release());
+ if (flags.create)
+ m_asyncFileSystem->createFile(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
else
m_asyncFileSystem->fileExists(createFileSystemURL(absolutePath), callbacks.release());
return true;
}
-bool DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+bool DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
{
String absolutePath;
if (!pathToAbsolutePath(m_type, entry, path, absolutePath))
return false;
OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, true);
- if (flags && flags->isCreate())
- m_asyncFileSystem->createDirectory(createFileSystemURL(absolutePath), flags->isExclusive(), callbacks.release());
+ if (flags.create)
+ m_asyncFileSystem->createDirectory(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
else
m_asyncFileSystem->directoryExists(createFileSystemURL(absolutePath), callbacks.release());
return true;
View
6 Source/WebCore/Modules/filesystem/DOMFileSystemBase.h
@@ -34,10 +34,10 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
+#include "FileSystemFlags.h"
#include "FileSystemType.h"
#include "KURL.h"
#include "PlatformString.h"
-#include "WebKitFlags.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -98,8 +98,8 @@ class DOMFileSystemBase : public RefCounted<DOMFileSystemBase> {
bool remove(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
bool removeRecursively(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
- bool getFile(const EntryBase*, const String& path, PassRefPtr<WebKitFlags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
- bool getDirectory(const EntryBase*, const String& path, PassRefPtr<WebKitFlags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
+ bool getFile(const EntryBase*, const String& path, const FileSystemFlags&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
+ bool getDirectory(const EntryBase*, const String& path, const FileSystemFlags&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>);
protected:
View
6 Source/WebCore/Modules/filesystem/DirectoryEntry.cpp
@@ -51,15 +51,17 @@ PassRefPtr<DirectoryReader> DirectoryEntry::createReader()
return DirectoryReader::create(m_fileSystem, m_fullPath);
}
-void DirectoryEntry::getFile(const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
+void DirectoryEntry::getFile(const String& path, const Dictionary& options, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
{
+ FileSystemFlags flags(options);
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getFile(this, path, flags, successCallback, errorCallback))
filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
}
-void DirectoryEntry::getDirectory(const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
+void DirectoryEntry::getDirectory(const String& path, const Dictionary& options, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
{
+ FileSystemFlags flags(options);
RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
if (!m_fileSystem->getDirectory(this, path, flags, successCallback, errorCallback))
filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
View
6 Source/WebCore/Modules/filesystem/DirectoryEntry.h
@@ -34,8 +34,8 @@
#if ENABLE(FILE_SYSTEM)
#include "Entry.h"
+#include "FileSystemFlags.h"
#include "PlatformString.h"
-#include "WebKitFlags.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -56,8 +56,8 @@ class DirectoryEntry : public Entry {
virtual bool isDirectory() const { return true; }
PassRefPtr<DirectoryReader> createReader();
- void getFile(const String& path, PassRefPtr<WebKitFlags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
- void getDirectory(const String& path, PassRefPtr<WebKitFlags> = 0, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
+ void getFile(const String& path, const Dictionary& = Dictionary(), PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
+ void getDirectory(const String& path, const Dictionary& = Dictionary(), PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
void removeRecursively(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> = 0) const;
private:
View
4 Source/WebCore/Modules/filesystem/DirectoryEntry.idl
@@ -36,8 +36,8 @@ module storage {
JSNoStaticTables
] DirectoryEntry : Entry {
DirectoryReader createReader();
- [Custom] void getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
- [Custom] void getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] WebKitFlags flags, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
+ void getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in [Optional] Dictionary options, in [Optional, Callback] EntryCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
void removeRecursively(in [Callback] VoidCallback successCallback, in [Optional, Callback] ErrorCallback errorCallback);
};
}
View
6 Source/WebCore/Modules/filesystem/DirectoryEntrySync.cpp
@@ -51,9 +51,10 @@ PassRefPtr<DirectoryReaderSync> DirectoryEntrySync::createReader(ExceptionCode&)
return DirectoryReaderSync::create(m_fileSystem, m_fullPath);
}
-PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, PassRefPtr<WebKitFlags> flags, ExceptionCode& ec)
+PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, const Dictionary& options, ExceptionCode& ec)
{
ec = 0;
+ FileSystemFlags flags(options);
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getFile(this, path, flags, helper.successCallback(), helper.errorCallback())) {
ec = FileException::INVALID_MODIFICATION_ERR;
@@ -62,9 +63,10 @@ PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, PassRe
return static_pointer_cast<FileEntrySync>(helper.getResult(ec));
}
-PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& path, PassRefPtr<WebKitFlags> flags, ExceptionCode& ec)
+PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& path, const Dictionary& options, ExceptionCode& ec)
{
ec = 0;
+ FileSystemFlags flags(options);
EntrySyncCallbackHelper helper(m_fileSystem->asyncFileSystem());
if (!m_fileSystem->getDirectory(this, path, flags, helper.successCallback(), helper.errorCallback())) {
ec = FileException::INVALID_MODIFICATION_ERR;
View
6 Source/WebCore/Modules/filesystem/DirectoryEntrySync.h
@@ -34,8 +34,8 @@
#if ENABLE(FILE_SYSTEM)
#include "EntrySync.h"
+#include "FileSystemFlags.h"
#include "PlatformString.h"
-#include "WebKitFlags.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -53,8 +53,8 @@ class DirectoryEntrySync : public EntrySync {
virtual bool isDirectory() const { return true; }
PassRefPtr<DirectoryReaderSync> createReader(ExceptionCode&);
- PassRefPtr<FileEntrySync> getFile(const String& path, PassRefPtr<WebKitFlags>, ExceptionCode&);
- PassRefPtr<DirectoryEntrySync> getDirectory(const String& path, PassRefPtr<WebKitFlags>, ExceptionCode&);
+ PassRefPtr<FileEntrySync> getFile(const String& path, const Dictionary&, ExceptionCode&);
+ PassRefPtr<DirectoryEntrySync> getDirectory(const String& path, const Dictionary&, ExceptionCode&);
void removeRecursively(ExceptionCode&);
private:
View
4 Source/WebCore/Modules/filesystem/DirectoryEntrySync.idl
@@ -36,8 +36,8 @@ module storage {
JSNoStaticTables
] DirectoryEntrySync : EntrySync {
DirectoryReaderSync createReader() raises (FileException);
- [Custom] FileEntrySync getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in WebKitFlags flags) raises (FileException);
- [Custom] DirectoryEntrySync getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in WebKitFlags flags) raises (FileException);
+ FileEntrySync getFile(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in Dictionary flags) raises (FileException);
+ DirectoryEntrySync getDirectory(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString path, in Dictionary flags) raises (FileException);
void removeRecursively() raises (FileException);
};
}
View
4 Source/WebCore/Modules/filesystem/FileSystemCallbacks.cpp
@@ -173,7 +173,7 @@ class ErrorCallbackWrapper : public ErrorCallback {
{
ASSERT(error);
if (error->code() == FileError::TYPE_MISMATCH_ERR)
- m_root->getFile(m_filePath, 0, m_successCallback, m_errorCallback);
+ m_root->getFile(m_filePath, Dictionary(), m_successCallback, m_errorCallback);
else if (m_errorCallback)
m_errorCallback->handleEvent(error);
return true;
@@ -215,7 +215,7 @@ void ResolveURICallbacks::didOpenFileSystem(const String& name, const KURL& root
{
ASSERT(asyncFileSystem);
RefPtr<DirectoryEntry> root = DOMFileSystem::create(m_scriptExecutionContext.get(), name, m_type, rootURL, asyncFileSystem)->root();
- root->getDirectory(m_filePath, 0, m_successCallback, ErrorCallbackWrapper::create(m_successCallback, m_errorCallback, root, m_filePath));
+ root->getDirectory(m_filePath, Dictionary(), m_successCallback, ErrorCallbackWrapper::create(m_successCallback, m_errorCallback, root, m_filePath));
}
// MetadataCallbacks ----------------------------------------------------------
View
36 .../WebCore/Modules/filesystem/WebKitFlags.h → ...Core/Modules/filesystem/FileSystemFlags.h
@@ -28,40 +28,30 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebKitFlags_h
-#define WebKitFlags_h
+#ifndef FileSystemFlags_h
+#define FileSystemFlags_h
#if ENABLE(FILE_SYSTEM)
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
+#include "Dictionary.h"
namespace WebCore {
-class WebKitFlags : public RefCounted<WebKitFlags> {
-public:
- static PassRefPtr<WebKitFlags> create(bool create = false, bool exclusive = false)
+struct FileSystemFlags {
+ explicit FileSystemFlags(const Dictionary& options)
+ : create(false)
+ , exclusive(false)
{
- return adoptRef(new WebKitFlags(create, exclusive));
+ options.get("create", create);
+ options.get("exclusive", exclusive);
}
- bool isCreate() const { return m_create; }
- void setCreate(bool create) { m_create = create; }
- bool isExclusive() const { return m_exclusive; }
- void setExclusive(bool exclusive) { m_exclusive = exclusive; }
-
-private:
- WebKitFlags(bool create, bool exclusive)
- : m_create(create)
- , m_exclusive(exclusive)
- {
- }
- bool m_create;
- bool m_exclusive;
+ bool create;
+ bool exclusive;
};
-} // namespace
+}
#endif // ENABLE(FILE_SYSTEM)
-#endif // WebKitFlags_h
+#endif // FileSystemFlags_h
View
4 Source/WebCore/Modules/filesystem/WorkerContextFileSystem.cpp
@@ -127,9 +127,9 @@ PassRefPtr<EntrySync> WorkerContextFileSystem::webkitResolveLocalFileSystemSyncU
if (!fileSystem)
return 0;
- RefPtr<EntrySync> entry = fileSystem->root()->getDirectory(filePath, 0, ec);
+ RefPtr<EntrySync> entry = fileSystem->root()->getDirectory(filePath, Dictionary(), ec);
if (ec == FileException::TYPE_MISMATCH_ERR)
- return fileSystem->root()->getFile(filePath, 0, ec);
+ return fileSystem->root()->getFile(filePath, Dictionary(), ec);
return entry.release();
}
View
4 Source/WebCore/Target.pri
@@ -2986,13 +2986,13 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
Modules/filesystem/FileEntrySync.h \
Modules/filesystem/FileSystemCallback.h \
Modules/filesystem/FileSystemCallbacks.h \
+ Modules/filesystem/FileSystemFlags.h \
Modules/filesystem/FileWriter.h \
Modules/filesystem/FileWriterBase.h \
Modules/filesystem/FileWriterBaseCallback.h \
Modules/filesystem/FileWriterCallback.h \
Modules/filesystem/FileWriterClient.h \
Modules/filesystem/FileWriterSync.h \
- Modules/filesystem/WebKitFlags.h \
Modules/filesystem/LocalFileSystem.h \
Modules/filesystem/Metadata.h \
Modules/filesystem/MetadataCallback.h \
@@ -3001,8 +3001,6 @@ contains(DEFINES, ENABLE_FILE_SYSTEM=1) {
platform/FileMetadata.h
SOURCES += \
- bindings/js/JSDirectoryEntryCustom.cpp \
- bindings/js/JSDirectoryEntrySyncCustom.cpp \
bindings/js/JSEntryCustom.cpp \
bindings/js/JSEntrySyncCustom.cpp \
platform/AsyncFileSystem.cpp
View
2 Source/WebCore/UseJSC.cmake
@@ -250,8 +250,6 @@ ENDIF ()
if (ENABLE_FILE_SYSTEM)
LIST(APPEND WebCore_SOURCES
- bindings/js/JSDirectoryEntryCustom.cpp
- bindings/js/JSDirectoryEntrySyncCustom.cpp
bindings/js/JSEntryCustom.cpp
bindings/js/JSEntrySyncCustom.cpp
)
View
2 Source/WebCore/UseV8.cmake
@@ -94,8 +94,6 @@ LIST(APPEND WebCore_SOURCES
bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
bindings/v8/custom/V8DeviceMotionEventCustom.cpp
bindings/v8/custom/V8DeviceOrientationEventCustom.cpp
- bindings/v8/custom/V8DirectoryEntryCustom.cpp
- bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
bindings/v8/custom/V8DocumentCustom.cpp
bindings/v8/custom/V8DocumentLocationCustom.cpp
bindings/v8/custom/V8EntrySyncCustom.cpp
View
6 Source/WebCore/WebCore.gypi
@@ -1420,6 +1420,7 @@
'Modules/filesystem/EntrySync.h',
'Modules/filesystem/ErrorCallback.h',
'Modules/filesystem/FileCallback.h',
+ 'Modules/filesystem/FileSystemFlags.h',
'Modules/filesystem/FileEntry.cpp',
'Modules/filesystem/FileEntry.h',
'Modules/filesystem/FileEntrySync.cpp',
@@ -1443,7 +1444,6 @@
'Modules/filesystem/Metadata.h',
'Modules/filesystem/MetadataCallback.h',
'Modules/filesystem/SyncCallbackHelper.h',
- 'Modules/filesystem/WebKitFlags.h',
'Modules/filesystem/WorkerContextFileSystem.cpp',
'Modules/filesystem/WorkerContextFileSystem.h',
'Modules/filesystem/chromium/DOMFileSystemChromium.cpp',
@@ -1988,8 +1988,6 @@
'bindings/js/JSDesktopNotificationsCustom.cpp',
'bindings/js/JSDeviceMotionEventCustom.cpp',
'bindings/js/JSDeviceOrientationEventCustom.cpp',
- 'bindings/js/JSDirectoryEntryCustom.cpp',
- 'bindings/js/JSDirectoryEntrySyncCustom.cpp',
'bindings/js/JSDocumentCustom.cpp',
'bindings/js/JSElementCustom.cpp',
'bindings/js/JSEntryCustom.cpp',
@@ -2320,8 +2318,6 @@
'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
'bindings/v8/custom/V8DeviceMotionEventCustom.cpp',
'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
- 'bindings/v8/custom/V8DirectoryEntryCustom.cpp',
- 'bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp',
'bindings/v8/custom/V8DocumentCustom.cpp',
'bindings/v8/custom/V8DocumentLocationCustom.cpp',
'bindings/v8/custom/V8EntryCustom.cpp',
View
16 Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -24730,6 +24730,10 @@
>
</File>
<File
+ RelativePath="..\Modules\filesystem\FileSystemFlags.h"
+ >
+ </File>
+ <File
RelativePath="..\Modules\filesystem\FileSystemType.h"
>
</File>
@@ -24786,10 +24790,6 @@
>
</File>
<File
- RelativePath="..\Modules\filesystem\WebKitFlags.h"
- >
- </File>
- <File
RelativePath="..\Modules\filesystem\WorkerContextFileSystem.cpp"
>
</File>
@@ -65670,14 +65670,6 @@
>
</File>
<File
- RelativePath="..\bindings\js\JSDirectoryEntryCustom.cpp"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSDirectoryEntrySyncCustom.cpp"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSDocumentCustom.cpp"
>
<FileConfiguration
View
16 Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2944,7 +2944,6 @@
893C47BB1238A0A9002B3D86 /* JSFileWriterCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47B91238A0A9002B3D86 /* JSFileWriterCallback.cpp */; };
893C47BC1238A0A9002B3D86 /* JSFileWriterCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47BA1238A0A9002B3D86 /* JSFileWriterCallback.h */; };
893C47CC123EEBA2002B3D86 /* JSEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */; };
- 893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */; };
893C48001248BD3A002B3D86 /* DirectoryEntrySync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47F01248BD39002B3D86 /* DirectoryEntrySync.cpp */; };
893C48011248BD3A002B3D86 /* DirectoryEntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47F11248BD39002B3D86 /* DirectoryEntrySync.h */; };
893C48021248BD3A002B3D86 /* DirectoryReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47F21248BD39002B3D86 /* DirectoryReaderSync.cpp */; };
@@ -2960,7 +2959,6 @@
893C480D1248BD3A002B3D86 /* EntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47FD1248BD39002B3D86 /* EntrySync.h */; };
893C480E1248BD3A002B3D86 /* FileEntrySync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C47FE1248BD39002B3D86 /* FileEntrySync.cpp */; };
893C480F1248BD3A002B3D86 /* FileEntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C47FF1248BD39002B3D86 /* FileEntrySync.h */; };
- 893C48211249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C48201249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp */; };
893C483212495472002B3D86 /* JSDirectoryEntrySync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C482612495472002B3D86 /* JSDirectoryEntrySync.cpp */; };
893C483312495472002B3D86 /* JSDirectoryEntrySync.h in Headers */ = {isa = PBXBuildFile; fileRef = 893C482712495472002B3D86 /* JSDirectoryEntrySync.h */; };
893C483412495472002B3D86 /* JSDirectoryReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 893C482812495472002B3D86 /* JSDirectoryReaderSync.cpp */; };
@@ -2994,7 +2992,7 @@
89878563122CA064003AABDA /* FileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854A122CA064003AABDA /* FileSystemCallback.h */; };
89878564122CA064003AABDA /* FileSystemCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */; };
89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854C122CA064003AABDA /* FileSystemCallbacks.h */; };
- 89878566122CA064003AABDA /* WebKitFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854D122CA064003AABDA /* WebKitFlags.h */; };
+ 89878566122CA064003AABDA /* FileSystemFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854D122CA064003AABDA /* FileSystemFlags.h */; };
89878567122CA064003AABDA /* LocalFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987854E122CA064003AABDA /* LocalFileSystem.cpp */; };
89878568122CA064003AABDA /* LocalFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854F122CA064003AABDA /* LocalFileSystem.h */; };
89878569122CA064003AABDA /* Metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878550122CA064003AABDA /* Metadata.h */; };
@@ -10073,7 +10071,6 @@
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>"; };
893C47CA123EEBA2002B3D86 /* JSEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryCustom.cpp; sourceTree = "<group>"; };
- 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntryCustom.cpp; sourceTree = "<group>"; };
893C47F01248BD39002B3D86 /* DirectoryEntrySync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DirectoryEntrySync.cpp; path = Modules/filesystem/DirectoryEntrySync.cpp; sourceTree = "<group>"; };
893C47F11248BD39002B3D86 /* DirectoryEntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryEntrySync.h; path = Modules/filesystem/DirectoryEntrySync.h; sourceTree = "<group>"; };
893C47F21248BD39002B3D86 /* DirectoryReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DirectoryReaderSync.cpp; path = Modules/filesystem/DirectoryReaderSync.cpp; sourceTree = "<group>"; };
@@ -10089,7 +10086,6 @@
893C47FD1248BD39002B3D86 /* EntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntrySync.h; path = Modules/filesystem/EntrySync.h; sourceTree = "<group>"; };
893C47FE1248BD39002B3D86 /* FileEntrySync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileEntrySync.cpp; path = Modules/filesystem/FileEntrySync.cpp; sourceTree = "<group>"; };
893C47FF1248BD39002B3D86 /* FileEntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileEntrySync.h; path = Modules/filesystem/FileEntrySync.h; sourceTree = "<group>"; };
- 893C48201249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntrySyncCustom.cpp; sourceTree = "<group>"; };
893C482612495472002B3D86 /* JSDirectoryEntrySync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntrySync.cpp; sourceTree = "<group>"; };
893C482712495472002B3D86 /* JSDirectoryEntrySync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryEntrySync.h; sourceTree = "<group>"; };
893C482812495472002B3D86 /* JSDirectoryReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryReaderSync.cpp; sourceTree = "<group>"; };
@@ -10123,7 +10119,7 @@
8987854A122CA064003AABDA /* FileSystemCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemCallback.h; path = Modules/filesystem/FileSystemCallback.h; sourceTree = "<group>"; };
8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSystemCallbacks.cpp; path = Modules/filesystem/FileSystemCallbacks.cpp; sourceTree = "<group>"; };
8987854C122CA064003AABDA /* FileSystemCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemCallbacks.h; path = Modules/filesystem/FileSystemCallbacks.h; sourceTree = "<group>"; };
- 8987854D122CA064003AABDA /* WebKitFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebKitFlags.h; path = Modules/filesystem/WebKitFlags.h; sourceTree = "<group>"; };
+ 8987854D122CA064003AABDA /* FileSystemFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemFlags.h; path = Modules/filesystem/FileSystemFlags.h; sourceTree = "<group>"; };
8987854E122CA064003AABDA /* LocalFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LocalFileSystem.cpp; path = Modules/filesystem/LocalFileSystem.cpp; sourceTree = "<group>"; };
8987854F122CA064003AABDA /* LocalFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LocalFileSystem.h; path = Modules/filesystem/LocalFileSystem.h; sourceTree = "<group>"; };
89878550122CA064003AABDA /* Metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Metadata.h; path = Modules/filesystem/Metadata.h; sourceTree = "<group>"; };
@@ -17855,6 +17851,7 @@
E1AB1EBE14E9E3B200449E13 /* FileSystemCallback.idl */,
8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */,
8987854C122CA064003AABDA /* FileSystemCallbacks.h */,
+ 8987854D122CA064003AABDA /* FileSystemFlags.h */,
89C7C2E0155804F4007D5A7B /* FileSystemType.h */,
976D6C6E122B8A3D001FD1F7 /* FileThread.cpp */,
976D6C6F122B8A3D001FD1F7 /* FileThread.h */,
@@ -17881,7 +17878,6 @@
976D6C5C122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp */,
976D6C5D122B8A3D001FD1F7 /* WebKitBlobBuilder.h */,
E1AB1EC314E9E3E200449E13 /* WebKitBlobBuilder.idl */,
- 8987854D122CA064003AABDA /* WebKitFlags.h */,
);
name = fileapi;
sourceTree = "<group>";
@@ -20234,8 +20230,6 @@
33503CBF10179C1A003B47E1 /* JSDesktopNotificationsCustom.cpp */,
31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */,
590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
- 893C47DE123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp */,
- 893C48201249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp */,
49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */,
22885E631301AE4C00526E68 /* JSDOMImplementationCustom.cpp */,
@@ -23274,6 +23268,7 @@
514B3F730C722047000530DF /* FileSystem.h in Headers */,
89878563122CA064003AABDA /* FileSystemCallback.h in Headers */,
89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */,
+ 89878566122CA064003AABDA /* FileSystemFlags.h in Headers */,
26C17A3E1491D2D400D12BA2 /* FileSystemIOS.h in Headers */,
89C7C2E1155804F4007D5A7B /* FileSystemType.h in Headers */,
976D6C8E122B8A3D001FD1F7 /* FileThread.h in Headers */,
@@ -25295,7 +25290,6 @@
29CD61DE146D02890068E82A /* WebKitCSSShaderValue.h in Headers */,
0562F9471573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h in Headers */,
BC9ADD230CC4032600098C4C /* WebKitCSSTransformValue.h in Headers */,
- 89878566122CA064003AABDA /* WebKitFlags.h in Headers */,
12F35EB6158745A40035CB63 /* WebKitNamedFlowCollection.h in Headers */,
494BD7950F55C8EE00747828 /* WebKitPoint.h in Headers */,
31C0FF250E4CEB6E007D6FE5 /* WebKitTransitionEvent.h in Headers */,
@@ -26937,9 +26931,7 @@
590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
BCE438A2140C0DC0005E437E /* JSDictionary.cpp in Sources */,
8987858A122CA26A003AABDA /* JSDirectoryEntry.cpp in Sources */,
- 893C47DF123EF4A9002B3D86 /* JSDirectoryEntryCustom.cpp in Sources */,
893C483212495472002B3D86 /* JSDirectoryEntrySync.cpp in Sources */,
- 893C48211249535B002B3D86 /* JSDirectoryEntrySyncCustom.cpp in Sources */,
8987858C122CA26A003AABDA /* JSDirectoryReader.cpp in Sources */,
893C483412495472002B3D86 /* JSDirectoryReaderSync.cpp in Sources */,
659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */,
View
146 Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
@@ -1,146 +0,0 @@
-/*
- * 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 "ExceptionCode.h"
-#include "JSDOMBinding.h"
-#include "JSEntryCallback.h"
-#include "JSErrorCallback.h"
-#include <runtime/Error.h>
-#include <wtf/Assertions.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSDirectoryEntry::getFile(ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return throwError(exec, createNotEnoughArgumentsError(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<WebKitFlags> flags;
- if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject()) {
- JSObject* object = exec->argument(1).getObject();
- flags = WebKitFlags::create();
- JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
- flags->setCreate(jsCreate.toBoolean());
- JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
- flags->setExclusive(jsExclusive.toBoolean());
- }
- 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)
-{
- if (exec->argumentCount() < 1)
- return throwError(exec, createNotEnoughArgumentsError(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<WebKitFlags> flags;
- if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject()) {
- JSObject* object = exec->argument(1).getObject();
- flags = WebKitFlags::create();
- JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
- flags->setCreate(jsCreate.toBoolean());
- JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
- flags->setExclusive(jsExclusive.toBoolean());
- }
- 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)
View
98 Source/WebCore/bindings/js/JSDirectoryEntrySyncCustom.cpp
@@ -1,98 +0,0 @@
-/*
- * 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 "JSDirectoryEntrySync.h"
-
-#include "JSDOMBinding.h"
-#include "JSEntryCallback.h"
-#include "JSErrorCallback.h"
-#include "JSFileEntrySync.h"
-#include <wtf/Assertions.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-static PassRefPtr<WebKitFlags> getFlags(ExecState* exec, const JSValue& argument)
-{
- if (argument.isNull() || argument.isUndefined() || !argument.isObject())
- return 0;
-
- RefPtr<WebKitFlags> flags;
- JSObject* object = argument.getObject();
- flags = WebKitFlags::create();
- JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
- flags->setCreate(jsCreate.toBoolean());
- JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
- flags->setExclusive(jsExclusive.toBoolean());
- return flags;
-}
-
-JSValue JSDirectoryEntrySync::getFile(ExecState* exec)
-{
- DirectoryEntrySync* imp = static_cast<DirectoryEntrySync*>(impl());
- const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<WebKitFlags> flags = getFlags(exec, exec->argument(1));
- if (exec->hadException())
- return jsUndefined();
-
- ExceptionCode ec = 0;
- JSC::JSValue result = toJS(exec, this->globalObject(), WTF::getPtr(imp->getFile(path, flags, ec)));
- setDOMException(exec, ec);
- return result;
-}
-
-JSValue JSDirectoryEntrySync::getDirectory(ExecState* exec)
-{
- DirectoryEntrySync* imp = static_cast<DirectoryEntrySync*>(impl());
- const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
- if (exec->hadException())
- return jsUndefined();
-
- RefPtr<WebKitFlags> flags = getFlags(exec, exec->argument(1));
- if (exec->hadException())
- return jsUndefined();
-
- ExceptionCode ec = 0;
- JSC::JSValue result = toJS(exec, this->globalObject(), WTF::getPtr(imp->getDirectory(path, flags, ec)));
- setDOMException(exec, ec);
- return result;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(FILE_SYSTEM)
View
139 Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
@@ -1,139 +0,0 @@
-/*
- * 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 "V8EntryCallback.h"
-#include "V8ErrorCallback.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());
-
- if (args.Length() < 1)
- return throwNotEnoughArgumentsError(args.GetIsolate());
-
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
- if (args.Length() <= 1) {
- imp->getDirectory(path);
- return v8Undefined();
- }
- RefPtr<WebKitFlags> flags;
- if (!isUndefinedOrNull(args[1]) && args[1]->IsObject()) {
- 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"));
- 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);
- }
- }
- RefPtr<EntryCallback> successCallback;
- if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
- if (!args[2]->IsObject())
- return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
- }
- RefPtr<ErrorCallback> errorCallback;
- if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
- if (!args[3]->IsObject())
- return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
- }
- imp->getDirectory(path, flags, successCallback, errorCallback);
- return v8Undefined();
-}
-
-v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DirectoryEntry.getFile");
- DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
-
- if (args.Length() < 1)
- return throwNotEnoughArgumentsError(args.GetIsolate());
-
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
- if (args.Length() <= 1) {
- imp->getFile(path);
- return v8Undefined();
- }
- RefPtr<WebKitFlags> flags;
- if (!isUndefinedOrNull(args[1]) && args[1]->IsObject()) {
- 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"));
- 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);
- }
- }
- RefPtr<EntryCallback> successCallback;
- if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
- if (!args[2]->IsObject())
- return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
- }
- RefPtr<ErrorCallback> errorCallback;
- if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
- if (!args[3]->IsObject())
- return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
- errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
- }
- imp->getFile(path, flags, successCallback, errorCallback);
- return v8Undefined();
-}
-
-
-
-} // namespace WebCore
-
-#endif // ENABLE(FILE_SYSTEM)
View
127 Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
@@ -1,127 +0,0 @@
-/*
- * 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 "V8DirectoryEntrySync.h"
-
-#if ENABLE(FILE_SYSTEM)
-
-#include "DirectoryEntrySync.h"
-#include "ExceptionCode.h"
-#include "V8Binding.h"
-#include "V8EntryCallback.h"
-#include "V8ErrorCallback.h"
-#include "V8FileEntrySync.h"
-#include "V8Proxy.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-static bool extractBooleanValue(const v8::Handle<v8::Object>& object, const char* name, ExceptionCode& ec) {
- ec = 0;
- v8::Local<v8::Value> value = object->Get(v8::String::New(name));
- if (!value.IsEmpty() && !isUndefinedOrNull(value)) {
- v8::TryCatch block;
- bool nativeValue = value->BooleanValue();
- if (block.HasCaught()) {
- ec = TYPE_MISMATCH_ERR;
- return false;
- }
- return nativeValue;
- }
- return false;
-}
-
-static PassRefPtr<WebKitFlags> getFlags(const v8::Local<v8::Value>& arg, ExceptionCode& ec)
-{
- ec = 0;
- if (isUndefinedOrNull(arg) || !arg->IsObject())
- return 0;
-
- v8::Handle<v8::Object> object;
- {
- v8::TryCatch block;
- object = v8::Handle<v8::Object>::Cast(arg);
- if (block.HasCaught()) {
- ec = TYPE_MISMATCH_ERR;
- return 0;
- }
- }
-
- bool isCreate = extractBooleanValue(object, "create", ec);
- if (ec)
- return 0;
- bool isExclusive = extractBooleanValue(object, "exclusive", ec);
- if (ec)
- return 0;
-
- RefPtr<WebKitFlags> flags = WebKitFlags::create();
- flags->setCreate(isCreate);
- flags->setExclusive(isExclusive);
-
- return flags;
-}
-
-v8::Handle<v8::Value> V8DirectoryEntrySync::getDirectoryCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DirectoryEntrySync.getDirectory");
- DirectoryEntrySync* imp = V8DirectoryEntrySync::toNative(args.Holder());
- ExceptionCode ec = 0;
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, path, args[0]);
- RefPtr<WebKitFlags> flags = getFlags(args[1], ec);
- if (UNLIKELY(ec))
- return setDOMException(ec, args.GetIsolate());
- RefPtr<DirectoryEntrySync> result = imp->getDirectory(path, flags, ec);
- if (UNLIKELY(ec))
- return setDOMException(ec, args.GetIsolate());
- return toV8(result.release(), args.GetIsolate());
-}
-
-v8::Handle<v8::Value> V8DirectoryEntrySync::getFileCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.DirectoryEntrySync.getFile");
- DirectoryEntrySync* imp = V8DirectoryEntrySync::toNative(args.Holder());
- ExceptionCode ec = 0;
- STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, path, args[0]);
- RefPtr<WebKitFlags> flags = getFlags(args[1], ec);
- if (UNLIKELY(ec))
- return setDOMException(ec, args.GetIsolate());
- RefPtr<FileEntrySync> result = imp->getFile(path, flags, ec);
- if (UNLIKELY(ec))
- return setDOMException(ec, args.GetIsolate());
- return toV8(result.release(), args.GetIsolate());
-}
-
-
-
-} // namespace WebCore
-
-#endif // ENABLE(FILE_SYSTEM)

0 comments on commit 609e1d5

Please sign in to comment.