| 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 <set> | 10 #include <set> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 14 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/singleton.h" | 17 #include "base/memory/singleton.h" |
| 17 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 18 #include "content/public/browser/child_process_security_policy.h" | 19 #include "content/public/browser/child_process_security_policy.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 private: | 168 private: |
| 168 friend class ChildProcessSecurityPolicyInProcessBrowserTest; | 169 friend class ChildProcessSecurityPolicyInProcessBrowserTest; |
| 169 friend class ChildProcessSecurityPolicyTest; | 170 friend class ChildProcessSecurityPolicyTest; |
| 170 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, | 171 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, |
| 171 NoLeak); | 172 NoLeak); |
| 172 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); | 173 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); |
| 173 | 174 |
| 174 class SecurityState; | 175 class SecurityState; |
| 175 | 176 |
| 176 typedef std::set<std::string> SchemeSet; | 177 typedef std::set<std::string> SchemeSet; |
| 177 typedef std::map<int, SecurityState*> SecurityStateMap; | 178 typedef std::map<int, std::unique_ptr<SecurityState>> SecurityStateMap; |
| 178 typedef std::map<int, int> WorkerToMainProcessMap; | 179 typedef std::map<int, int> WorkerToMainProcessMap; |
| 179 typedef std::map<storage::FileSystemType, int> FileSystemPermissionPolicyMap; | 180 typedef std::map<storage::FileSystemType, int> FileSystemPermissionPolicyMap; |
| 180 | 181 |
| 181 // Obtain an instance of ChildProcessSecurityPolicyImpl via GetInstance(). | 182 // Obtain an instance of ChildProcessSecurityPolicyImpl via GetInstance(). |
| 182 ChildProcessSecurityPolicyImpl(); | 183 ChildProcessSecurityPolicyImpl(); |
| 183 friend struct base::DefaultSingletonTraits<ChildProcessSecurityPolicyImpl>; | 184 friend struct base::DefaultSingletonTraits<ChildProcessSecurityPolicyImpl>; |
| 184 | 185 |
| 185 // Adds child process during registration. | 186 // Adds child process during registration. |
| 186 void AddChild(int child_id); | 187 void AddChild(int child_id); |
| 187 | 188 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 WorkerToMainProcessMap worker_map_; | 251 WorkerToMainProcessMap worker_map_; |
| 251 | 252 |
| 252 FileSystemPermissionPolicyMap file_system_policy_map_; | 253 FileSystemPermissionPolicyMap file_system_policy_map_; |
| 253 | 254 |
| 254 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 255 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
| 255 }; | 256 }; |
| 256 | 257 |
| 257 } // namespace content | 258 } // namespace content |
| 258 | 259 |
| 259 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 260 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
| OLD | NEW |