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

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

Issue 2891443002: Keep subdomains of an isolated origin in the isolated origin's SiteInstance. (Closed)
Patch Set: Addressing Nick'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 #ifndef CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_
6 #define CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_
7
8 #include "content/common/content_export.h"
9 #include "url/origin.h"
10
11 namespace content {
12
13 class CONTENT_EXPORT IsolatedOriginUtil {
14 public:
15 // Checks whether |origin| matches the isolated origin specified by
16 // |isolated_origin|. Subdomains are considered to match isolated origins,
17 // so this will be true if
18 // (1) |origin| has the same scheme, host, and port as |isolated_origin|, or
19 // (2) |origin| has the same scheme and port as |isolated_origin|, and its
20 // host is a subdomain of |isolated_origin|'s host.
21 // This does not consider site URLs, which don't care about port.
22 //
23 // For example, if |isolated_origin| is https://isolated.foo.com, this will
24 // return true if |origin| is https://isolated.foo.com or
25 // https://bar.isolated.foo.com, but it will return false for an |origin| of
26 // https://unisolated.foo.com or https://foo.com.
27 static bool DoesOriginMatchIsolatedOrigin(const url::Origin& origin,
28 const url::Origin& isolated_origin);
29
30 // Check if |origin| is a valid isolated origin. Invalid isolated origins
31 // include unique origins, origins that don't have an HTTP or HTTPS scheme,
32 // and origins without a valid registry-controlled domain. IP addresses are
33 // allowed.
34 static bool IsValidIsolatedOrigin(const url::Origin& origin);
35 };
36
37 } // namespace content
38
39 #endif // CONTENT_BROWSER_ISOLATED_ORIGIN_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698