Chromium Code Reviews| 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 #include "content/browser/isolated_origin_util.h" | |
| 6 | |
| 7 #include "base/strings/string_util.h" | |
| 8 #include "url/gurl.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 // static | |
| 13 bool IsolatedOriginUtil::DoesOriginMatchIsolatedOrigin( | |
| 14 const url::Origin& origin, | |
| 15 const url::Origin& isolated_origin) { | |
| 16 if (origin.scheme() != isolated_origin.scheme()) | |
| 17 return false; | |
| 18 | |
| 19 if (origin.port() != isolated_origin.port()) | |
| 20 return false; | |
| 21 | |
| 22 // Subdomains of an isolated origin are considered to be in the same isolated | |
| 23 // origin. | |
| 24 return origin.GetURL().DomainIs(isolated_origin.host()); | |
|
Charlie Reis
2017/06/28 01:02:18
Huh, I wouldn't have expected this to work given t
alexmos
2017/06/28 18:29:51
Yeah, it behaves like IsSubdomainOf; this is more
Charlie Reis
2017/06/28 20:56:57
Yes, there may be some ways to make this clearer.
ncarter (slow)
2017/06/28 21:07:49
fwiw I did the same double take too.
url::Origin
alexmos
2017/06/29 21:54:01
Done. Thanks, I didn't notice it was also exposed
| |
| 25 } | |
| 26 | |
| 27 } // namespace content | |
| OLD | NEW |