OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
6 #define CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 6 #define CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
| 13 #if defined(OS_ANDROID) |
| 14 #include "url/gurl.h" |
| 15 #endif |
| 16 |
13 namespace base { | 17 namespace base { |
14 class FilePath; | 18 class FilePath; |
15 } | 19 } |
16 | 20 |
17 namespace content { | 21 namespace content { |
18 | 22 |
19 // The ChildProcessSecurityPolicy class is used to grant and revoke security | 23 // The ChildProcessSecurityPolicy class is used to grant and revoke security |
20 // capabilities for child processes. For example, it restricts whether a child | 24 // capabilities for child processes. For example, it restricts whether a child |
21 // process is permitted to load file:// URLs based on whether the process | 25 // process is permitted to load file:// URLs based on whether the process |
22 // has ever been commanded to load file:// URLs by the browser. | 26 // has ever been commanded to load file:// URLs by the browser. |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 virtual bool CanReadWriteFileSystem(int child_id, | 129 virtual bool CanReadWriteFileSystem(int child_id, |
126 const std::string& filesystem_id) = 0; | 130 const std::string& filesystem_id) = 0; |
127 | 131 |
128 // Returns true if copy-into access has been granted to |filesystem_id|. | 132 // Returns true if copy-into access has been granted to |filesystem_id|. |
129 virtual bool CanCopyIntoFileSystem(int child_id, | 133 virtual bool CanCopyIntoFileSystem(int child_id, |
130 const std::string& filesystem_id) = 0; | 134 const std::string& filesystem_id) = 0; |
131 | 135 |
132 // Returns true if delete-from access has been granted to |filesystem_id|. | 136 // Returns true if delete-from access has been granted to |filesystem_id|. |
133 virtual bool CanDeleteFromFileSystem(int child_id, | 137 virtual bool CanDeleteFromFileSystem(int child_id, |
134 const std::string& filesystem_id) = 0; | 138 const std::string& filesystem_id) = 0; |
| 139 |
| 140 #if defined(OS_ANDROID) |
| 141 // This permission grants only read access to a content url. |
| 142 // Whenever the user picks a content url file from a <input type="file"> |
| 143 // element, the browser should call this function to grant the child process |
| 144 // the capability to upload the file to the web. Grants |
| 145 // FILE_PERMISSION_READ_ONLY. |
| 146 virtual void GrantReadContentUrl(int child_id, |
| 147 const GURL& content_url) = 0; |
| 148 |
| 149 // Before servicing a child process's request to upload a file to the web, the |
| 150 // browser should call this method to determine whether the process has the |
| 151 // capability to upload the requested file. |
| 152 virtual bool CanReadContentUrl(int child_id, |
| 153 const GURL& content_url) = 0; |
| 154 #endif |
135 }; | 155 }; |
136 | 156 |
137 }; // namespace content | 157 }; // namespace content |
138 | 158 |
139 #endif // CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 159 #endif // CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
OLD | NEW |