From: kinuko@chromium.org Date: Thu, 2 Feb 2012 09:31:21 +0000 (+0000) Subject: Cleanup: Move chrome-specific filesystem type handling code (for FileSystem API)... X-Git-Tag: 070512121124~13970 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc98a7e746b8b74ec851247b066f6bc4efdbe3c9;p=profile%2Fivi%2Fwebkit-efl.git 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 Source/WebCore: 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: Source/WebKit/chromium: * 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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106542 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index fdb20d8..e477961 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,36 @@ +2012-02-02 Kinuko Yasuda + + 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 Web Inspector: pause on uncaugh exceptions state is not properly restored diff --git a/Source/WebCore/fileapi/DOMFileSystemBase.cpp b/Source/WebCore/fileapi/DOMFileSystemBase.cpp index ec8ef72..2135f2b 100644 --- a/Source/WebCore/fileapi/DOMFileSystemBase.cpp +++ b/Source/WebCore/fileapi/DOMFileSystemBase.cpp @@ -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) : m_context(context) , m_name(name) diff --git a/Source/WebCore/fileapi/DOMFileSystemBase.h b/Source/WebCore/fileapi/DOMFileSystemBase.h index 8bc0b65..18ae8d7 100644 --- a/Source/WebCore/fileapi/DOMFileSystemBase.h +++ b/Source/WebCore/fileapi/DOMFileSystemBase.h @@ -62,14 +62,6 @@ public: } 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; diff --git a/Source/WebCore/fileapi/EntryBase.cpp b/Source/WebCore/fileapi/EntryBase.cpp index 53f62e7..0b1254b 100644 --- a/Source/WebCore/fileapi/EntryBase.cpp +++ b/Source/WebCore/fileapi/EntryBase.cpp @@ -56,27 +56,7 @@ EntryBase::~EntryBase() 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 diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp index f550548..f6fe47b 100644 --- a/Source/WebCore/page/DOMWindow.cpp +++ b/Source/WebCore/page/DOMWindow.cpp @@ -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 @@ void DOMWindow::webkitRequestFileSystem(int type, long long size, PassRefPtr(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 @@ void DOMWindow::webkitResolveLocalFileSystemURL(const String& url, PassRefPtr(DOMWindow::EXTERNAL) == static_cast(AsyncFileSystem::External), enum_mismatch); - COMPILE_ASSERT(static_cast(DOMWindow::TEMPORARY) == static_cast(AsyncFileSystem::Temporary), enum_mismatch); COMPILE_ASSERT(static_cast(DOMWindow::PERSISTENT) == static_cast(AsyncFileSystem::Persistent), enum_mismatch); diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h index 0916bff..38e8c5d 100644 --- a/Source/WebCore/page/DOMWindow.h +++ b/Source/WebCore/page/DOMWindow.h @@ -370,7 +370,6 @@ namespace WebCore { enum FileSystemType { TEMPORARY, PERSISTENT, - EXTERNAL, }; void webkitRequestFileSystem(int type, long long size, PassRefPtr, PassRefPtr); void webkitResolveLocalFileSystemURL(const String&, PassRefPtr, PassRefPtr); diff --git a/Source/WebCore/platform/AsyncFileSystem.cpp b/Source/WebCore/platform/AsyncFileSystem.cpp index 404aab6..c3c2412 100644 --- a/Source/WebCore/platform/AsyncFileSystem.cpp +++ b/Source/WebCore/platform/AsyncFileSystem.cpp @@ -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 @@ bool AsyncFileSystem::isAvailable() return false; } +bool AsyncFileSystem::isValidType(Type type) +{ + return type == Temporary || type == Persistent; +} + PassOwnPtr AsyncFileSystem::create(Type, const String&) { notImplemented(); diff --git a/Source/WebCore/platform/AsyncFileSystem.h b/Source/WebCore/platform/AsyncFileSystem.h index c2c6845..bbef6a4 100644 --- a/Source/WebCore/platform/AsyncFileSystem.h +++ b/Source/WebCore/platform/AsyncFileSystem.h @@ -54,14 +54,26 @@ public: 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; } diff --git a/Source/WebCore/workers/WorkerContext.cpp b/Source/WebCore/workers/WorkerContext.cpp index 8f24330f..fbed36b 100644 --- a/Source/WebCore/workers/WorkerContext.cpp +++ b/Source/WebCore/workers/WorkerContext.cpp @@ -395,7 +395,7 @@ void WorkerContext::webkitRequestFileSystem(int type, long long size, PassRefPtr } AsyncFileSystem::Type fileSystemType = static_cast(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 @@ PassRefPtr WorkerContext::webkitRequestFileSystemSync(int typ } AsyncFileSystem::Type fileSystemType = static_cast(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 @@ void WorkerContext::webkitResolveLocalFileSystemURL(const String& url, PassRefPt 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 @@ PassRefPtr WorkerContext::webkitResolveLocalFileSystemSyncURL(const S 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 @@ PassRefPtr WorkerContext::webkitResolveLocalFileSystemSyncURL(const S COMPILE_ASSERT(static_cast(WorkerContext::TEMPORARY) == static_cast(AsyncFileSystem::Temporary), enum_mismatch); COMPILE_ASSERT(static_cast(WorkerContext::PERSISTENT) == static_cast(AsyncFileSystem::Persistent), enum_mismatch); -COMPILE_ASSERT(static_cast(WorkerContext::EXTERNAL) == static_cast(AsyncFileSystem::External), enum_mismatch); #endif WorkerContext::Observer::Observer(WorkerContext* context) diff --git a/Source/WebCore/workers/WorkerContext.h b/Source/WebCore/workers/WorkerContext.h index 5850374..43d2e2e 100644 --- a/Source/WebCore/workers/WorkerContext.h +++ b/Source/WebCore/workers/WorkerContext.h @@ -139,7 +139,6 @@ namespace WebCore { enum FileSystemType { TEMPORARY, PERSISTENT, - EXTERNAL, }; void webkitRequestFileSystem(int type, long long size, PassRefPtr successCallback, PassRefPtr); PassRefPtr webkitRequestFileSystemSync(int type, long long size, ExceptionCode&); diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index 32e9361..323c429 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,20 @@ +2012-02-02 Kinuko Yasuda + + 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 Avoid creating NamedNodeMap unnecessarily diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 1f91d51..a451b88 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -433,7 +433,6 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType); #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); diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp index c55c71b..2871282 100644 --- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp @@ -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 +#include namespace WebCore { +// ChromeOS-specific filesystem type. +const AsyncFileSystem::Type externalType = static_cast(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(WebKit::WebFileSystem::TypeExternal); +} + AsyncFileSystemChromium::AsyncFileSystemChromium(AsyncFileSystem::Type type, const KURL& rootURL) : AsyncFileSystem(type) , m_webFileSystem(WebKit::webKitPlatformSupport()->fileSystem()) @@ -61,6 +106,28 @@ AsyncFileSystemChromium::~AsyncFileSystemChromium() { } +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:/'. + ASSERT(SecurityOrigin::create(m_filesystemRootURL)->toString() == originString); + return virtualPathToFileSystemURL(fullPath); +} + void AsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr callbacks) { m_webFileSystem->move(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks)); diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.h b/Source/WebKit/chromium/src/AsyncFileSystemChromium.h index 0c550b5..a8cbca2 100644 --- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.h +++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.h @@ -54,6 +54,7 @@ public: virtual ~AsyncFileSystemChromium(); + virtual String toURL(const String& originString, const String& fullPath); virtual void move(const String& sourcePath, const String& destinationPath, PassOwnPtr); virtual void copy(const String& sourcePath, const String& destinationPath, PassOwnPtr); virtual void remove(const String& path, PassOwnPtr); @@ -66,7 +67,7 @@ public: virtual void readDirectory(const String& path, PassOwnPtr); virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr); -private: +protected: AsyncFileSystemChromium(AsyncFileSystem::Type, const KURL& rootURL); WebKit::WebFileSystem* m_webFileSystem; diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp index 6155d15..7fbb1f4 100644 --- a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp @@ -57,14 +57,11 @@ namespace WebCore { 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(context)) , m_synchronous(synchronous) - , m_filesystemRootURL(rootURL) { - ASSERT(m_webFileSystem); ASSERT(m_scriptExecutionContext->isWorkerContext()); WorkerLoaderProxy* workerLoaderProxy = &m_workerContext->thread()->workerLoaderProxy(); @@ -222,15 +219,6 @@ PassRefPtr WorkerAsyncFileSystemChromium::creat return m_bridgeForCurrentOperation; } -KURL WorkerAsyncFileSystemChromium::virtualPathToFileSystemURL(const String& virtualPath) const -{ - ASSERT(!m_filesystemRootURL.isEmpty()); - KURL url = m_filesystemRootURL; - // Remove the extra leading slash. - url.setPath(url.path() + encodeWithURLEscapeSequences(virtualPath.substring(1))); - return url; -} - } // namespace WebCore #endif // ENABLE(FILE_SYSTEM) diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h index 13a8e7c..c8ae356 100644 --- a/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h +++ b/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h @@ -33,7 +33,7 @@ #if ENABLE(FILE_SYSTEM) && ENABLE(WORKERS) -#include "AsyncFileSystem.h" +#include "AsyncFileSystemChromium.h" #include "PlatformString.h" #include #include @@ -51,7 +51,7 @@ class AsyncFileSystemCallbacks; class ScriptExecutionContext; class WorkerContext; -class WorkerAsyncFileSystemChromium : public AsyncFileSystem { +class WorkerAsyncFileSystemChromium : public AsyncFileSystemChromium { public: static PassOwnPtr create(ScriptExecutionContext* context, AsyncFileSystem::Type type, const WebKit::WebURL& rootURL, bool synchronous) { @@ -80,17 +80,12 @@ private: PassRefPtr createWorkerFileSystemCallbacksBridge(PassOwnPtr); - // 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 m_bridgeForCurrentOperation; String m_modeForCurrentOperation; bool m_synchronous; - KURL m_filesystemRootURL; }; } // namespace WebCore