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

Unified Diff: net/base/registry_controlled_domains/registry_controlled_domain.h

Issue 2380523004: Avoid unnecessary std::string allocations. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | net/base/registry_controlled_domains/registry_controlled_domain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/registry_controlled_domains/registry_controlled_domain.h
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain.h b/net/base/registry_controlled_domains/registry_controlled_domain.h
index 24ffb707a50ab5fd44e7b7f86427a9dfd0bff8b6..1c2f56dfa2aaee1084b1715cacc5cfc26038b935 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain.h
+++ b/net/base/registry_controlled_domains/registry_controlled_domain.h
@@ -182,6 +182,13 @@ enum UnknownRegistryFilter {
NET_EXPORT std::string GetDomainAndRegistry(const GURL& gurl,
PrivateRegistryFilter filter);
+// Same as above, but returns a part of |gurl|'s host in a StringPiece.
engedy 2016/09/28 17:22:52 Phrasing nit: ... returns the domain and registry
pkalinnikov 2016/10/05 11:51:35 Done.
+// TODO(pkalinnikov): Rename this to GetDomainAndRegistry and get rid of the
engedy 2016/09/28 17:22:52 As discussed, please run some quick tests to see h
pkalinnikov 2016/10/05 11:51:35 It is used not frequently during normal browsing.
engedy 2016/10/05 11:58:14 Usually it's recommended to leave a TODO only if w
+// std::string-returning version. Update clients.
+NET_EXPORT base::StringPiece GetDomainAndRegistryAsStringPiece(
+ const GURL& gurl,
+ PrivateRegistryFilter filter);
+
// Like the GURL version, but takes a host (which is canonicalized internally)
// instead of a full GURL.
NET_EXPORT std::string GetDomainAndRegistry(base::StringPiece host,
« no previous file with comments | « no previous file | net/base/registry_controlled_domains/registry_controlled_domain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698