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 22 matching lines...) Expand all Loading... |
33 class CONTENT_EXPORT ChildProcessSecurityPolicyImpl | 33 class CONTENT_EXPORT ChildProcessSecurityPolicyImpl |
34 : NON_EXPORTED_BASE(public ChildProcessSecurityPolicy) { | 34 : NON_EXPORTED_BASE(public ChildProcessSecurityPolicy) { |
35 public: | 35 public: |
36 // Object can only be created through GetInstance() so the constructor is | 36 // Object can only be created through GetInstance() so the constructor is |
37 // private. | 37 // private. |
38 virtual ~ChildProcessSecurityPolicyImpl(); | 38 virtual ~ChildProcessSecurityPolicyImpl(); |
39 | 39 |
40 static ChildProcessSecurityPolicyImpl* GetInstance(); | 40 static ChildProcessSecurityPolicyImpl* GetInstance(); |
41 | 41 |
42 // ChildProcessSecurityPolicy implementation. | 42 // ChildProcessSecurityPolicy implementation. |
43 virtual void RegisterWebSafeScheme(const std::string& scheme) OVERRIDE; | 43 virtual void RegisterWebSafeScheme(const std::string& scheme) override; |
44 virtual bool IsWebSafeScheme(const std::string& scheme) OVERRIDE; | 44 virtual bool IsWebSafeScheme(const std::string& scheme) override; |
45 virtual void GrantReadFile(int child_id, const base::FilePath& file) OVERRIDE; | 45 virtual void GrantReadFile(int child_id, const base::FilePath& file) override; |
46 virtual void GrantCreateReadWriteFile(int child_id, | 46 virtual void GrantCreateReadWriteFile(int child_id, |
47 const base::FilePath& file) OVERRIDE; | 47 const base::FilePath& file) override; |
48 virtual void GrantCopyInto(int child_id, const base::FilePath& dir) OVERRIDE; | 48 virtual void GrantCopyInto(int child_id, const base::FilePath& dir) override; |
49 virtual void GrantDeleteFrom(int child_id, | 49 virtual void GrantDeleteFrom(int child_id, |
50 const base::FilePath& dir) OVERRIDE; | 50 const base::FilePath& dir) override; |
51 virtual void GrantReadFileSystem( | 51 virtual void GrantReadFileSystem( |
52 int child_id, | 52 int child_id, |
53 const std::string& filesystem_id) OVERRIDE; | 53 const std::string& filesystem_id) override; |
54 virtual void GrantWriteFileSystem( | 54 virtual void GrantWriteFileSystem( |
55 int child_id, | 55 int child_id, |
56 const std::string& filesystem_id) OVERRIDE; | 56 const std::string& filesystem_id) override; |
57 virtual void GrantCreateFileForFileSystem( | 57 virtual void GrantCreateFileForFileSystem( |
58 int child_id, | 58 int child_id, |
59 const std::string& filesystem_id) OVERRIDE; | 59 const std::string& filesystem_id) override; |
60 virtual void GrantCreateReadWriteFileSystem( | 60 virtual void GrantCreateReadWriteFileSystem( |
61 int child_id, | 61 int child_id, |
62 const std::string& filesystem_id) OVERRIDE; | 62 const std::string& filesystem_id) override; |
63 virtual void GrantCopyIntoFileSystem( | 63 virtual void GrantCopyIntoFileSystem( |
64 int child_id, | 64 int child_id, |
65 const std::string& filesystem_id) OVERRIDE; | 65 const std::string& filesystem_id) override; |
66 virtual void GrantDeleteFromFileSystem( | 66 virtual void GrantDeleteFromFileSystem( |
67 int child_id, | 67 int child_id, |
68 const std::string& filesystem_id) OVERRIDE; | 68 const std::string& filesystem_id) override; |
69 virtual void GrantScheme(int child_id, const std::string& scheme) OVERRIDE; | 69 virtual void GrantScheme(int child_id, const std::string& scheme) override; |
70 virtual bool CanReadFile(int child_id, const base::FilePath& file) OVERRIDE; | 70 virtual bool CanReadFile(int child_id, const base::FilePath& file) override; |
71 virtual bool CanCreateReadWriteFile(int child_id, | 71 virtual bool CanCreateReadWriteFile(int child_id, |
72 const base::FilePath& file) OVERRIDE; | 72 const base::FilePath& file) override; |
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 virtual bool HasWebUIBindings(int child_id) override; |
84 | 84 |
85 // Pseudo schemes are treated differently than other schemes because they | 85 // Pseudo schemes are treated differently than other schemes because they |
86 // 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 |
87 // pseudo schemes. | 87 // pseudo schemes. |
88 void RegisterPseudoScheme(const std::string& scheme); | 88 void RegisterPseudoScheme(const std::string& scheme); |
89 | 89 |
90 // Returns true iff |scheme| has been registered as pseudo scheme. | 90 // Returns true iff |scheme| has been registered as pseudo scheme. |
91 bool IsPseudoScheme(const std::string& scheme); | 91 bool IsPseudoScheme(const std::string& scheme); |
92 | 92 |
93 // Upon creation, child processes should register themselves by calling this | 93 // Upon creation, child processes should register themselves by calling this |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 WorkerToMainProcessMap worker_map_; | 269 WorkerToMainProcessMap worker_map_; |
270 | 270 |
271 FileSystemPermissionPolicyMap file_system_policy_map_; | 271 FileSystemPermissionPolicyMap file_system_policy_map_; |
272 | 272 |
273 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 273 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
274 }; | 274 }; |
275 | 275 |
276 } // namespace content | 276 } // namespace content |
277 | 277 |
278 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 278 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
OLD | NEW |