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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « components/google/core/browser/google_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/google/core/browser/google_util.h" 5 #include "components/google/core/browser/google_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 277
278 bool IsYoutubeDomainUrl(const GURL& url, 278 bool IsYoutubeDomainUrl(const GURL& url,
279 SubdomainPermission subdomain_permission, 279 SubdomainPermission subdomain_permission,
280 PortPermission port_permission) { 280 PortPermission port_permission) {
281 return IsValidURL(url, port_permission) && 281 return IsValidURL(url, port_permission) &&
282 IsValidHostName(url.host_piece(), "youtube", subdomain_permission, 282 IsValidHostName(url.host_piece(), "youtube", subdomain_permission,
283 nullptr); 283 nullptr);
284 } 284 }
285 285
286 const std::vector<std::string>& GetGoogleRegistrableDomains() {
287 CR_DEFINE_STATIC_LOCAL(std::vector<std::string>, kGoogleRegisterableDomains,
288 ());
289
290 // Initialize the list.
291 if (kGoogleRegisterableDomains.empty()) {
292 std::vector<std::string> tlds{GOOGLE_TLD_LIST};
293 for (const std::string& tld : tlds) {
294 std::string domain = "google." + tld;
295
296 // The Google TLD list might contain domains that are not considered
297 // to be registrable domains by net::registry_controlled_domains.
298 if (GetDomainAndRegistry(
299 domain,
300 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES) !=
301 domain) {
302 continue;
303 }
304
305 kGoogleRegisterableDomains.push_back(domain);
306 }
307 }
308
309 return kGoogleRegisterableDomains;
310 }
311
286 } // namespace google_util 312 } // namespace google_util
OLDNEW
« 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