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()); |
| 25 } |
| 26 |
| 27 } // namespace content |
OLD | NEW |