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 <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // https://unisolated.com/ --> (unique origin) | 263 // https://unisolated.com/ --> (unique origin) |
264 bool GetMatchingIsolatedOrigin(const url::Origin& origin, | 264 bool GetMatchingIsolatedOrigin(const url::Origin& origin, |
265 url::Origin* result); | 265 url::Origin* result); |
266 | 266 |
267 // Removes a previously added isolated origin, currently only used in tests. | 267 // Removes a previously added isolated origin, currently only used in tests. |
268 // | 268 // |
269 // TODO(alexmos): Exposing this more generally will require extra care, such | 269 // TODO(alexmos): Exposing this more generally will require extra care, such |
270 // as ensuring that there are no active SiteInstances in that origin. | 270 // as ensuring that there are no active SiteInstances in that origin. |
271 void RemoveIsolatedOriginForTesting(const url::Origin& origin); | 271 void RemoveIsolatedOriginForTesting(const url::Origin& origin); |
272 | 272 |
273 // Returns false for redirects that must be blocked no matter which renderer | |
274 // process initiated the request (if any). | |
275 // Note: Checking CanRedirectToURL is not enough. CanRequestURL(child_id, url) | |
276 // represents a stricter subset. It must also be used for | |
277 // renderer-initiated navigations. | |
278 bool CanRedirectToURL(const GURL& url); | |
279 | |
280 private: | 273 private: |
281 friend class ChildProcessSecurityPolicyInProcessBrowserTest; | 274 friend class ChildProcessSecurityPolicyInProcessBrowserTest; |
282 friend class ChildProcessSecurityPolicyTest; | 275 friend class ChildProcessSecurityPolicyTest; |
283 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, | 276 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyInProcessBrowserTest, |
284 NoLeak); | 277 NoLeak); |
285 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); | 278 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, FilePermissions); |
286 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, | 279 FRIEND_TEST_ALL_PREFIXES(ChildProcessSecurityPolicyTest, |
287 IsolateOriginsFromCommandLine); | 280 IsolateOriginsFromCommandLine); |
288 | 281 |
289 class SecurityState; | 282 class SecurityState; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // eTLD+1. Each of these origins requires a dedicated process. This set is | 367 // eTLD+1. Each of these origins requires a dedicated process. This set is |
375 // protected by |lock_|. | 368 // protected by |lock_|. |
376 std::set<url::Origin> isolated_origins_; | 369 std::set<url::Origin> isolated_origins_; |
377 | 370 |
378 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); | 371 DISALLOW_COPY_AND_ASSIGN(ChildProcessSecurityPolicyImpl); |
379 }; | 372 }; |
380 | 373 |
381 } // namespace content | 374 } // namespace content |
382 | 375 |
383 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ | 376 #endif // CONTENT_BROWSER_CHILD_PROCESS_SECURITY_POLICY_IMPL_H_ |
OLD | NEW |