summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/sandbox_mount_point_provider.cc
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-16 04:01:08 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-16 04:01:08 +0000
commitb777b3386e10d38944cc717e4192b7858cbdc7fe (patch)
tree85d37a15e729df855d81e0973d9ed1bb3f90d347 /webkit/fileapi/sandbox_mount_point_provider.cc
parent4b59a325a589190ab95622be4e1b6a70bc02914f (diff)
downloadchromium_src-b777b3386e10d38944cc717e4192b7858cbdc7fe.zip
chromium_src-b777b3386e10d38944cc717e4192b7858cbdc7fe.tar.gz
chromium_src-b777b3386e10d38944cc717e4192b7858cbdc7fe.tar.bz2
File API changes needed for safely passing user selected file entities from the file browser component extension to a 3rd party extension.
BUG=chromium-os:11996 TEST=FileAccessPermissionsTest.FileAccessChecks Review URL: http://codereview.chromium.org/6810037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/sandbox_mount_point_provider.cc')
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index 5768ed9..5e80296 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -111,9 +111,6 @@ namespace fileapi {
const FilePath::CharType SandboxMountPointProvider::kFileSystemDirectory[] =
FILE_PATH_LITERAL("FileSystem");
-const char SandboxMountPointProvider::kPersistentName[] = "Persistent";
-const char SandboxMountPointProvider::kTemporaryName[] = "Temporary";
-
SandboxMountPointProvider::SandboxMountPointProvider(
FileSystemPathManager* path_manager,
scoped_refptr<base::MessageLoopProxy> file_message_loop,
@@ -126,7 +123,11 @@ SandboxMountPointProvider::SandboxMountPointProvider(
SandboxMountPointProvider::~SandboxMountPointProvider() {
}
-bool SandboxMountPointProvider::IsAccessAllowed(const GURL& origin_url) {
+bool SandboxMountPointProvider::IsAccessAllowed(const GURL& origin_url,
+ FileSystemType type,
+ const FilePath& unused) {
+ if (type != kFileSystemTypeTemporary && type != kFileSystemTypePersistent)
+ return false;
// We essentially depend on quota to do our access controls.
return path_manager_->IsAllowedScheme(origin_url);
}
@@ -211,6 +212,14 @@ bool SandboxMountPointProvider::IsRestrictedFileName(const FilePath& filename)
return false;
}
+std::vector<FilePath> SandboxMountPointProvider::GetRootDirectories() const {
+ NOTREACHED();
+ // TODO(ericu): Implement this method and check for access permissions as
+ // fileBrowserPrivate extension API does. We currently have another mechanism,
+ // but we should switch over.
+ return std::vector<FilePath>();
+}
+
void SandboxMountPointProvider::GetFileSystemRootPath(
const GURL& origin_url, fileapi::FileSystemType type,
bool create, FileSystemPathManager::GetRootPathCallback* callback_ptr) {
@@ -278,12 +287,12 @@ std::string SandboxMountPointProvider::OriginEnumerator::Next() {
bool SandboxMountPointProvider::OriginEnumerator::HasTemporary() {
return !current_.empty() && file_util::DirectoryExists(current_.AppendASCII(
- SandboxMountPointProvider::kTemporaryName));
+ fileapi::kTemporaryName));
}
bool SandboxMountPointProvider::OriginEnumerator::HasPersistent() {
return !current_.empty() && file_util::DirectoryExists(current_.AppendASCII(
- SandboxMountPointProvider::kPersistentName));
+ fileapi::kPersistentName));
}
bool SandboxMountPointProvider::GetOriginBasePathAndName(