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

Unified Diff: content/public/browser/child_process_security_policy.h

Issue 19599006: ChildProcessSecurityPolicy: Deprecate bitmask-based permissions checks for files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: content/public/browser/child_process_security_policy.h
diff --git a/content/public/browser/child_process_security_policy.h b/content/public/browser/child_process_security_policy.h
index 9295c345636d1983eccf18414392468016310eb9..62d90a92eb8658bd13f5dd8838c7249877a96e20 100644
--- a/content/public/browser/child_process_security_policy.h
+++ b/content/public/browser/child_process_security_policy.h
@@ -40,11 +40,7 @@ class ChildProcessSecurityPolicy {
// Returns true iff |scheme| has been registered as a web-safe scheme.
virtual bool IsWebSafeScheme(const std::string& scheme) = 0;
- // Before servicing a child process's request to upload a file to the web, the
- // browser should call this method to determine whether the process has the
- // capability to upload the requested file.
- virtual bool CanReadFile(int child_id, const base::FilePath& file) = 0;
-
+ // This permission grants only read access to a file.
// Whenever the user picks a file from a <input type="file"> element, the
// browser should call this function to grant the child process the capability
// to upload the file to the web. Grants FILE_PERMISSION_READ_ONLY.
@@ -59,6 +55,17 @@ class ChildProcessSecurityPolicy {
virtual void GrantCreateWriteFile(int child_id,
const base::FilePath& file) = 0;
+ // These methods verify whether or not the child process has been granted
+ // permissions perform these functions on |file|.
+
+ // Before servicing a child process's request to upload a file to the web, the
+ // browser should call this method to determine whether the process has the
+ // capability to upload the requested file.
+ virtual bool CanReadFile(int child_id, const base::FilePath& file) = 0;
+ virtual bool CanWriteFile(int child_id, const base::FilePath& file) = 0;
+ virtual bool CanCreateFile(int child_id, const base::FilePath& file) = 0;
+ virtual bool CanCreateWriteFile(int child_id, const base::FilePath& file) = 0;
+
// Grants read access permission to the given isolated file system
// identified by |filesystem_id|. An isolated file system can be
// created for a set of native files/directories (like dropped files)

Powered by Google App Engine
This is Rietveld 408576698