| 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 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 virtual bool CanReadFileSystem(int child_id, | 73 virtual bool CanReadFileSystem(int child_id, |
| 74 const std::string& filesystem_id) OVERRIDE; | 74 const std::string& filesystem_id) OVERRIDE; |
| 75 virtual bool CanReadWriteFileSystem( | 75 virtual bool CanReadWriteFileSystem( |
| 76 int child_id, | 76 int child_id, |
| 77 const std::string& filesystem_id) OVERRIDE; | 77 const std::string& filesystem_id) OVERRIDE; |
| 78 virtual bool CanCopyIntoFileSystem(int child_id, | 78 virtual bool CanCopyIntoFileSystem(int child_id, |
| 79 const std::string& filesystem_id) OVERRIDE; | 79 const std::string& filesystem_id) OVERRIDE; |
| 80 virtual bool CanDeleteFromFileSystem( | 80 virtual bool CanDeleteFromFileSystem( |
| 81 int child_id, | 81 int child_id, |
| 82 const std::string& filesystem_id) OVERRIDE; | 82 const std::string& filesystem_id) OVERRIDE; |
| 83 virtual bool HasWebUIBindings(int child_id) OVERRIDE; |
| 83 | 84 |
| 84 // Pseudo schemes are treated differently than other schemes because they | 85 // Pseudo schemes are treated differently than other schemes because they |
| 85 // cannot be requested like normal URLs. There is no mechanism for revoking | 86 // cannot be requested like normal URLs. There is no mechanism for revoking |
| 86 // pseudo schemes. | 87 // pseudo schemes. |
| 87 void RegisterPseudoScheme(const std::string& scheme); | 88 void RegisterPseudoScheme(const std::string& scheme); |
| 88 | 89 |
| 89 // Returns true iff |scheme| has been registered as pseudo scheme. | 90 // Returns true iff |scheme| has been registered as pseudo scheme. |
| 90 bool IsPseudoScheme(const std::string& scheme); | 91 bool IsPseudoScheme(const std::string& scheme); |
| 91 | 92 |
| 92 // Upon creation, child processes should register themselves by calling this | 93 // Upon creation, child processes should register themselves by calling this |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 bool CanReadFileSystemFile(int child_id, const fileapi::FileSystemURL& url); | 146 bool CanReadFileSystemFile(int child_id, const fileapi::FileSystemURL& url); |
| 146 bool CanWriteFileSystemFile(int child_id, const fileapi::FileSystemURL& url); | 147 bool CanWriteFileSystemFile(int child_id, const fileapi::FileSystemURL& url); |
| 147 bool CanCreateFileSystemFile(int child_id, const fileapi::FileSystemURL& url); | 148 bool CanCreateFileSystemFile(int child_id, const fileapi::FileSystemURL& url); |
| 148 bool CanCreateReadWriteFileSystemFile(int child_id, | 149 bool CanCreateReadWriteFileSystemFile(int child_id, |
| 149 const fileapi::FileSystemURL& url); | 150 const fileapi::FileSystemURL& url); |
| 150 bool CanCopyIntoFileSystemFile(int child_id, | 151 bool CanCopyIntoFileSystemFile(int child_id, |
| 151 const fileapi::FileSystemURL& url); | 152 const fileapi::FileSystemURL& url); |
| 152 bool CanDeleteFileSystemFile(int child_id, | 153 bool CanDeleteFileSystemFile(int child_id, |
| 153 const fileapi::FileSystemURL& url); | 154 const fileapi::FileSystemURL& url); |
| 154 | 155 |
| 155 // Returns true if the specified child_id has been granted WebUIBindings. | |
| 156 // The browser should check this property before assuming the child process is | |
| 157 // allowed to use WebUIBindings. | |
| 158 bool HasWebUIBindings(int child_id); | |
| 159 | |
| 160 // Returns true if the specified child_id has been granted ReadRawCookies. | 156 // Returns true if the specified child_id has been granted ReadRawCookies. |
| 161 bool CanReadRawCookies(int child_id); | 157 bool CanReadRawCookies(int child_id); |
| 162 | 158 |
| 163 // Returns true if the process is permitted to read and modify the cookies for | 159 // Returns true if the process is permitted to read and modify the cookies for |
| 164 // the given origin. Does not affect cookies attached to or set by network | 160 // the given origin. Does not affect cookies attached to or set by network |
| 165 // requests. | 161 // requests. |
| 166 // Only might return false if the very experimental | 162 // Only might return false if the very experimental |
| 167 // --enable-strict-site-isolation or --site-per-process flags are used. | 163 // --enable-strict-site-isolation or --site-per-process flags are used. |
| 168 bool CanAccessCookiesForOrigin(int child_id, const GURL& gurl); | 164 bool CanAccessCookiesForOrigin(int child_id, const GURL& gurl); |
| 169 | 165 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 WorkerToMainProcessMap worker_map_; | 271 WorkerToMainProcessMap worker_map_; |
| 276 | 272 |
| 277 FileSystemPermissionPolicyMap file_system_policy_map_; | 273 FileSystemPermissionPolicyMap file_system_policy_map_; |
| 278 | 274 |
| 279 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 275 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
| 280 }; | 276 }; |
| 281 | 277 |
| 282 } // namespace content | 278 } // namespace content |
| 283 | 279 |
| 284 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 280 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| OLD | NEW |