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

Issue 114050: url_canon: New CanonicalizeHostVerbose() function. (Closed)

Created:
11 years, 7 months ago by pmarks
Modified:
9 years, 7 months ago
Reviewers:
eroman, brettw
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

url_canon: New CanonicalizeHostVerbose() function. This function allows the caller to distinguish between 4 cases: - A valid, canonical IPv4 address. - A valid, canonical IPv6 address. - A "broken" address. This is something which kinda almost looks like an IP address, but has been deemed to be invalid. For IPv4, this indicates a numerical component which is longer than 16 digits, or one which can't be used without truncation/overflow. For IPv6, this is any non-parseable address containing a colon or square brackets. - "neutral". This indicates that the output doesn't really look like an IP address at all, and should probably be treated as a hostname. The CanonHostInfo struct is meant to be extensible. In addition to the 4 cases above, it also returns the number of components used to make an IPv4 address, which will be useful to Chromium, and will make it possible stop exposing FindIPv4Components. This is the first step toward making Chrome behave better for these cases: - http://[www.google.com]/ - http://192.168.0.0000000000000000000000000001/ - http://192.168.0.99999/ Edit: - Changed the signature of CanonicalizeIPAddress(), instead of creating a new "Verbose" version. - For completeness, now includes the CanonicalizeHost() changes, with an extended-output CanonicalizeHostVerbose(), because some callers only care whether the canonicalization was a success or not.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 2

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 23

Patch Set 9 : Address brettw's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+513 lines, -283 lines) Patch
M src/gurl.cc View 6 7 8 1 chunk +4 lines, -3 lines 0 comments Download
M src/url_canon.h View 1 2 3 4 5 6 7 8 2 chunks +60 lines, -13 lines 0 comments Download
M src/url_canon_host.cc View 6 7 8 6 chunks +57 lines, -49 lines 0 comments Download
M src/url_canon_ip.cc View 1 2 3 4 5 6 7 8 8 chunks +146 lines, -72 lines 0 comments Download
M src/url_canon_unittest.cc View 2 3 4 5 6 7 8 10 chunks +246 lines, -146 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
pmarks
11 years, 7 months ago (2009-05-24 07:02:52 UTC) #1
eroman
I generally like the CanonicalizeIPAddressVerbose() function and how it distinguishes between {IPV4, IPV6, UNKNOWN, BROKEN}. ...
11 years, 7 months ago (2009-05-26 17:59:05 UTC) #2
pmarks
On 2009/05/26 17:59:05, eroman wrote: > I generally like the CanonicalizeIPAddressVerbose() function and how it ...
11 years, 7 months ago (2009-05-26 18:12:08 UTC) #3
pmarks
Brett, are you around? Would you support making this a non-compatible API change? We're also ...
11 years, 7 months ago (2009-05-27 21:39:02 UTC) #4
brettw
Can you give some context for this change? Where will it be called? If this ...
11 years, 7 months ago (2009-05-27 22:01:25 UTC) #5
brettw
I just noticed the other CL, I'll look at it and get back to you.
11 years, 7 months ago (2009-05-27 22:01:54 UTC) #6
pmarks
On 2009/05/27 22:01:54, brettw wrote: > I just noticed the other CL, I'll look at ...
11 years, 7 months ago (2009-05-27 22:12:30 UTC) #7
pmarks
On 2009/05/27 22:01:25, brettw wrote: > For your examples, what are you expecting the browser ...
11 years, 7 months ago (2009-05-27 22:18:20 UTC) #8
pmarks
On Wed, May 27, 2009 at 3:15 PM, Brett Wilson <brettw@chromium.org> wrote: > On Wed, ...
11 years, 7 months ago (2009-05-27 22:30:32 UTC) #9
brettw
http://codereview.chromium.org/114050/diff/1015/2013 File src/url_canon.h (right): http://codereview.chromium.org/114050/diff/1015/2013#newcode401 Line 401: void CanonicalizeIPAddressVerbose(const char16* spec, I'm starting to understand ...
11 years, 7 months ago (2009-05-27 22:39:33 UTC) #10
pmarks
http://codereview.chromium.org/114050/diff/1015/2013 File src/url_canon.h (right): http://codereview.chromium.org/114050/diff/1015/2013#newcode401 Line 401: void CanonicalizeIPAddressVerbose(const char16* spec, On 2009/05/27 22:39:33, brettw ...
11 years, 7 months ago (2009-05-27 23:05:05 UTC) #11
pmarks
Patch set 6 now contains the full collection of changes on the googleurl side. You ...
11 years, 7 months ago (2009-05-28 09:11:51 UTC) #12
pmarks
Brett, are you familiar with what's going on in extensions_service_unittest, or should I ask about ...
11 years, 7 months ago (2009-05-28 21:07:36 UTC) #13
pmarks
That 16-char IPv4 component limit seemed a bit artificial, so I made it unnecessary in ...
11 years, 7 months ago (2009-05-28 22:48:27 UTC) #14
pmarks
Aaron Boodman has fixed the numeric chrome-extension problem: http://codereview.chromium.org/126074 We can continue with this review ...
11 years, 6 months ago (2009-06-14 07:29:05 UTC) #15
pmarks
On 2009/06/14 07:29:05, pmarks wrote: > Aaron Boodman has fixed the numeric chrome-extension problem: > ...
11 years, 6 months ago (2009-06-17 19:49:32 UTC) #16
brettw
http://codereview.chromium.org/114050/diff/1043/2032 File src/url_canon_ip.cc (right): http://codereview.chromium.org/114050/diff/1043/2032#newcode143 Line 143: // Put the component, minus any base prefix, ...
11 years, 6 months ago (2009-06-18 03:04:20 UTC) #17
pmarks
See Patch Set 9. http://codereview.chromium.org/114050/diff/1043/2032 File src/url_canon_ip.cc (right): http://codereview.chromium.org/114050/diff/1043/2032#newcode143 Line 143: // Put the component, ...
11 years, 6 months ago (2009-06-18 20:17:19 UTC) #18
brettw
I'll get to the rest soon. http://codereview.chromium.org/114050/diff/1043/2032 File src/url_canon_ip.cc (right): http://codereview.chromium.org/114050/diff/1043/2032#newcode249 Line 249: for (int ...
11 years, 6 months ago (2009-06-18 21:24:01 UTC) #19
brettw
LGTM
11 years, 6 months ago (2009-06-22 19:21:53 UTC) #20
pmarks
11 years, 6 months ago (2009-06-22 20:30:48 UTC) #21
Committed to googleurl:
http://code.google.com/p/google-url/source/detail?r=107

Next, I'll work on the CL to merge this into Chromium.

Powered by Google App Engine
This is Rietveld 408576698