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

Unified Diff: webkit/fileapi/sandbox_mount_point_provider.cc

Issue 10701094: Don't keep file system directories around if they contain unrelated files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: error message Created 8 years, 5 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
« no previous file with comments | « webkit/fileapi/obfuscated_file_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/sandbox_mount_point_provider.cc
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index ab7b158eb3a7b9d38737979ef40669688579d8d6..1734da4a4696738fa56feb73e46063abf46c2086 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -297,7 +297,7 @@ void ValidateRootOnFileThread(
FilePath root_path =
file_util->GetDirectoryForOriginAndType(
origin_url, type, create, error_ptr);
- if (root_path.empty()) {
+ if (*error_ptr != base::PLATFORM_FILE_OK) {
UMA_HISTOGRAM_ENUMERATION(kOpenFileSystemLabel,
kCreateDirectoryError,
kFileSystemErrorMax);
@@ -386,10 +386,7 @@ SandboxMountPointProvider::GetFileSystemRootPathOnFileThread(
if (!IsAllowedScheme(origin_url))
return FilePath();
- MigrateIfNeeded(sandbox_file_util_.get(), old_base_path());
-
- return sandbox_file_util_->GetDirectoryForOriginAndType(
- origin_url, type, create);
+ return GetBaseDirectoryForOriginAndType(origin_url, type, create);
}
bool SandboxMountPointProvider::IsAccessAllowed(const GURL& origin_url,
@@ -482,8 +479,12 @@ FilePath SandboxMountPointProvider::GetBaseDirectoryForOriginAndType(
MigrateIfNeeded(sandbox_file_util_.get(), old_base_path());
- return sandbox_file_util_->GetDirectoryForOriginAndType(
- origin_url, type, create);
+ base::PlatformFileError error = base::PLATFORM_FILE_OK;
+ FilePath path = sandbox_file_util_->GetDirectoryForOriginAndType(
+ origin_url, type, create, &error);
+ if (error != base::PLATFORM_FILE_OK)
+ return FilePath();
+ return path;
}
bool SandboxMountPointProvider::DeleteOriginDataOnFileThread(
« no previous file with comments | « webkit/fileapi/obfuscated_file_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698