| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 5 #ifndef CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
| 6 #define CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 6 #define CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
| 7 |
| 7 #pragma once | 8 #pragma once |
| 8 | 9 |
| 9 #include <string> | |
| 10 #include <map> | 10 #include <map> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> |
| 12 | 13 |
| 13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 14 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 15 #include "base/lock.h" | 16 #include "base/lock.h" |
| 16 #include "base/singleton.h" | 17 #include "base/singleton.h" |
| 17 | 18 |
| 18 class FilePath; | 19 class FilePath; |
| 19 class GURL; | 20 class GURL; |
| 20 | 21 |
| 21 // The ChildProcessSecurityPolicy class is used to grant and revoke security | 22 // The ChildProcessSecurityPolicy class is used to grant and revoke security |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Returns true if the specified renderer_id has been granted DOMUIBindings. | 110 // Returns true if the specified renderer_id has been granted DOMUIBindings. |
| 110 // The browser should check this property before assuming the renderer is | 111 // The browser should check this property before assuming the renderer is |
| 111 // allowed to use extension bindings. | 112 // allowed to use extension bindings. |
| 112 bool HasExtensionBindings(int renderer_id); | 113 bool HasExtensionBindings(int renderer_id); |
| 113 | 114 |
| 114 // Returns true if the specified renderer_id has been granted ReadRawCookies. | 115 // Returns true if the specified renderer_id has been granted ReadRawCookies. |
| 115 bool CanReadRawCookies(int renderer_id); | 116 bool CanReadRawCookies(int renderer_id); |
| 116 | 117 |
| 117 private: | 118 private: |
| 118 friend class ChildProcessSecurityPolicyInProcessBrowserTest; | 119 friend class ChildProcessSecurityPolicyInProcessBrowserTest; |
| 119 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, NoLea
k); | 120 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, |
| 121 NoLeak); |
| 120 | 122 |
| 121 class SecurityState; | 123 class SecurityState; |
| 122 | 124 |
| 123 typedef std::set<std::string> SchemeSet; | 125 typedef std::set<std::string> SchemeSet; |
| 124 typedef std::map<int, SecurityState*> SecurityStateMap; | 126 typedef std::map<int, SecurityState*> SecurityStateMap; |
| 125 | 127 |
| 126 // Obtain an instance of ChildProcessSecurityPolicy via GetInstance(). | 128 // Obtain an instance of ChildProcessSecurityPolicy via GetInstance(). |
| 127 ChildProcessSecurityPolicy(); | 129 ChildProcessSecurityPolicy(); |
| 128 friend struct DefaultSingletonTraits<ChildProcessSecurityPolicy>; | 130 friend struct DefaultSingletonTraits<ChildProcessSecurityPolicy>; |
| 129 | 131 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 143 // This map holds a SecurityState for each renderer process. The key for the | 145 // This map holds a SecurityState for each renderer process. The key for the |
| 144 // map is the ID of the RenderProcessHost. The SecurityState objects are | 146 // map is the ID of the RenderProcessHost. The SecurityState objects are |
| 145 // owned by this object and are protected by |lock_|. References to them must | 147 // owned by this object and are protected by |lock_|. References to them must |
| 146 // not escape this class. | 148 // not escape this class. |
| 147 SecurityStateMap security_state_; | 149 SecurityStateMap security_state_; |
| 148 | 150 |
| 149 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicy); | 151 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicy); |
| 150 }; | 152 }; |
| 151 | 153 |
| 152 #endif // CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ | 154 #endif // CHROME_BROWSER_CHILD_PROCESS_SECURITY_POLICY_H_ |
| OLD | NEW |