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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Register FileSystem type and permission policy which should be used | 182 // Register FileSystem type and permission policy which should be used |
183 // for the type. The |policy| must be a bitwise-or'd value of | 183 // for the type. The |policy| must be a bitwise-or'd value of |
184 // fileapi::FilePermissionPolicy. | 184 // fileapi::FilePermissionPolicy. |
185 void RegisterFileSystemPermissionPolicy( | 185 void RegisterFileSystemPermissionPolicy( |
186 fileapi::FileSystemType type, | 186 fileapi::FileSystemType type, |
187 int policy); | 187 int policy); |
188 | 188 |
189 // Returns true if sending system exclusive messages is allowed. | 189 // Returns true if sending system exclusive messages is allowed. |
190 bool CanSendMidiSysExMessage(int child_id); | 190 bool CanSendMidiSysExMessage(int child_id); |
191 | 191 |
| 192 // Returns true if the specified document can register or unregister a service |
| 193 // worker from |script_url| for scope |pattern|. |
| 194 bool CanRegisterServiceWorker(const GURL& document_url, |
| 195 const GURL& pattern, |
| 196 const GURL& script_url); |
| 197 bool CanUnregisterServiceWorker(const GURL& document_url, |
| 198 const GURL& pattern); |
| 199 |
192 private: | 200 private: |
193 friend class ChildProcessSecurityPolicyInProcessBrowserTest; | 201 friend class ChildProcessSecurityPolicyInProcessBrowserTest; |
194 friend class ChildProcessSecurityPolicyTest; | 202 friend class ChildProcessSecurityPolicyTest; |
195 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, | 203 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, |
196 NoLeak); | 204 NoLeak); |
197 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); | 205 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); |
198 | 206 |
199 class SecurityState; | 207 class SecurityState; |
200 | 208 |
201 typedef std::set<std::string> SchemeSet; | 209 typedef std::set<std::string> SchemeSet; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 WorkerToMainProcessMap worker_map_; | 283 WorkerToMainProcessMap worker_map_; |
276 | 284 |
277 FileSystemPermissionPolicyMap file_system_policy_map_; | 285 FileSystemPermissionPolicyMap file_system_policy_map_; |
278 | 286 |
279 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 287 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
280 }; | 288 }; |
281 | 289 |
282 } // namespace content | 290 } // namespace content |
283 | 291 |
284 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 292 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
OLD | NEW |