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

Unified Diff: webkit/fileapi/local_file_system_operation.cc

Issue 12193007: Deprecate MountPointProvider::IsAccessAllowed in favor of GetPermissionPolicy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base::FilePath fix Created 7 years, 10 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/isolated_mount_point_provider.cc ('k') | webkit/fileapi/sandbox_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/local_file_system_operation.cc
diff --git a/webkit/fileapi/local_file_system_operation.cc b/webkit/fileapi/local_file_system_operation.cc
index c2349dd504974489dd8ab1295bb09a5fcd08686f..99a19b9b548e77ac98834bc87f03a0912ff6ece9 100644
--- a/webkit/fileapi/local_file_system_operation.cc
+++ b/webkit/fileapi/local_file_system_operation.cc
@@ -835,13 +835,7 @@ void LocalFileSystemOperation::DidCreateSnapshotFile(
base::PlatformFileError LocalFileSystemOperation::SetUp(
const FileSystemURL& url,
SetUpMode mode) {
- if (!url.is_valid())
- return base::PLATFORM_FILE_ERROR_INVALID_URL;
-
- // Restricted file system is read-only.
- if (url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal &&
- mode != SETUP_FOR_READ)
- return base::PLATFORM_FILE_ERROR_SECURITY;
+ DCHECK(url.is_valid());
async_file_util_ = file_system_context()->GetAsyncFileUtil(url.type());
if (!async_file_util_)
@@ -849,37 +843,18 @@ base::PlatformFileError LocalFileSystemOperation::SetUp(
// If this operation is created for recursive sub-operations (i.e.
// operation context is overridden from another operation) we skip
- // some duplicated security checks.
+ // some duplicated notifications.
if (overriding_operation_context_)
return base::PLATFORM_FILE_OK;
- if (!file_system_context()->GetMountPointProvider(
- url.type())->IsAccessAllowed(url))
- return base::PLATFORM_FILE_ERROR_SECURITY;
-
+ // Notify / set up observers.
if (mode == SETUP_FOR_READ) {
operation_context()->access_observers()->Notify(
&FileAccessObserver::OnAccess, MakeTuple(url));
- return base::PLATFORM_FILE_OK;
- }
-
- DCHECK(mode == SETUP_FOR_WRITE || mode == SETUP_FOR_CREATE);
-
- scoped_update_notifiers_.push_back(new ScopedUpdateNotifier(
- operation_context(), url));
-
- // Any write access is disallowed on the root path.
- if (url.path().value().length() == 0 ||
- url.path().DirName().value() == url.path().value())
- return base::PLATFORM_FILE_ERROR_SECURITY;
-
- if (mode == SETUP_FOR_CREATE) {
- FileSystemMountPointProvider* provider = file_system_context()->
- GetMountPointProvider(url.type());
-
- // Check if the cracked file name looks good to create.
- if (provider->IsRestrictedFileName(VirtualPath::BaseName(url.path())))
- return base::PLATFORM_FILE_ERROR_SECURITY;
+ } else {
+ DCHECK(mode == SETUP_FOR_WRITE || mode == SETUP_FOR_CREATE);
+ scoped_update_notifiers_.push_back(new ScopedUpdateNotifier(
+ operation_context(), url));
}
return base::PLATFORM_FILE_OK;
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.cc ('k') | webkit/fileapi/sandbox_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698