summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
commit03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch)
tree52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
parentcd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff)
downloadqtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp')
-rw-r--r--Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp60
1 files changed, 38 insertions, 22 deletions
diff --git a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
index 28712827d..1f93cf93e 100644
--- a/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
+++ b/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
@@ -63,28 +63,44 @@ bool AsyncFileSystem::crackFileSystemURL(const KURL& url, AsyncFileSystem::Type&
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);
+ if (url.innerURL()) {
+ String typeString = url.innerURL()->path().substring(1);
+ if (typeString == temporaryPathPrefix)
+ type = Temporary;
+ else if (typeString == persistentPathPrefix)
+ type = Persistent;
+ else if (typeString == externalPathPrefix)
+ type = externalType;
+ else
+ return false;
+
+ filePath = decodeURLEscapeSequences(url.path());
+ } else {
+ // FIXME: Remove this clause once http://codereview.chromium.org/7811006
+ // lands, which makes this dead code.
+ 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;
}