OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_ | |
6 #define CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_ | |
7 | |
8 #include "url/origin.h" | |
9 | |
10 namespace content { | |
11 | |
12 class IsolatedOriginUtil { | |
13 public: | |
14 // Checks whether |origin| matches the isolated origin specified by | |
15 // |isolated_origin|. Subdomains are considered to match isolated origins, | |
16 // so this will be true if | |
17 // (1) |origin| has the same scheme, host, and port as |isolated_origin|, or | |
18 // (2) |origin| has the same scheme and port as |isolated_origin|, and its | |
19 // host is a subdomain of |isolated_origin|'s host. | |
Charlie Reis
2017/06/28 01:02:18
As above, we may also want to mention that this do
alexmos
2017/06/28 18:29:51
Done.
| |
20 // | |
21 // For example, if |isolated_origin| is https://isolated.foo.com, this will | |
22 // return true if |origin| is https://isolated.foo.com or | |
23 // https://bar.isolated.foo.com, but it will return false for an |origin| of | |
24 // https://unisolated.foo.com or https://foo.com. | |
25 static bool DoesOriginMatchIsolatedOrigin(const url::Origin& origin, | |
26 const url::Origin& isolated_origin); | |
27 }; | |
28 | |
29 } // namespace content | |
30 | |
31 #endif // CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_ | |
OLD | NEW |