Change registry_controlled_domains API to use StringPiece instead of std::string |
||||||
Issue descriptionNow the methods of the registry_controlled_domains [1] library use std::string internally and return strings when it is not necessary. It would be good to change the interface so that it doesn't allocate strings where it's not necessary. For instance, the GetDomainAndRegistry(const GURL&, ...) function could return base::StringPiece pointing to a piece of the GURL. 1. https://cs.chromium.org/chromium/src/net/base/registry_controlled_domains/registry_controlled_domain.h
,
Oct 13 2016
,
Aug 2 2017
Ping! This bug is assigned and has an owner, but hasn't been updated in over 180 days. Is this still something we want to do?
,
Aug 3 2017
I won't be working on this bug in the near future, so I'm leaving it available. One thing that could be addressed is this function: GetDomainAndRegistry(const GURL& gurl, PrivateRegistryFilter filter); It could return base::StringPiece instead of std::string. I'm not sure how valuable improvement it would be. Feel free to mark it WontFix.
,
Aug 3
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 24
,
Aug 24
Skimming things, it seems like it might save a copy, but we'd have to be careful about code like this which acts on a temporary GURL. https://cs.chromium.org/chromium/src/chrome/browser/plugins/plugin_info_host_impl.cc?rcl=c9437e66ce32af03af67988fa734d180efbba6f8&l=491 The one that takes a StringPiece as input does a canonicalization step (whereas I guess GURL can be assumed canonicalized), so it needs to return std::string. I suspect this is questionably useful, but there are quite a few callers? *shrug* |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by bugdroid1@chromium.org
, Oct 13 2016