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

Unified Diff: chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc

Issue 18129002: Update the child process security policy to use explicit permission grants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change RVH to use FileChooserParam mode Created 7 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
Index: chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc
index 0bc7b95cd28a4921f239a235dcb3fc364e3ba82c..83d6d3cf5015d5b15de74e2c0bba0782f9ec0fcb 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.cc
@@ -201,14 +201,6 @@ base::DictionaryValue* CreateValueFromMountPoint(Profile* profile,
return mount_info;
}
-// Gives the extension renderer |host| file |permissions| for the given |path|.
-void GrantFilePermissionsToHost(content::RenderViewHost* host,
- const base::FilePath& path,
- int permissions) {
- ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile(
- host->GetProcess()->GetID(), path, permissions);
-}
-
void SetDriveMountPointPermissions(
Profile* profile,
const std::string& extension_id,
@@ -228,9 +220,8 @@ void SetDriveMountPointPermissions(
const base::FilePath mount_point = drive::util::GetDriveMountPointPath();
// Grant R/W permissions to drive 'folder'. File API layer still
// expects this to be satisfied.
- GrantFilePermissionsToHost(render_view_host,
- mount_point,
- file_handler_util::GetReadWritePermissions());
+ ChildProcessSecurityPolicy::GetInstance()->GrantCreateReadWriteFile(
+ render_view_host->GetProcess()->GetID(), mount_point);
base::FilePath mount_point_virtual;
if (provider->GetVirtualPath(mount_point, &mount_point_virtual))
@@ -552,9 +543,8 @@ bool RequestFileSystemFunction::SetupFileSystemAccessPermissions(
// extension for all paths exposed by our local file system provider.
std::vector<base::FilePath> root_dirs = provider->GetRootDirectories();
for (size_t i = 0; i < root_dirs.size(); ++i) {
- ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile(
- child_id, root_dirs[i],
- file_handler_util::GetReadWritePermissions());
+ ChildProcessSecurityPolicy::GetInstance()->GrantCreateReadWriteFile(
+ child_id, root_dirs[i]);
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698