summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_operation.cc
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-05 11:45:55 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-05 11:45:55 +0000
commite7e46736cc27f6499d89141eb9e546866ba24754 (patch)
tree49ef8f4acebc8e0a6949802dec6fac9ff8369f71 /webkit/fileapi/file_system_operation.cc
parent3465d85d92cf1e3e90f882806fd1758d3132441b (diff)
downloadchromium_src-e7e46736cc27f6499d89141eb9e546866ba24754.zip
chromium_src-e7e46736cc27f6499d89141eb9e546866ba24754.tar.gz
chromium_src-e7e46736cc27f6499d89141eb9e546866ba24754.tar.bz2
Cleanup: Removing FileSystemPathManager
- Deprecating FileSystemPathManager, which I believe no longer has a lot of reasons to exist * Changed GetFileSystemTypeString to a regular function in file_system_util * Added GetFileUtil(FileSystemType), GetMountPointProvider(FileSystemType), external_provider() to FileSystemContext * Moved all the tests in file_system_path_manager_unittest to file_system_mount_point_provider_unittest - Also replaced two boolean values in FileSystemContext with a thin FileSystemOptions interface BUG=none TEST=no functional changes Review URL: http://codereview.chromium.org/9004019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116482 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_operation.cc')
-rw-r--r--webkit/fileapi/file_system_operation.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc
index 745273b..693499a 100644
--- a/webkit/fileapi/file_system_operation.cc
+++ b/webkit/fileapi/file_system_operation.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,8 +12,8 @@
#include "webkit/fileapi/file_system_callback_dispatcher.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util_proxy.h"
+#include "webkit/fileapi/file_system_mount_point_provider.h"
#include "webkit/fileapi/file_system_operation_context.h"
-#include "webkit/fileapi/file_system_path_manager.h"
#include "webkit/fileapi/file_system_quota_util.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/file_system_util.h"
@@ -101,7 +101,14 @@ void FileSystemOperation::OpenFileSystem(
// create an unpredictable directory name. Without that, we could lazily
// create the root later on the first filesystem write operation, and just
// return GetFileSystemRootURI() here.
- file_system_context()->path_manager()->ValidateFileSystemRootAndGetURL(
+ FileSystemMountPointProvider* mount_point_provider =
+ file_system_context()->GetMountPointProvider(type);
+ if (!mount_point_provider) {
+ DidGetRootPath(false, FilePath(), std::string());
+ delete this;
+ return;
+ }
+ mount_point_provider->ValidateFileSystemRootAndGetURL(
origin_url, type, create,
base::Bind(&FileSystemOperation::DidGetRootPath,
base::Owned(this)));
@@ -776,8 +783,9 @@ bool FileSystemOperation::VerifyFileSystemPathForWrite(
dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_SECURITY);
return false;
}
- if (create && file_system_context()->path_manager()->IsRestrictedFileName(
- *type, virtual_path->BaseName())) {
+ if (create &&
+ file_system_context()->GetMountPointProvider(*type)->IsRestrictedFileName(
+ virtual_path->BaseName())) {
dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_SECURITY);
return false;
}
@@ -794,13 +802,13 @@ bool FileSystemOperation::VerifyFileSystemPath(
dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_INVALID_URL);
return false;
}
- if (!file_system_context()->path_manager()->IsAccessAllowed(
+ if (!file_system_context()->GetMountPointProvider(*type)->IsAccessAllowed(
*origin_url, *type, *virtual_path)) {
dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_SECURITY);
return false;
}
DCHECK(file_util);
- *file_util = file_system_context()->path_manager()->GetFileUtil(*type);
+ *file_util = file_system_context()->GetFileUtil(*type);
DCHECK(*file_util);
return true;