Diff
Modified: trunk/Source/WebCore/ChangeLog (106541 => 106542)
--- trunk/Source/WebCore/ChangeLog 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/ChangeLog 2012-02-02 09:31:21 UTC (rev 106542)
@@ -1,3 +1,36 @@
+2012-02-02 Kinuko Yasuda <[email protected]>
+
+ Cleanup: Move chrome-specific filesystem type handling code (for FileSystem API) under chromium directory (re-landing r105395)
+ https://bugs.webkit.org/show_bug.cgi?id=76551
+
+ Reviewed by David Levin.
+
+ Moved the implementation of crackFileSystemURL() and toURL() from
+ WebCore/fileapi/DOMFileSystemBase into WebCore/platform/AsyncFileSystem
+ so that each platform can extend/implement their behavior if necessary.
+
+ No new tests as it has no functional changes.
+
+ * fileapi/DOMFileSystemBase.cpp: Moved crackFileSystemURL() to AsyncFileSystem.
+ * fileapi/DOMFileSystemBase.h:
+ (DOMFileSystemBase):
+ * fileapi/EntryBase.cpp: Moved toURL() to AsyncFileSystem.
+ (WebCore::EntryBase::toURL):
+ * page/DOMWindow.cpp: Made corresponding callsite changes.
+ (WebCore::DOMWindow::webkitRequestFileSystem):
+ (WebCore::DOMWindow::webkitResolveLocalFileSystemURL):
+ * page/DOMWindow.h:
+ * platform/AsyncFileSystem.cpp:
+ (WebCore::AsyncFileSystem::isValidType): Added.
+ * platform/AsyncFileSystem.h:
+ (AsyncFileSystem):
+ * workers/WorkerContext.cpp: Made corresponding callsite changes.
+ (WebCore::WorkerContext::webkitRequestFileSystem):
+ (WebCore::WorkerContext::webkitRequestFileSystemSync):
+ (WebCore::WorkerContext::webkitResolveLocalFileSystemURL):
+ (WebCore::WorkerContext::webkitResolveLocalFileSystemSyncURL):
+ * workers/WorkerContext.h:
+
2012-02-02 Yury Semikhatsky <[email protected]>
Web Inspector: pause on uncaugh exceptions state is not properly restored
Modified: trunk/Source/WebCore/fileapi/DOMFileSystemBase.cpp (106541 => 106542)
--- trunk/Source/WebCore/fileapi/DOMFileSystemBase.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/fileapi/DOMFileSystemBase.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -50,43 +50,6 @@
namespace WebCore {
-const char DOMFileSystemBase::kPersistentPathPrefix[] = "persistent";
-const size_t DOMFileSystemBase::kPersistentPathPrefixLength = sizeof(DOMFileSystemBase::kPersistentPathPrefix) - 1;
-const char DOMFileSystemBase::kTemporaryPathPrefix[] = "temporary";
-const size_t DOMFileSystemBase::kTemporaryPathPrefixLength = sizeof(DOMFileSystemBase::kTemporaryPathPrefix) - 1;
-const char DOMFileSystemBase::kExternalPathPrefix[] = "external";
-const size_t DOMFileSystemBase::kExternalPathPrefixLength = sizeof(DOMFileSystemBase::kExternalPathPrefix) - 1;
-
-bool DOMFileSystemBase::crackFileSystemURL(const KURL& url, AsyncFileSystem::Type& type, String& filePath)
-{
- if (!url.protocolIs("filesystem"))
- return false;
-
- KURL originURL(ParsedURLString, url.path());
- String path = decodeURLEscapeSequences(originURL.path());
- if (path.isEmpty() || path[0] != '/')
- return false;
- path = path.substring(1);
-
- if (path.startsWith(kTemporaryPathPrefix)) {
- type = AsyncFileSystem::Temporary;
- path = path.substring(kTemporaryPathPrefixLength);
- } else if (path.startsWith(kPersistentPathPrefix)) {
- type = AsyncFileSystem::Persistent;
- path = path.substring(kPersistentPathPrefixLength);
- } else if (path.startsWith(kExternalPathPrefix)) {
- type = AsyncFileSystem::External;
- path = path.substring(kExternalPathPrefixLength);
- } else
- return false;
-
- if (path.isEmpty() || path[0] != '/')
- return false;
-
- filePath.swap(path);
- return true;
-}
-
DOMFileSystemBase::DOMFileSystemBase(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem)
: m_context(context)
, m_name(name)
Modified: trunk/Source/WebCore/fileapi/DOMFileSystemBase.h (106541 => 106542)
--- trunk/Source/WebCore/fileapi/DOMFileSystemBase.h 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/fileapi/DOMFileSystemBase.h 2012-02-02 09:31:21 UTC (rev 106542)
@@ -62,14 +62,6 @@
}
virtual ~DOMFileSystemBase();
- static const char kPersistentPathPrefix[];
- static const size_t kPersistentPathPrefixLength;
- static const char kTemporaryPathPrefix[];
- static const size_t kTemporaryPathPrefixLength;
- static const char kExternalPathPrefix[];
- static const size_t kExternalPathPrefixLength;
- static bool crackFileSystemURL(const KURL&, AsyncFileSystem::Type&, String& filePath);
-
const String& name() const { return m_name; }
AsyncFileSystem* asyncFileSystem() const { return m_asyncFileSystem.get(); }
SecurityOrigin* securityOrigin() const;
Modified: trunk/Source/WebCore/fileapi/EntryBase.cpp (106541 => 106542)
--- trunk/Source/WebCore/fileapi/EntryBase.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/fileapi/EntryBase.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -56,27 +56,7 @@
String EntryBase::toURL()
{
- String originString = m_fileSystem->securityOrigin()->toString();
- ASSERT(!originString.isEmpty());
- if (originString == "null")
- return String();
- StringBuilder result;
- result.append("filesystem:");
- result.append(originString);
- result.append("/");
- switch (m_fileSystem->asyncFileSystem()->type()) {
- case AsyncFileSystem::Temporary:
- result.append(DOMFileSystemBase::kTemporaryPathPrefix);
- break;
- case AsyncFileSystem::Persistent:
- result.append(DOMFileSystemBase::kPersistentPathPrefix);
- break;
- case AsyncFileSystem::External:
- result.append(DOMFileSystemBase::kExternalPathPrefix);
- break;
- }
- result.append(encodeWithURLEscapeSequences(m_fullPath));
- return result.toString();
+ return m_fileSystem->asyncFileSystem()->toURL(m_fileSystem->securityOrigin()->toString(), m_fullPath);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (106541 => 106542)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -105,7 +105,6 @@
#if ENABLE(FILE_SYSTEM)
#include "AsyncFileSystem.h"
#include "DOMFileSystem.h"
-#include "DOMFileSystemBase.h"
#include "EntryCallback.h"
#include "ErrorCallback.h"
#include "FileError.h"
@@ -772,7 +771,7 @@
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
- if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent && fileSystemType != AsyncFileSystem::External) {
+ if (!AsyncFileSystem::isValidType(fileSystemType)) {
DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
@@ -798,7 +797,7 @@
AsyncFileSystem::Type type;
String filePath;
- if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) {
+ if (!completedURL.isValid() || !AsyncFileSystem::crackFileSystemURL(completedURL, type, filePath)) {
DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::ENCODING_ERR));
return;
}
@@ -806,8 +805,6 @@
LocalFileSystem::localFileSystem().readFileSystem(document, type, ResolveURICallbacks::create(successCallback, errorCallback, document, filePath));
}
-COMPILE_ASSERT(static_cast<int>(DOMWindow::EXTERNAL) == static_cast<int>(AsyncFileSystem::External), enum_mismatch);
-
COMPILE_ASSERT(static_cast<int>(DOMWindow::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);
COMPILE_ASSERT(static_cast<int>(DOMWindow::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);
Modified: trunk/Source/WebCore/page/DOMWindow.h (106541 => 106542)
--- trunk/Source/WebCore/page/DOMWindow.h 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/page/DOMWindow.h 2012-02-02 09:31:21 UTC (rev 106542)
@@ -370,7 +370,6 @@
enum FileSystemType {
TEMPORARY,
PERSISTENT,
- EXTERNAL,
};
void webkitRequestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
void webkitResolveLocalFileSystemURL(const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
Modified: trunk/Source/WebCore/platform/AsyncFileSystem.cpp (106541 => 106542)
--- trunk/Source/WebCore/platform/AsyncFileSystem.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/platform/AsyncFileSystem.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -39,6 +39,11 @@
namespace WebCore {
+const char AsyncFileSystem::persistentPathPrefix[] = "persistent";
+const size_t AsyncFileSystem::persistentPathPrefixLength = sizeof(AsyncFileSystem::persistentPathPrefix) - 1;
+const char AsyncFileSystem::temporaryPathPrefix[] = "temporary";
+const size_t AsyncFileSystem::temporaryPathPrefixLength = sizeof(AsyncFileSystem::temporaryPathPrefix) - 1;
+
#if !PLATFORM(CHROMIUM)
bool AsyncFileSystem::isAvailable()
{
@@ -46,6 +51,11 @@
return false;
}
+bool AsyncFileSystem::isValidType(Type type)
+{
+ return type == Temporary || type == Persistent;
+}
+
PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create(Type, const String&)
{
notImplemented();
Modified: trunk/Source/WebCore/platform/AsyncFileSystem.h (106541 => 106542)
--- trunk/Source/WebCore/platform/AsyncFileSystem.h 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/platform/AsyncFileSystem.h 2012-02-02 09:31:21 UTC (rev 106542)
@@ -54,14 +54,26 @@
enum Type {
Temporary,
Persistent,
- External,
};
+ // Path prefixes that are used in the filesystem URLs (that can be obtained by toURL()).
+ // http://www.w3.org/TR/file-system-api/#widl-Entry-toURL
+ static const char persistentPathPrefix[];
+ static const size_t persistentPathPrefixLength;
+ static const char temporaryPathPrefix[];
+ static const size_t temporaryPathPrefixLength;
+
virtual void stop() { }
virtual bool hasPendingActivity() { return false; }
static bool isAvailable();
+ static bool isValidType(Type);
+
+ static bool crackFileSystemURL(const KURL&, Type&, String& filePath);
+
+ virtual String toURL(const String& originString, const String& fullPath) = 0;
+
// Subclass must implement this if it supports synchronous operations.
// This should return false if there are no pending operations.
virtual bool waitForOperationToComplete() { return false; }
Modified: trunk/Source/WebCore/workers/WorkerContext.cpp (106541 => 106542)
--- trunk/Source/WebCore/workers/WorkerContext.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/workers/WorkerContext.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -395,7 +395,7 @@
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
- if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent && fileSystemType != AsyncFileSystem::External) {
+ if (!AsyncFileSystem::isValidType(fileSystemType)) {
DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
@@ -412,7 +412,7 @@
}
AsyncFileSystem::Type fileSystemType = static_cast<AsyncFileSystem::Type>(type);
- if (fileSystemType != AsyncFileSystem::Temporary && fileSystemType != AsyncFileSystem::Persistent && fileSystemType != AsyncFileSystem::External) {
+ if (!AsyncFileSystem::isValidType(fileSystemType)) {
ec = FileException::INVALID_MODIFICATION_ERR;
return 0;
}
@@ -432,7 +432,7 @@
AsyncFileSystem::Type type;
String filePath;
- if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) {
+ if (!completedURL.isValid() || !AsyncFileSystem::crackFileSystemURL(completedURL, type, filePath)) {
DOMFileSystem::scheduleCallback(this, errorCallback, FileError::create(FileError::ENCODING_ERR));
return;
}
@@ -451,7 +451,7 @@
AsyncFileSystem::Type type;
String filePath;
- if (!completedURL.isValid() || !DOMFileSystemBase::crackFileSystemURL(completedURL, type, filePath)) {
+ if (!completedURL.isValid() || !AsyncFileSystem::crackFileSystemURL(completedURL, type, filePath)) {
ec = FileException::ENCODING_ERR;
return 0;
}
@@ -471,7 +471,6 @@
COMPILE_ASSERT(static_cast<int>(WorkerContext::TEMPORARY) == static_cast<int>(AsyncFileSystem::Temporary), enum_mismatch);
COMPILE_ASSERT(static_cast<int>(WorkerContext::PERSISTENT) == static_cast<int>(AsyncFileSystem::Persistent), enum_mismatch);
-COMPILE_ASSERT(static_cast<int>(WorkerContext::EXTERNAL) == static_cast<int>(AsyncFileSystem::External), enum_mismatch);
#endif
WorkerContext::Observer::Observer(WorkerContext* context)
Modified: trunk/Source/WebCore/workers/WorkerContext.h (106541 => 106542)
--- trunk/Source/WebCore/workers/WorkerContext.h 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebCore/workers/WorkerContext.h 2012-02-02 09:31:21 UTC (rev 106542)
@@ -139,7 +139,6 @@
enum FileSystemType {
TEMPORARY,
PERSISTENT,
- EXTERNAL,
};
void webkitRequestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback>);
PassRefPtr<DOMFileSystemSync> webkitRequestFileSystemSync(int type, long long size, ExceptionCode&);
Modified: trunk/Source/WebKit/chromium/ChangeLog (106541 => 106542)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-02-02 09:31:21 UTC (rev 106542)
@@ -1,3 +1,20 @@
+2012-02-02 Kinuko Yasuda <[email protected]>
+
+ Cleanup: Move chrome-specific filesystem type handling code (for FileSystem API) under chromium directory (re-landing r105395)
+ https://bugs.webkit.org/show_bug.cgi?id=76551
+
+ * src/AssertMatchingEnums.cpp: Removed the matching assertion for AsyncFileSystem::External (as now we directly use WebFileSystem::TypeExternal).
+ * src/AsyncFileSystemChromium.cpp:
+ (WebCore::AsyncFileSystem::crackFileSystemURL): Added.
+ (WebCore::AsyncFileSystem::isValidType): Added.
+ (WebCore::AsyncFileSystemChromium::toURL): Added.
+ * src/AsyncFileSystemChromium.h:
+ (AsyncFileSystemChromium):
+ * src/WorkerAsyncFileSystemChromium.cpp: Made this subclass of AsyncFileSystemChromium (rather than that of AsyncFileSystem)
+ (WebCore::WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium):
+ * src/WorkerAsyncFileSystemChromium.h:
+ (WorkerAsyncFileSystemChromium):
+
2012-02-01 Caio Marcelo de Oliveira Filho <[email protected]>
Avoid creating NamedNodeMap unnecessarily
Modified: trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp (106541 => 106542)
--- trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -433,7 +433,6 @@
#if ENABLE(FILE_SYSTEM)
COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary);
COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent);
-COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeExternal, AsyncFileSystem::External);
COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown);
COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile);
COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeDirectory, FileMetadata::TypeDirectory);
Modified: trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp (106541 => 106542)
--- trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -34,6 +34,7 @@
#include "AsyncFileSystemCallbacks.h"
#include "AsyncFileWriterChromium.h"
+#include "SecurityOrigin.h"
#include "WebFileInfo.h"
#include "WebFileSystemCallbacksImpl.h"
#include "WebFileWriter.h"
@@ -41,14 +42,58 @@
#include "platform/WebFileSystem.h"
#include "platform/WebKitPlatformSupport.h"
#include <wtf/text/CString.h>
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
+// ChromeOS-specific filesystem type.
+const AsyncFileSystem::Type externalType = static_cast<AsyncFileSystem::Type>(WebKit::WebFileSystem::TypeExternal);
+const char externalPathPrefix[] = "external";
+const size_t externalPathPrefixLength = sizeof(externalPathPrefix) - 1;
+
+// static
bool AsyncFileSystem::isAvailable()
{
return true;
}
+// static
+bool AsyncFileSystem::crackFileSystemURL(const KURL& url, AsyncFileSystem::Type& type, String& filePath)
+{
+ if (!url.protocolIs("filesystem"))
+ return false;
+
+ KURL originURL(ParsedURLString, url.path());
+ String path = decodeURLEscapeSequences(originURL.path());
+ if (path.isEmpty() || path[0] != '/')
+ return false;
+ path = path.substring(1);
+
+ if (path.startsWith(temporaryPathPrefix)) {
+ type = Temporary;
+ path = path.substring(temporaryPathPrefixLength);
+ } else if (path.startsWith(persistentPathPrefix)) {
+ type = Persistent;
+ path = path.substring(persistentPathPrefixLength);
+ } else if (path.startsWith(externalPathPrefix)) {
+ type = externalType;
+ path = path.substring(externalPathPrefixLength);
+ } else
+ return false;
+
+ if (path.isEmpty() || path[0] != '/')
+ return false;
+
+ filePath.swap(path);
+ return true;
+}
+
+// static
+bool AsyncFileSystem::isValidType(Type type)
+{
+ return type == Temporary || type == Persistent || type == static_cast<Type>(WebKit::WebFileSystem::TypeExternal);
+}
+
AsyncFileSystemChromium::AsyncFileSystemChromium(AsyncFileSystem::Type type, const KURL& rootURL)
: AsyncFileSystem(type)
, m_webFileSystem(WebKit::webKitPlatformSupport()->fileSystem())
@@ -61,6 +106,28 @@
{
}
+String AsyncFileSystemChromium::toURL(const String& originString, const String& fullPath)
+{
+ ASSERT(!originString.isEmpty());
+ if (originString == "null")
+ return String();
+
+ if (type() == externalType) {
+ // For external filesystem originString could be different from what we have in m_filesystemRootURL.
+ StringBuilder result;
+ result.append("filesystem:");
+ result.append(originString);
+ result.append("/");
+ result.append(externalPathPrefix);
+ result.append(encodeWithURLEscapeSequences(fullPath));
+ return result.toString();
+ }
+
+ // For regular types we can just call virtualPathToFileSystemURL which appends the fullPath to the m_filesystemRootURL that should look like 'filesystem:<origin>/<typePrefix>'.
+ ASSERT(SecurityOrigin::create(m_filesystemRootURL)->toString() == originString);
+ return virtualPathToFileSystemURL(fullPath);
+}
+
void AsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
{
m_webFileSystem->move(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
Modified: trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.h (106541 => 106542)
--- trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.h 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.h 2012-02-02 09:31:21 UTC (rev 106542)
@@ -54,6 +54,7 @@
virtual ~AsyncFileSystemChromium();
+ virtual String toURL(const String& originString, const String& fullPath);
virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks>);
virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
@@ -66,7 +67,7 @@
virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>);
-private:
+protected:
AsyncFileSystemChromium(AsyncFileSystem::Type, const KURL& rootURL);
WebKit::WebFileSystem* m_webFileSystem;
Modified: trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp (106541 => 106542)
--- trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp 2012-02-02 09:31:21 UTC (rev 106542)
@@ -57,14 +57,11 @@
static const char fileSystemOperationsMode[] = "fileSystemOperationsMode";
WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, AsyncFileSystem::Type type, const WebKit::WebURL& rootURL, bool synchronous)
- : AsyncFileSystem(type)
+ : AsyncFileSystemChromium(type, rootURL)
, m_scriptExecutionContext(context)
- , m_webFileSystem(webKitPlatformSupport()->fileSystem())
, m_workerContext(static_cast<WorkerContext*>(context))
, m_synchronous(synchronous)
- , m_filesystemRootURL(rootURL)
{
- ASSERT(m_webFileSystem);
ASSERT(m_scriptExecutionContext->isWorkerContext());
WorkerLoaderProxy* workerLoaderProxy = &m_workerContext->thread()->workerLoaderProxy();
@@ -222,15 +219,6 @@
return m_bridgeForCurrentOperation;
}
-KURL WorkerAsyncFileSystemChromium::virtualPathToFileSystemURL(const String& virtualPath) const
-{
- ASSERT(!m_filesystemRootURL.isEmpty());
- KURL url = ""
- // Remove the extra leading slash.
- url.setPath(url.path() + encodeWithURLEscapeSequences(virtualPath.substring(1)));
- return url;
-}
-
} // namespace WebCore
#endif // ENABLE(FILE_SYSTEM)
Modified: trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h (106541 => 106542)
--- trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h 2012-02-02 09:12:47 UTC (rev 106541)
+++ trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h 2012-02-02 09:31:21 UTC (rev 106542)
@@ -33,7 +33,7 @@
#if ENABLE(FILE_SYSTEM) && ENABLE(WORKERS)
-#include "AsyncFileSystem.h"
+#include "AsyncFileSystemChromium.h"
#include "PlatformString.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
@@ -51,7 +51,7 @@
class ScriptExecutionContext;
class WorkerContext;
-class WorkerAsyncFileSystemChromium : public AsyncFileSystem {
+class WorkerAsyncFileSystemChromium : public AsyncFileSystemChromium {
public:
static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, AsyncFileSystem::Type type, const WebKit::WebURL& rootURL, bool synchronous)
{
@@ -80,17 +80,12 @@
PassRefPtr<WebKit::WorkerFileSystemCallbacksBridge> createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks>);
- // Converts a given absolute virtual path to a full origin-qualified FileSystem URL.
- KURL virtualPathToFileSystemURL(const String& virtualPath) const;
-
ScriptExecutionContext* m_scriptExecutionContext;
- WebKit::WebFileSystem* m_webFileSystem;
WebKit::WebWorkerBase* m_worker;
WorkerContext* m_workerContext;
RefPtr<WebKit::WorkerFileSystemCallbacksBridge> m_bridgeForCurrentOperation;
String m_modeForCurrentOperation;
bool m_synchronous;
- KURL m_filesystemRootURL;
};
} // namespace WebCore