Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: content/browser/isolated_origin_util.cc

Issue 2891443002: Keep subdomains of an isolated origin in the isolated origin's SiteInstance. (Closed)
Patch Set: Charlie's comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698