Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: webkit/fileapi/file_system_util.cc

Issue 10386069: Add RegisterMountPointProvider and TestMountPointProvider for testing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding sandbox_mpp change Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/fileapi/file_system_util.cc
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc
index 968aa710241193d5e6709d237ac13f35435e267c..697ea04b547023db8c9d30af062929f85ed486e5 100644
--- a/webkit/fileapi/file_system_util.cc
+++ b/webkit/fileapi/file_system_util.cc
@@ -24,11 +24,13 @@ const char kPersistentDir[] = "/persistent";
const char kTemporaryDir[] = "/temporary";
const char kIsolatedDir[] = "/isolated";
const char kExternalDir[] = "/external";
+const char kTestDir[] = "/test";
const char kPersistentName[] = "Persistent";
const char kTemporaryName[] = "Temporary";
const char kIsolatedName[] = "Isolated";
const char kExternalName[] = "External";
+const char kTestName[] = "Test";
bool CrackFileSystemURL(const GURL& url, GURL* origin_url, FileSystemType* type,
FilePath* file_path) {
@@ -49,6 +51,7 @@ bool CrackFileSystemURL(const GURL& url, GURL* origin_url, FileSystemType* type,
{ kFileSystemTypeTemporary, kTemporaryDir },
{ kFileSystemTypeIsolated, kIsolatedDir },
{ kFileSystemTypeExternal, kExternalDir },
+ { kFileSystemTypeTest, kTestDir },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kValidTypes); ++i) {
if (StartsWithASCII(inner_path, kValidTypes[i].dir, true)) {
@@ -146,6 +149,9 @@ GURL GetFileSystemRootURI(const GURL& origin_url, FileSystemType type) {
case kFileSystemTypeExternal:
url += (kExternalDir + 1); // We don't want the leading slash.
return GURL(url + "/");
+ case kFileSystemTypeTest:
+ url += (kTestDir + 1); // We don't want the leading slash.
+ return GURL(url + "/");
case kFileSystemTypeIsolated:
// Falling through; we won't call this for isolated filesystems.
case kFileSystemTypeUnknown:
@@ -216,6 +222,8 @@ std::string GetFileSystemTypeString(FileSystemType type) {
return fileapi::kPersistentName;
case kFileSystemTypeExternal:
return fileapi::kExternalName;
+ case kFileSystemTypeTest:
+ return fileapi::kTestName;
case kFileSystemTypeUnknown:
default:
return std::string();

Powered by Google App Engine
This is Rietveld 408576698