summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 10:25:53 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 10:25:53 +0000
commit6c462517ce781f27ed0d6c97f50354485702206c (patch)
tree801875b7a62761bd2b2817b787cc33df9b706e53 /webkit/fileapi
parentf69733d14df41c8e10e8f4232da4a5bd477b8348 (diff)
downloadchromium_src-6c462517ce781f27ed0d6c97f50354485702206c.zip
chromium_src-6c462517ce781f27ed0d6c97f50354485702206c.tar.gz
chromium_src-6c462517ce781f27ed0d6c97f50354485702206c.tar.bz2
Revert 67385 - On windows filepaths need \\?\ prefix to allow extended file path names. Fix to bug 63574.
Turned out that we need more changes to make extended paths work. BUG=63574 TEST=file_system_operation_unittest.cc and manually tested on FAT32. Review URL: http://codereview.chromium.org/5259003 TBR=kkanetkar@chromium.org Review URL: http://codereview.chromium.org/5357009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r--webkit/fileapi/file_system_operation_unittest.cc28
-rw-r--r--webkit/fileapi/file_system_path_manager.cc18
-rw-r--r--webkit/fileapi/file_system_path_manager.h2
-rw-r--r--webkit/fileapi/file_system_path_manager_unittest.cc4
4 files changed, 4 insertions, 48 deletions
diff --git a/webkit/fileapi/file_system_operation_unittest.cc b/webkit/fileapi/file_system_operation_unittest.cc
index e5c25ad..370d95c 100644
--- a/webkit/fileapi/file_system_operation_unittest.cc
+++ b/webkit/fileapi/file_system_operation_unittest.cc
@@ -463,34 +463,6 @@ TEST_F(FileSystemOperationTest, TestCreateFileFailure) {
EXPECT_EQ(request_id_, mock_dispatcher_->request_id());
}
-TEST_F(FileSystemOperationTest, TestCreateVeryLongName) {
- ScopedTempDir dir;
- ASSERT_TRUE(dir.CreateUniqueTempDir());
-
-#if defined(OS_WIN)
- FilePath dir_path(FILE_PATH_LITERAL("\\\\?\\") + dir.path().value());
-#else
- FilePath dir_path = dir.path();
-#endif
-
- // TODO(kkanetkar): Once each platform's limitations have been enforced
- // consider that in this test. Currently this test is for
- // windows primarily.
- FilePath dir1 = dir_path.AppendASCII(
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "0123456789012345678901234567890123456789");
- FilePath file = dir1.AppendASCII(
- "012345678901234567890123456789012345678901234567890123456789"
- "012345678901234567890123456789012345678901234567890123456789"
- "0123456789012345678901234567890123456789");
- operation()->CreateDirectory(dir1, false, true);
- MessageLoop::current()->RunAllPending();
- operation()->CreateFile(file, true);
- MessageLoop::current()->RunAllPending();
- EXPECT_TRUE(file_util::PathExists(file));
-}
-
TEST_F(FileSystemOperationTest, TestCreateFileSuccessFileExists) {
// Already existing file and exclusive false.
ScopedTempDir dir;
diff --git a/webkit/fileapi/file_system_path_manager.cc b/webkit/fileapi/file_system_path_manager.cc
index 50f22f9..2bd1f9e 100644
--- a/webkit/fileapi/file_system_path_manager.cc
+++ b/webkit/fileapi/file_system_path_manager.cc
@@ -124,7 +124,6 @@ class FileSystemPathManager::GetFileSystemRootPathTask
DispatchCallbackOnCallerThread(FilePath());
return;
}
-
DispatchCallbackOnCallerThread(root);
}
@@ -171,25 +170,13 @@ class FileSystemPathManager::GetFileSystemRootPathTask
scoped_ptr<FileSystemPathManager::GetRootPathCallback> callback_;
};
-FilePath FileSystemPathManager::GetFileSystemCommonRootDirectory(
- const FilePath& root_path) {
-#if defined(OS_WIN)
- // To specify an extended-length path, "\\?\" prefix is used. Else path names
- // are limited to 260 characters.
- FilePath::StringType extended_length_str(L"\\\\?\\");
- extended_length_str.append(root_path.value());
- return FilePath(extended_length_str).Append(kFileSystemDirectory);
-#endif
- return root_path.Append(kFileSystemDirectory);
-}
-
FileSystemPathManager::FileSystemPathManager(
scoped_refptr<base::MessageLoopProxy> file_message_loop,
const FilePath& profile_path,
bool is_incognito,
bool allow_file_access_from_files)
: file_message_loop_(file_message_loop),
- base_path_(GetFileSystemCommonRootDirectory(profile_path)),
+ base_path_(profile_path.Append(kFileSystemDirectory)),
is_incognito_(is_incognito),
allow_file_access_from_files_(allow_file_access_from_files) {
}
@@ -228,8 +215,7 @@ void FileSystemPathManager::GetFileSystemRootPath(
DCHECK(!type_string.empty());
FilePath origin_base_path = base_path_.AppendASCII(storage_identifier)
- .AppendASCII(type_string);
-
+ .AppendASCII(type_string);
std::string name = storage_identifier + ":" + type_string;
scoped_refptr<GetFileSystemRootPathTask> task(
diff --git a/webkit/fileapi/file_system_path_manager.h b/webkit/fileapi/file_system_path_manager.h
index 41ffd4d..12104ef 100644
--- a/webkit/fileapi/file_system_path_manager.h
+++ b/webkit/fileapi/file_system_path_manager.h
@@ -28,8 +28,6 @@ class FileSystemPathManager {
bool allow_file_access_from_files);
~FileSystemPathManager();
- static FilePath GetFileSystemCommonRootDirectory(const FilePath& root_path);
-
// Callback for GetFileSystemRootPath.
// If the request is accepted and the root filesystem for the origin exists
// the callback is called with success=true and valid root_path and name.
diff --git a/webkit/fileapi/file_system_path_manager_unittest.cc b/webkit/fileapi/file_system_path_manager_unittest.cc
index 4e18cd9..7fa3672 100644
--- a/webkit/fileapi/file_system_path_manager_unittest.cc
+++ b/webkit/fileapi/file_system_path_manager_unittest.cc
@@ -210,8 +210,8 @@ class FileSystemPathManagerTest : public testing::Test {
FilePath data_path() { return data_dir_->path(); }
FilePath file_system_path() {
- return FileSystemPathManager::GetFileSystemCommonRootDirectory(
- data_dir_->path());
+ return data_dir_->path().Append(
+ FileSystemPathManager::kFileSystemDirectory);
}
private: