diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
commit | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch) | |
tree | 8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebCore/fileapi | |
parent | d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff) | |
download | qtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz |
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebCore/fileapi')
-rw-r--r-- | Source/WebCore/fileapi/Blob.idl | 1 | ||||
-rw-r--r-- | Source/WebCore/fileapi/DOMFileSystemBase.cpp | 37 | ||||
-rw-r--r-- | Source/WebCore/fileapi/DOMFileSystemBase.h | 8 | ||||
-rw-r--r-- | Source/WebCore/fileapi/EntryBase.cpp | 22 | ||||
-rw-r--r-- | Source/WebCore/fileapi/FileException.cpp | 2 |
5 files changed, 3 insertions, 67 deletions
diff --git a/Source/WebCore/fileapi/Blob.idl b/Source/WebCore/fileapi/Blob.idl index e9b795911..9902cd454 100644 --- a/Source/WebCore/fileapi/Blob.idl +++ b/Source/WebCore/fileapi/Blob.idl @@ -32,6 +32,7 @@ module html { interface [ GenerateIsReachable=Impl, + CustomToJS, NoStaticTables ] Blob { readonly attribute unsigned long long size; diff --git a/Source/WebCore/fileapi/DOMFileSystemBase.cpp b/Source/WebCore/fileapi/DOMFileSystemBase.cpp index ec8ef725a..2135f2bbc 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> asyncFileSystem) : m_context(context) , m_name(name) diff --git a/Source/WebCore/fileapi/DOMFileSystemBase.h b/Source/WebCore/fileapi/DOMFileSystemBase.h index 8bc0b6579..18ae8d76b 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 39453f61c..0b1254b7a 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(m_fullPath); - return result.toString(); + return m_fileSystem->asyncFileSystem()->toURL(m_fileSystem->securityOrigin()->toString(), m_fullPath); } } // namespace WebCore diff --git a/Source/WebCore/fileapi/FileException.cpp b/Source/WebCore/fileapi/FileException.cpp index 656b16386..7e62ff355 100644 --- a/Source/WebCore/fileapi/FileException.cpp +++ b/Source/WebCore/fileapi/FileException.cpp @@ -54,7 +54,7 @@ static const char* const exceptionDescriptions[] = { "A requested file or directory could not be found at the time an operation was processed.", "It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.", "An ongoing operation was aborted, typically with a call to abort().", - "The requested file could not be read, typically due to permission problems that have occured after a reference to a file was acquired.", + "The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "A URI supplied to the API was malformed, or the resulting Data URL has exceeded the URL length limitations for Data URLs.", "An attempt was made to write to a file or directory which could not be modified due to the state of the underlying filesystem.", "An operation that depends on state cached in an interface object was made but the state had changed since it was read from disk.", |