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

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

Issue 46303005: Fix chrome upload with content uri (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 6807690cacf0d0ca34bd2ae6ca442fc1fb791f95..6c7e2e36cb851530d074d91e4a84792e5c1c1fa2 100644
--- a/content/public/browser/child_process_security_policy.h
+++ b/content/public/browser/child_process_security_policy.h
@@ -10,6 +10,10 @@
#include "base/basictypes.h"
#include "content/common/content_export.h"
+#if defined(OS_ANDROID)
+#include "url/gurl.h"
+#endif
+
namespace base {
class FilePath;
}
@@ -132,6 +136,22 @@ class ChildProcessSecurityPolicy {
// Returns true if delete-from access has been granted to |filesystem_id|.
virtual bool CanDeleteFromFileSystem(int child_id,
const std::string& filesystem_id) = 0;
+
+#if defined(OS_ANDROID)
+ // This permission grants only read access to a content url.
+ // Whenever the user picks a content url 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.
+ virtual void GrantReadContentUrl(int child_id,
+ const GURL& content_url) = 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 CanReadContentUrl(int child_id,
+ const GURL& content_url) = 0;
+#endif
};
}; // namespace content

Powered by Google App Engine
This is Rietveld 408576698