| 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_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| 6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void GrantReadRawCookies(int child_id); | 130 void GrantReadRawCookies(int child_id); |
| 131 | 131 |
| 132 // Revoke read raw cookies permission. | 132 // Revoke read raw cookies permission. |
| 133 void RevokeReadRawCookies(int child_id); | 133 void RevokeReadRawCookies(int child_id); |
| 134 | 134 |
| 135 // Whether the given origin is valid for an origin header. Valid origin | 135 // Whether the given origin is valid for an origin header. Valid origin |
| 136 // headers are commitable URLs plus suborigin URLs. | 136 // headers are commitable URLs plus suborigin URLs. |
| 137 bool CanSetAsOriginHeader(int child_id, const GURL& url); | 137 bool CanSetAsOriginHeader(int child_id, const GURL& url); |
| 138 | 138 |
| 139 // Explicit permissions checks for FileSystemURL specified files. | 139 // Explicit permissions checks for FileSystemURL specified files. |
| 140 bool CanReadFileSystemFile(int child_id, const storage::FileSystemURL& url); | 140 bool CanReadFileSystemFile(int child_id, |
| 141 bool CanWriteFileSystemFile(int child_id, const storage::FileSystemURL& url); | 141 const storage::FileSystemURL& filesystem_url); |
| 142 bool CanCreateFileSystemFile(int child_id, const storage::FileSystemURL& url); | 142 bool CanWriteFileSystemFile(int child_id, |
| 143 bool CanCreateReadWriteFileSystemFile(int child_id, | 143 const storage::FileSystemURL& filesystem_url); |
| 144 const storage::FileSystemURL& url); | 144 bool CanCreateFileSystemFile(int child_id, |
| 145 const storage::FileSystemURL& filesystem_url); |
| 146 bool CanCreateReadWriteFileSystemFile( |
| 147 int child_id, |
| 148 const storage::FileSystemURL& filesystem_url); |
| 145 bool CanCopyIntoFileSystemFile(int child_id, | 149 bool CanCopyIntoFileSystemFile(int child_id, |
| 146 const storage::FileSystemURL& url); | 150 const storage::FileSystemURL& filesystem_url); |
| 147 bool CanDeleteFileSystemFile(int child_id, const storage::FileSystemURL& url); | 151 bool CanDeleteFileSystemFile(int child_id, |
| 152 const storage::FileSystemURL& filesystem_url); |
| 148 | 153 |
| 149 // Returns true if the specified child_id has been granted ReadRawCookies. | 154 // Returns true if the specified child_id has been granted ReadRawCookies. |
| 150 bool CanReadRawCookies(int child_id); | 155 bool CanReadRawCookies(int child_id); |
| 151 | 156 |
| 152 // Sets the process as only permitted to use and see the cookies for the | 157 // Sets the process as only permitted to use and see the cookies for the |
| 153 // given origin. | 158 // given origin. |
| 154 // Origin lock is applied only if the --site-per-process flag is used. | 159 // Origin lock is applied only if the --site-per-process flag is used. |
| 155 void LockToOrigin(int child_id, const GURL& gurl); | 160 void LockToOrigin(int child_id, const GURL& gurl); |
| 156 | 161 |
| 157 // Register FileSystem type and permission policy which should be used | 162 // Register FileSystem type and permission policy which should be used |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Determines if certain permissions were granted for a file. |permissions| | 212 // Determines if certain permissions were granted for a file. |permissions| |
| 208 // is an internally defined bit-set. If |child_id| is a worker process, | 213 // is an internally defined bit-set. If |child_id| is a worker process, |
| 209 // this returns true if either the worker process or its parent renderer | 214 // this returns true if either the worker process or its parent renderer |
| 210 // has permissions for the file. | 215 // has permissions for the file. |
| 211 bool HasPermissionsForFile(int child_id, | 216 bool HasPermissionsForFile(int child_id, |
| 212 const base::FilePath& file, | 217 const base::FilePath& file, |
| 213 int permissions); | 218 int permissions); |
| 214 | 219 |
| 215 // Determines if certain permissions were granted for a file in FileSystem | 220 // Determines if certain permissions were granted for a file in FileSystem |
| 216 // API. |permissions| is an internally defined bit-set. | 221 // API. |permissions| is an internally defined bit-set. |
| 217 bool HasPermissionsForFileSystemFile(int child_id, | 222 bool HasPermissionsForFileSystemFile( |
| 218 const storage::FileSystemURL& url, | 223 int child_id, |
| 219 int permissions); | 224 const storage::FileSystemURL& filesystem_url, |
| 225 int permissions); |
| 220 | 226 |
| 221 // Determines if certain permissions were granted for a file system. | 227 // Determines if certain permissions were granted for a file system. |
| 222 // |permissions| is an internally defined bit-set. | 228 // |permissions| is an internally defined bit-set. |
| 223 bool HasPermissionsForFileSystem( | 229 bool HasPermissionsForFileSystem( |
| 224 int child_id, | 230 int child_id, |
| 225 const std::string& filesystem_id, | 231 const std::string& filesystem_id, |
| 226 int permission); | 232 int permission); |
| 227 | 233 |
| 228 // You must acquire this lock before reading or writing any members of this | 234 // You must acquire this lock before reading or writing any members of this |
| 229 // class. You must not block while holding this lock. | 235 // class. You must not block while holding this lock. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 251 WorkerToMainProcessMap worker_map_; | 257 WorkerToMainProcessMap worker_map_; |
| 252 | 258 |
| 253 FileSystemPermissionPolicyMap file_system_policy_map_; | 259 FileSystemPermissionPolicyMap file_system_policy_map_; |
| 254 | 260 |
| 255 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 261 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
| 256 }; | 262 }; |
| 257 | 263 |
| 258 } // namespace content | 264 } // namespace content |
| 259 | 265 |
| 260 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 266 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| OLD | NEW |