OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 6 #define CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
7 | 7 |
8 #pragma once | 8 #pragma once |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "content/common/content_export.h" |
18 | 19 |
19 class FilePath; | 20 class FilePath; |
20 class GURL; | 21 class GURL; |
21 | 22 |
22 // The ChildProcessSecurityPolicy class is used to grant and revoke security | 23 // The ChildProcessSecurityPolicy class is used to grant and revoke security |
23 // capabilities for child processes. For example, it restricts whether a child | 24 // capabilities for child processes. For example, it restricts whether a child |
24 // process is permitted to load file:// URLs based on whether the process | 25 // process is permitted to load file:// URLs based on whether the process |
25 // has ever been commanded to load file:// URLs by the browser. | 26 // has ever been commanded to load file:// URLs by the browser. |
26 // | 27 // |
27 // ChildProcessSecurityPolicy is a singleton that may be used on any thread. | 28 // ChildProcessSecurityPolicy is a singleton that may be used on any thread. |
28 // | 29 // |
29 class ChildProcessSecurityPolicy { | 30 class CONTENT_EXPORT ChildProcessSecurityPolicy { |
30 public: | 31 public: |
31 // Object can only be created through GetInstance() so the constructor is | 32 // Object can only be created through GetInstance() so the constructor is |
32 // private. | 33 // private. |
33 ~ChildProcessSecurityPolicy(); | 34 ~ChildProcessSecurityPolicy(); |
34 | 35 |
35 // There is one global ChildProcessSecurityPolicy object for the entire | 36 // There is one global ChildProcessSecurityPolicy object for the entire |
36 // browser process. The object returned by this method may be accessed on | 37 // browser process. The object returned by this method may be accessed on |
37 // any thread. | 38 // any thread. |
38 static ChildProcessSecurityPolicy* GetInstance(); | 39 static ChildProcessSecurityPolicy* GetInstance(); |
39 | 40 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 SecurityStateMap security_state_; | 198 SecurityStateMap security_state_; |
198 | 199 |
199 // This maps keeps the record of which js worker thread child process | 200 // This maps keeps the record of which js worker thread child process |
200 // corresponds to which main js thread child process. | 201 // corresponds to which main js thread child process. |
201 WorkerToMainProcessMap worker_map_; | 202 WorkerToMainProcessMap worker_map_; |
202 | 203 |
203 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicy); | 204 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicy); |
204 }; | 205 }; |
205 | 206 |
206 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 207 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
OLD | NEW |