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

Unified Diff: components/google/core/browser/google_util.cc

Issue 2966763003: [Prototype] Delete Google service worker caches on Android signout (Closed)
Patch Set: Addressed nits. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/google/core/browser/google_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/google/core/browser/google_util.cc
diff --git a/components/google/core/browser/google_util.cc b/components/google/core/browser/google_util.cc
index b8f8c1daa9ec038d7f0c81704b53f4053a3a4c6f..845e22a633c5ceeacc1cbae42fa3343cea0eb256 100644
--- a/components/google/core/browser/google_util.cc
+++ b/components/google/core/browser/google_util.cc
@@ -283,4 +283,30 @@ bool IsYoutubeDomainUrl(const GURL& url,
nullptr);
}
+const std::vector<std::string>& GetGoogleRegistrableDomains() {
+ CR_DEFINE_STATIC_LOCAL(std::vector<std::string>, kGoogleRegisterableDomains,
+ ());
+
+ // Initialize the list.
+ if (kGoogleRegisterableDomains.empty()) {
+ std::vector<std::string> tlds{GOOGLE_TLD_LIST};
+ for (const std::string& tld : tlds) {
+ std::string domain = "google." + tld;
+
+ // The Google TLD list might contain domains that are not considered
+ // to be registrable domains by net::registry_controlled_domains.
+ if (GetDomainAndRegistry(
+ domain,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES) !=
+ domain) {
+ continue;
+ }
+
+ kGoogleRegisterableDomains.push_back(domain);
+ }
+ }
+
+ return kGoogleRegisterableDomains;
+}
+
} // namespace google_util
« no previous file with comments | « components/google/core/browser/google_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698