[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 12:53:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e2e9778104b4b3d138c561c5a68de212ff4f11ec
Author: kinuko at chromium.org <kinuko at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 1 03:27:01 2010 +0000
2010-08-31 Kinuko Yasuda <kinuko at chromium.org>
Reviewed by Jian Li.
Add LocalFileSystem.requestFileSystem interface to DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=44734
* public/WebRuntimeFeatures.h:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableFileSystem):
(WebKit::WebRuntimeFeatures::isFileSystemEnabled):
2010-08-31 Kinuko Yasuda <kinuko at chromium.org>
Reviewed by Jian Li.
Add LocalFileSystem.requestFileSystem interface to DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=44734
No new tests; tests will be added later.
* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::fileSystemEnabled):
(WebCore::RuntimeEnabledFeatures::setFileSystemEnabled):
(WebCore::RuntimeEnabledFeatures::requestFileSystemEnabled):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::requestFileSystem):
* page/DOMWindow.h:
(WebCore::DOMWindow::):
* page/DOMWindow.idl:
* page/Settings.cpp:
(WebCore::Settings::setFileSystemRootPath):
* page/Settings.h:
(WebCore::Settings::fileSystemRootPath):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ad60ba6..c6dddf8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-08-31 Kinuko Yasuda <kinuko at chromium.org>
+
+ Reviewed by Jian Li.
+
+ Add LocalFileSystem.requestFileSystem interface to DOMWindow
+ https://bugs.webkit.org/show_bug.cgi?id=44734
+
+ No new tests; tests will be added later.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::fileSystemEnabled):
+ (WebCore::RuntimeEnabledFeatures::setFileSystemEnabled):
+ (WebCore::RuntimeEnabledFeatures::requestFileSystemEnabled):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::requestFileSystem):
+ * page/DOMWindow.h:
+ (WebCore::DOMWindow::):
+ * page/DOMWindow.idl:
+ * page/Settings.cpp:
+ (WebCore::Settings::setFileSystemRootPath):
+ * page/Settings.h:
+ (WebCore::Settings::fileSystemRootPath):
+
2010-08-31 Kwang Yul Seo <skyul at company100.net>
Reviewed by Adam Barth.
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index 66de0f9..a15fd6d 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -55,6 +55,10 @@ bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
bool RuntimeEnabledFeatures::isXHRResponseBlobEnabled = false;
#endif
+#if ENABLE(FILE_SYSTEM)
+bool RuntimeEnabledFeatures::isFileSystemEnabled = false;
+#endif
+
#if ENABLE(VIDEO)
bool RuntimeEnabledFeatures::audioEnabled()
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index cc55364..fb43f3f 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -135,6 +135,12 @@ public:
static bool asBlobEnabled() { return isXHRResponseBlobEnabled; }
#endif
+#if ENABLE(FILE_SYSTEM)
+ static bool fileSystemEnabled() { return isFileSystemEnabled; }
+ static void setFileSystemEnabled(bool isEnabled) { isFileSystemEnabled = isEnabled; }
+ static bool requestFileSystemEnabled() { return isFileSystemEnabled; }
+#endif
+
private:
// Never instantiate.
RuntimeEnabledFeatures() { }
@@ -154,6 +160,10 @@ private:
#if ENABLE(XHR_RESPONSE_BLOB)
static bool isXHRResponseBlobEnabled;
#endif
+
+#if ENABLE(FILE_SYSTEM)
+ static bool isFileSystemEnabled;
+#endif
};
} // namespace WebCore
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index a6e8b40..efb82bb 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -88,6 +88,15 @@
#include <wtf/MathExtras.h>
#include <wtf/text/CString.h>
+#if ENABLE(FILE_SYSTEM)
+#include "AsyncFileSystem.h"
+#include "DOMFileSystem.h"
+#include "ErrorCallback.h"
+#include "FileError.h"
+#include "FileSystemCallback.h"
+#include "LocalFileSystem.h"
+#endif
+
using std::min;
using std::max;
@@ -721,6 +730,35 @@ IDBKeyRange* DOMWindow::iDBKeyRange() const
}
#endif
+#if ENABLE(FILE_SYSTEM)
+void DOMWindow::requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+{
+ Document* document = this->document();
+ if (!document)
+ return;
+
+ if (!m_localFileSystem) {
+ // FIXME: See if access is allowed.
+
+ Page* page = document->page();
+ if (!page) {
+ DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(INVALID_STATE_ERR));
+ return;
+ }
+
+ // FIXME: Get the quota settings as well.
+ String path = page->settings()->fileSystemRootPath();
+ m_localFileSystem = LocalFileSystem::create(path);
+ }
+
+ m_localFileSystem->requestFileSystem(document, static_cast<AsyncFileSystem::Type>(type), size, successCallback, errorCallback);
+}
+
+COMPILE_ASSERT(int(DOMWindow::TEMPORARY) == int(AsyncFileSystem::Temporary), enum_mismatch);
+COMPILE_ASSERT(int(DOMWindow::PERSISTENT) == int(AsyncFileSystem::Persistent), enum_mismatch);
+
+#endif
+
void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
{
MessagePortArray ports;
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index 9a6315f..894aa08 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -49,14 +49,17 @@ namespace WebCore {
class DatabaseCallback;
class Document;
class Element;
+ class ErrorCallback;
class Event;
class EventListener;
+ class FileSystemCallback;
class FloatRect;
class Frame;
class History;
class IDBFactory;
class IDBKeyRange;
class InspectorTimelineAgent;
+ class LocalFileSystem;
class Location;
class StyleMedia;
class Navigator;
@@ -238,6 +241,15 @@ namespace WebCore {
IDBKeyRange* iDBKeyRange() const;
#endif
+#if ENABLE(FILE_SYSTEM)
+ // They are placed here and in all capital letters to enforce compile-time enum checking.
+ enum FileSystemType {
+ TEMPORARY,
+ PERSISTENT,
+ };
+ void requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
+#endif
+
void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, const String& targetOrigin, DOMWindow* source, ExceptionCode&);
// FIXME: remove this when we update the ObjC bindings (bug #28774).
void postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort*, const String& targetOrigin, DOMWindow* source, ExceptionCode&);
@@ -435,6 +447,9 @@ namespace WebCore {
mutable RefPtr<IDBFactory> m_idbFactory;
mutable RefPtr<IDBKeyRange> m_idbKeyRange;
#endif
+#if ENABLE(FILE_SYSTEM)
+ RefPtr<LocalFileSystem> m_localFileSystem;
+#endif
EventTargetData m_eventTargetData;
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 84c2108..c775ae6 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -176,6 +176,11 @@ module window {
readonly attribute [EnabledAtRuntime] IDBFactory indexedDB;
readonly attribute [EnabledAtRuntime] IDBKeyRange IDBKeyRange;
#endif
+#if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM
+ const unsigned short TEMPORARY = 0;
+ const unsigned short PERSISTENT = 1;
+ [EnabledAtRuntime] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
+#endif
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
// This is the interface orientation in degrees. Some examples are:
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 10e6f3e..36bcce2 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -483,6 +483,11 @@ void Settings::setLocalStorageDatabasePath(const String& path)
m_localStorageDatabasePath = path;
}
+void Settings::setFileSystemRootPath(const String& path)
+{
+ m_fileSystemRootPath = path;
+}
+
void Settings::setApplicationChromeMode(bool mode)
{
m_inApplicationChromeMode = mode;
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 693cc54..0bb55f6 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -239,7 +239,10 @@ namespace WebCore {
void setLocalStorageDatabasePath(const String&);
const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; }
-
+
+ void setFileSystemRootPath(const String&);
+ const String& fileSystemRootPath() const { return m_fileSystemRootPath; }
+
void setApplicationChromeMode(bool);
bool inApplicationChromeMode() const { return m_inApplicationChromeMode; }
@@ -328,10 +331,11 @@ namespace WebCore {
private:
Page* m_page;
-
+
String m_defaultTextEncodingName;
String m_ftpDirectoryTemplatePath;
String m_localStorageDatabasePath;
+ String m_fileSystemRootPath;
KURL m_userStyleSheetLocation;
AtomicString m_standardFontFamily;
AtomicString m_fixedFontFamily;
@@ -412,7 +416,7 @@ namespace WebCore {
#endif
bool m_memoryInfoEnabled: 1;
bool m_interactiveFormValidation: 1;
-
+
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
#endif
diff --git a/WebCore/storage/FileSystemCallbacks.cpp b/WebCore/storage/FileSystemCallbacks.cpp
index 1dd9725..741df78 100644
--- a/WebCore/storage/FileSystemCallbacks.cpp
+++ b/WebCore/storage/FileSystemCallbacks.cpp
@@ -34,6 +34,7 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
+#include "DOMFilePath.h"
#include "DOMFileSystem.h"
#include "DirectoryEntry.h"
#include "EntriesCallback.h"
@@ -132,14 +133,17 @@ EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback,
void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirectory)
{
+ if (!m_entries)
+ m_entries = EntryArray::create();
if (isDirectory)
- m_entries->append(DirectoryEntry::create(m_fileSystem, m_basePath + "/" + name));
+ m_entries->append(DirectoryEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name)));
else
- m_entries->append(FileEntry::create(m_fileSystem, m_basePath + "/" + name));
+ m_entries->append(FileEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name)));
}
void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
{
+ ASSERT(m_entries);
if (m_successCallback) {
m_successCallback->handleEvent(m_entries.get());
m_entries->clear();
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 1f5b2f7..1979c5b 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-31 Kinuko Yasuda <kinuko at chromium.org>
+
+ Reviewed by Jian Li.
+
+ Add LocalFileSystem.requestFileSystem interface to DOMWindow
+ https://bugs.webkit.org/show_bug.cgi?id=44734
+
+ * public/WebRuntimeFeatures.h:
+ * src/WebRuntimeFeatures.cpp:
+ (WebKit::WebRuntimeFeatures::enableFileSystem):
+ (WebKit::WebRuntimeFeatures::isFileSystemEnabled):
+
2010-08-24 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Steve Block.
diff --git a/WebKit/chromium/public/WebRuntimeFeatures.h b/WebKit/chromium/public/WebRuntimeFeatures.h
index e282864..5537ee2 100644
--- a/WebKit/chromium/public/WebRuntimeFeatures.h
+++ b/WebKit/chromium/public/WebRuntimeFeatures.h
@@ -89,6 +89,9 @@ public:
WEBKIT_API static void enableXHRResponseBlob(bool);
WEBKIT_API static bool isXHRResponseBlobEnabled();
+ WEBKIT_API static void enableFileSystem(bool);
+ WEBKIT_API static bool isFileSystemEnabled();
+
private:
WebRuntimeFeatures();
};
diff --git a/WebKit/chromium/src/WebRuntimeFeatures.cpp b/WebKit/chromium/src/WebRuntimeFeatures.cpp
index 9e1e4de..2279eeb 100644
--- a/WebKit/chromium/src/WebRuntimeFeatures.cpp
+++ b/WebKit/chromium/src/WebRuntimeFeatures.cpp
@@ -272,4 +272,20 @@ bool WebRuntimeFeatures::isXHRResponseBlobEnabled()
#endif
}
+void WebRuntimeFeatures::enableFileSystem(bool enable)
+{
+#if ENABLE(FILE_SYSTEM)
+ RuntimeEnabledFeatures::setFileSystemEnabled(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isFileSystemEnabled()
+{
+#if ENABLE(FILE_SYSTEM)
+ return RuntimeEnabledFeatures::fileSystemEnabled();
+#else
+ return false;
+#endif
+}
+
} // namespace WebKit
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list