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

Issue 2939423003: URL Formatter: Add StripSubdomain method that preserves eTLD + 1. (Closed)

Created:
3 years, 6 months ago by tommycli
Modified:
3 years, 5 months ago
Reviewers:
Peter Kasting, felt
CC:
chromium-reviews, Justin Donnelly
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

URL Formatter: Add StripSubdomain method that preserves eTLD + 1. We already had a StripWWW and StripWWWFromHost method, but they are designed to be simple and may turn "www.com" into "com", which is undesirable for some use cases. This method is more sophisticated and designed to to elide subdomains from hosts for the purposes of Omnibox suggestion display. BUG=732582

Patch Set 1 #

Patch Set 2 : reformat #

Patch Set 3 : remove spurious change #

Patch Set 4 : fix #

Total comments: 14

Patch Set 5 : update comment #

Patch Set 6 : fix #

Total comments: 4

Patch Set 7 : fix #

Patch Set 8 : Return std::string instead of base::StringPiece (which makes no sense) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -12 lines) Patch
M chrome/browser/search_engines/template_url_service_sync_unittest.cc View 3 chunks +8 lines, -5 lines 0 comments Download
M components/ssl_errors/error_classification.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M components/url_formatter/url_formatter.h View 1 2 3 4 5 6 7 1 chunk +10 lines, -3 lines 0 comments Download
M components/url_formatter/url_formatter.cc View 1 2 3 4 5 6 7 2 chunks +23 lines, -2 lines 0 comments Download
M components/url_formatter/url_formatter_unittest.cc View 1 2 3 4 5 6 1 chunk +43 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 38 (24 generated)
tommycli
pkasting: PTAL. This patch is laying the groundwork for the trivially-informative subdomain elision experiment.
3 years, 6 months ago (2017-06-17 01:34:01 UTC) #6
Peter Kasting
https://codereview.chromium.org/2939423003/diff/60001/components/url_formatter/url_formatter.cc File components/url_formatter/url_formatter.cc (right): https://codereview.chromium.org/2939423003/diff/60001/components/url_formatter/url_formatter.cc#newcode587 components/url_formatter/url_formatter.cc:587: std::string etld_plus_one = Nit: Prefer to use the same ...
3 years, 6 months ago (2017-06-17 02:46:55 UTC) #9
tommycli
pkasting: Thanks! I re-jiggered this based on your comments. https://codereview.chromium.org/2939423003/diff/60001/components/url_formatter/url_formatter.cc File components/url_formatter/url_formatter.cc (right): https://codereview.chromium.org/2939423003/diff/60001/components/url_formatter/url_formatter.cc#newcode587 components/url_formatter/url_formatter.cc:587: ...
3 years, 6 months ago (2017-06-19 23:03:08 UTC) #13
Peter Kasting
LGTM https://codereview.chromium.org/2939423003/diff/100001/components/url_formatter/url_formatter.cc File components/url_formatter/url_formatter.cc (right): https://codereview.chromium.org/2939423003/diff/100001/components/url_formatter/url_formatter.cc#newcode599 components/url_formatter/url_formatter.cc:599: if ((subdomains & kStripWWW) != 0) Nit: Personally ...
3 years, 6 months ago (2017-06-19 23:42:32 UTC) #17
tommycli
Awesome thanks, I'm sending this in now. https://codereview.chromium.org/2939423003/diff/100001/components/url_formatter/url_formatter.cc File components/url_formatter/url_formatter.cc (right): https://codereview.chromium.org/2939423003/diff/100001/components/url_formatter/url_formatter.cc#newcode599 components/url_formatter/url_formatter.cc:599: if ((subdomains ...
3 years, 6 months ago (2017-06-19 23:48:51 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2939423003/120001
3 years, 6 months ago (2017-06-19 23:49:19 UTC) #24
tommycli
+cc jdonnelly - this will be the logic used for the subdomain elision experiment.
3 years, 6 months ago (2017-06-19 23:49:36 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/468045)
3 years, 6 months ago (2017-06-19 23:58:57 UTC) #27
tommycli
felt: PTAL components/ssl_errors, thanks!
3 years, 6 months ago (2017-06-20 00:03:14 UTC) #29
felt
Hi, we generally don't encourage removing subdomains from Chrome UI, with the exception of "www" ...
3 years, 6 months ago (2017-06-20 20:50:03 UTC) #34
tommycli
On 2017/06/20 20:50:03, felt wrote: > Hi, we generally don't encourage removing subdomains from Chrome ...
3 years, 6 months ago (2017-06-20 20:52:11 UTC) #35
tommycli
On 2017/06/20 20:52:11, tommycli wrote: > On 2017/06/20 20:50:03, felt wrote: > > Hi, we ...
3 years, 6 months ago (2017-06-22 19:10:09 UTC) #36
tommycli
On 2017/06/22 19:10:09, tommycli wrote: > On 2017/06/20 20:52:11, tommycli wrote: > > On 2017/06/20 ...
3 years, 6 months ago (2017-06-23 18:22:10 UTC) #37
tommycli
3 years, 5 months ago (2017-06-30 23:01:09 UTC) #38
On 2017/06/23 18:22:10, tommycli wrote:
> On 2017/06/22 19:10:09, tommycli wrote:
> > On 2017/06/20 20:52:11, tommycli wrote:
> > > On 2017/06/20 20:50:03, felt wrote:
> > > > Hi, we generally don't encourage removing subdomains from Chrome UI,
with
> > the
> > > > exception of "www" and "m". Is this being added with one project
> > specifically
> > > in
> > > > mind? I'm worried it will end up being used elsewhere in ways that are
not
> > > > appropriate.
> > > 
> > > Hey felt@ -- The code only permits removal of 'www' and 'm' currently.
This
> is
> > > specifically for the Omnibox suggestions dropdown list, which is not
> supposed
> > to
> > > be a security surface. (Treated as insecure).
> > > 
> > > We could potentially move this code into component/omnibox, but it really
> > feels
> > > like it belongs in url_formatter. Are there any specific scarier warnings
we
> > > should be adding to the .h file comments?
> > 
> > felt: ping, thanks!
> 
> hi felt: friendly ping thanks

Actually DO NOT REVIEW or SUBMIT. This CL contains the wrong approach, as it
fails for the wwww.google.com case (four w's).

Powered by Google App Engine
This is Rietveld 408576698