// Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_COOKIES_SITE_FOR_COOKIES_H_ #define NET_COOKIES_SITE_FOR_COOKIES_H_ #include <string> #include "base/gtest_prod_util.h" #include "net/base/net_export.h" #include "net/base/schemeful_site.h" #include "url/gurl.h" #include "url/origin.h" namespace net { // Represents which origins are to be considered same-site for a given // context (e.g. frame). There may be none. // // The currently implemented policy ("schemeful") is that // two valid URLs would be considered same-site if either: // 1) They both have compatible schemes along with non-empty and equal // registrable domains or hostnames/IPs. Two schemes are compatible if they // are either equal, or are both in {http, ws}, or are both in {https, wss}. // E.x. "https://example.com" and "wss://example.com" // 2) They both have empty hostnames and exactly equal schemes. E.x. "file://" // and "file://" // // With the SchemefulSameSite feature disabled the policy ("schemeless") is that // two valid URLs would be considered the same site if either: 1) They both have // non-empty and equal registrable domains or hostnames/IPs. E.x. "example.com" // and "example.com" 2) They both have empty hostnames and equal schemes. E.x. // "file://" and "file://" // // // Invalid URLs are never same-site to anything. class NET_EXPORT SiteForCookies { … }; } // namespace net #endif // NET_COOKIES_SITE_FOR_COOKIES_H_