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

Unified Diff: content/browser/fileapi/fileapi_message_filter.cc

Issue 10810053: Enables internal filesystem types via Isolated filesystems (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: layout test crash fix 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 | « no previous file | webkit/chromeos/fileapi/cros_mount_point_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/fileapi/fileapi_message_filter.cc
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc
index e7102a069117013d8671809fec834f964b5a32ee..285a6ff4bd6203c696990ba9d6f0a8465761bcdb 100644
--- a/content/browser/fileapi/fileapi_message_filter.cc
+++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -706,19 +706,12 @@ bool FileAPIMessageFilter::HasPermissionsForFile(
ChildProcessSecurityPolicyImpl* policy =
ChildProcessSecurityPolicyImpl::GetInstance();
- // Special handling for isolated filesystem.
+ // Special handling for filesystems which have isolated filesystem_id.
// (See ChildProcessSecurityPolicy::GrantReadFileSystem for more
// details about access permission for isolated filesystem.)
- if (url.type() == fileapi::kFileSystemTypeIsolated) {
- std::string filesystem_id;
- if (!fileapi::IsolatedContext::GetInstance()->CrackIsolatedPath(
- url.path(), &filesystem_id, NULL, &file_path)) {
- *error = base::PLATFORM_FILE_ERROR_INVALID_URL;
- return false;
- }
- // The root directory case. Always allow read-only access as far as the
- // filesystem is valid.
- if (file_path.empty()) {
+ if (!url.filesystem_id().empty()) {
+ // The root directory of the dragged filesystem is read-only.
+ if (url.type() == fileapi::kFileSystemTypeDragged && url.path().empty()) {
if (permissions != kReadFilePermissions) {
*error = base::PLATFORM_FILE_ERROR_SECURITY;
return false;
@@ -729,7 +722,7 @@ bool FileAPIMessageFilter::HasPermissionsForFile(
// Access permission to the file system overrides the file permission
// (if and only if they accessed via an isolated file system).
bool success = policy->HasPermissionsForFileSystem(
- process_id_, filesystem_id, permissions);
+ process_id_, url.filesystem_id(), permissions);
if (!success)
*error = base::PLATFORM_FILE_ERROR_SECURITY;
return success;
« no previous file with comments | « no previous file | webkit/chromeos/fileapi/cros_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698