| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bool CanReadFileSystem(int child_id, | 67 bool CanReadFileSystem(int child_id, |
| 68 const std::string& filesystem_id) override; | 68 const std::string& filesystem_id) override; |
| 69 bool CanReadWriteFileSystem(int child_id, | 69 bool CanReadWriteFileSystem(int child_id, |
| 70 const std::string& filesystem_id) override; | 70 const std::string& filesystem_id) override; |
| 71 bool CanCopyIntoFileSystem(int child_id, | 71 bool CanCopyIntoFileSystem(int child_id, |
| 72 const std::string& filesystem_id) override; | 72 const std::string& filesystem_id) override; |
| 73 bool CanDeleteFromFileSystem(int child_id, | 73 bool CanDeleteFromFileSystem(int child_id, |
| 74 const std::string& filesystem_id) override; | 74 const std::string& filesystem_id) override; |
| 75 bool HasWebUIBindings(int child_id) override; | 75 bool HasWebUIBindings(int child_id) override; |
| 76 void GrantSendMidiSysExMessage(int child_id) override; | 76 void GrantSendMidiSysExMessage(int child_id) override; |
| 77 bool CanAccessDataForOrigin(int child_id, const GURL& url) override; |
| 77 | 78 |
| 78 // Pseudo schemes are treated differently than other schemes because they | 79 // Pseudo schemes are treated differently than other schemes because they |
| 79 // cannot be requested like normal URLs. There is no mechanism for revoking | 80 // cannot be requested like normal URLs. There is no mechanism for revoking |
| 80 // pseudo schemes. | 81 // pseudo schemes. |
| 81 void RegisterPseudoScheme(const std::string& scheme); | 82 void RegisterPseudoScheme(const std::string& scheme); |
| 82 | 83 |
| 83 // Returns true iff |scheme| has been registered as pseudo scheme. | 84 // Returns true iff |scheme| has been registered as pseudo scheme. |
| 84 bool IsPseudoScheme(const std::string& scheme); | 85 bool IsPseudoScheme(const std::string& scheme); |
| 85 | 86 |
| 86 // Upon creation, child processes should register themselves by calling this | 87 // Upon creation, child processes should register themselves by calling this |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 bool CanCreateFileSystemFile(int child_id, const storage::FileSystemURL& url); | 139 bool CanCreateFileSystemFile(int child_id, const storage::FileSystemURL& url); |
| 139 bool CanCreateReadWriteFileSystemFile(int child_id, | 140 bool CanCreateReadWriteFileSystemFile(int child_id, |
| 140 const storage::FileSystemURL& url); | 141 const storage::FileSystemURL& url); |
| 141 bool CanCopyIntoFileSystemFile(int child_id, | 142 bool CanCopyIntoFileSystemFile(int child_id, |
| 142 const storage::FileSystemURL& url); | 143 const storage::FileSystemURL& url); |
| 143 bool CanDeleteFileSystemFile(int child_id, const storage::FileSystemURL& url); | 144 bool CanDeleteFileSystemFile(int child_id, const storage::FileSystemURL& url); |
| 144 | 145 |
| 145 // Returns true if the specified child_id has been granted ReadRawCookies. | 146 // Returns true if the specified child_id has been granted ReadRawCookies. |
| 146 bool CanReadRawCookies(int child_id); | 147 bool CanReadRawCookies(int child_id); |
| 147 | 148 |
| 148 // Returns true if the process is permitted to read and modify the cookies for | |
| 149 // the given origin. Does not affect cookies attached to or set by network | |
| 150 // requests. | |
| 151 // Only might return false if the --site-per-process flag is used. | |
| 152 bool CanAccessCookiesForOrigin(int child_id, const GURL& gurl); | |
| 153 | |
| 154 // Sets the process as only permitted to use and see the cookies for the | 149 // Sets the process as only permitted to use and see the cookies for the |
| 155 // given origin. | 150 // given origin. |
| 156 // Origin lock is applied only if the --site-per-process flag is used. | 151 // Origin lock is applied only if the --site-per-process flag is used. |
| 157 void LockToOrigin(int child_id, const GURL& gurl); | 152 void LockToOrigin(int child_id, const GURL& gurl); |
| 158 | 153 |
| 159 // Register FileSystem type and permission policy which should be used | 154 // Register FileSystem type and permission policy which should be used |
| 160 // for the type. The |policy| must be a bitwise-or'd value of | 155 // for the type. The |policy| must be a bitwise-or'd value of |
| 161 // storage::FilePermissionPolicy. | 156 // storage::FilePermissionPolicy. |
| 162 void RegisterFileSystemPermissionPolicy(storage::FileSystemType type, | 157 void RegisterFileSystemPermissionPolicy(storage::FileSystemType type, |
| 163 int policy); | 158 int policy); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 WorkerToMainProcessMap worker_map_; | 246 WorkerToMainProcessMap worker_map_; |
| 252 | 247 |
| 253 FileSystemPermissionPolicyMap file_system_policy_map_; | 248 FileSystemPermissionPolicyMap file_system_policy_map_; |
| 254 | 249 |
| 255 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 250 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
| 256 }; | 251 }; |
| 257 | 252 |
| 258 } // namespace content | 253 } // namespace content |
| 259 | 254 |
| 260 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 255 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| OLD | NEW |