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

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: address vandebo comments 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..03b3fbd310be2a1c4b49b4b6fe527738c4eca644 100644
--- a/content/public/browser/child_process_security_policy.h
+++ b/content/public/browser/child_process_security_policy.h
@@ -40,14 +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
vandebo (ex-Chrome) 2013/07/18 15:16:59 Seems like the explicit guidance in these comments
tommycli 2013/07/18 15:56:47 Done.
- // 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;
-
- // 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.
+ // This permission grants only read access to a file.
virtual void GrantReadFile(int child_id, const base::FilePath& file) = 0;
// This permission grants creation, read, and full write access to a file,
@@ -59,6 +52,14 @@ 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|.
+ 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 CanCreateReadWriteFile(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