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

Issue 493253003: Adds default port handling to FormatUrl. (Closed)

Created:
6 years, 4 months ago by dewittj
Modified:
6 years, 1 month ago
Reviewers:
Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org, jshin+watch_chromium.org, felt
Project:
chromium
Visibility:
Public.

Description

Adds default port handling to FormatUrl. This is in preparation for making a "FormatSecurityOriginForTheUser" or some such function; users don't care about the port if it is what they expect such as 80/443 for http/https. BUG=402698

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -2 lines) Patch
M net/base/net_util.h View 1 chunk +4 lines, -0 lines 0 comments Download
M net/base/net_util_icu.cc View 2 chunks +17 lines, -2 lines 1 comment Download
M net/base/net_util_icu_unittest.cc View 1 chunk +30 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
dewittj
PTAL, this is my first time wading into net/ code so please let me know ...
6 years, 4 months ago (2014-08-22 01:19:38 UTC) #1
dewittj
probably need to add a test to FormatUrlParsed and FormatUrlWithOffsets too..
6 years, 4 months ago (2014-08-22 01:25:22 UTC) #2
dewittj
This probably is defunct since GURL canonicalizes input urls, and part of canonicalize removes the ...
6 years, 4 months ago (2014-08-22 20:52:24 UTC) #3
Ryan Sleevi
So... did your unittests confirm it's not needed? :) https://codereview.chromium.org/493253003/diff/1/net/base/net_util_icu.cc File net/base/net_util_icu.cc (right): https://codereview.chromium.org/493253003/diff/1/net/base/net_util_icu.cc#newcode755 net/base/net_util_icu.cc:755: ...
6 years, 4 months ago (2014-08-25 04:16:37 UTC) #4
dewittj
6 years, 4 months ago (2014-08-25 20:45:42 UTC) #5
Yes, unless there is any way to avoid the canonicalization step.  I think the
constructor
  GURL(std::string canonical_spec, const url::Parsed& parsed, bool is_valid);
could be used in this way but based on the name it would be improper usage.  I
think url_format doesn't need to worry about improperly constructed GURLs.

I'll reopen this if you disagree.

Powered by Google App Engine
This is Rietveld 408576698